Using calculus of residues to evaluate a trig integral

enter image description here

This is my partial attempt at the solution. I am unsure how to proceed further.


Hint: You have a pole at $z=0$ of order $5001$ and you need the formula to calculate the residue.

Added: Another approach for finding the residue is to compute the Laurent series of the integrand. Rearranging the integral as

$$\frac{2\pi}{2^{5000}} \frac{1}{2\pi i}\int_{|z|=1}\frac{(1+z^2)^{5000}}{z^{5001}}dz.$$

Then computing the Laurent series using the binomial theorem gives

$$ \frac{(1+z^2)^{5000}}{z^{5001}} = \sum_{m=0}^{5000} {5000 \choose m} z^{2m-5001}. $$

Now, the residue is the coefficient of $z^{-1}$ which corresponds to $m=2500$ in the above series and equals

$$ r = \frac{2\pi}{2^{5000}}{5000 \choose 2500} . $$