Evaluate using Residues $\int_0^{2\pi}\frac{d\theta}{1+a\sin\theta}$ I need to evaluate the following using residues: $\int_0^{2\pi}\frac{d\theta}{1+a\sin\theta}$ where $-1<\theta<1$.
I suppose the $a$ in front of $\sin\theta$ is throwing me off.  I was thinking I could let $z=e^{i\theta}$ and so $\sin\theta=\frac{z-z^{-1}}{2i}$ and $dz=izd\theta$.  So, the integral becomes: $\int_{|z|=1}\frac{dz}{iz(1+a(\frac{z-z^{-1}}{2i}))}$.  After some, hopefully mistake-free, algebra, we'd get:
$2\int_{|z|=1}\frac{dz}{az^2+2iz-a}$.  Now, we can use the quadratic formula (again, hopefully mistake-free) to get $z=\frac{-i\pm\sqrt{-1-a^2}}{a}$.
From here, I'm not really sure where to go.  Do I just plug and chug and find residues using these two poles, or is there something sneaky going on?  Or, did I make a mistake somewhere earlier?
Any help is appreciated :)  Thank you.

I guess nothing prevents you from exploiting some symmetry before switching to the computation of residues.
$$\int_{0}^{2\pi}\frac{d\theta}{1+a\sin\theta}=\int_{0}^{\pi}\frac{d\theta}{1+a\sin\theta}+\int_{0}^{\pi}\frac{d\theta}{1-a\sin\theta}=\int_{0}^{\pi}\frac{2\,d\theta}{1-a^2\sin^2\theta}$$
equals
$$ 4\int_{0}^{\pi/2}\frac{d\theta}{1-a^2\sin^2\theta}=4\int_{0}^{\pi/2}\frac{d\theta}{1-a^2\cos^2\theta} $$
or, by letting $\theta=\arctan u$,
$$ 4\int_{0}^{+\infty}\frac{du}{(1+u^2)-a^2}=2\int_{-\infty}^{+\infty}\frac{du}{(1-a^2)+u^2} $$
which equals
$$ 4\pi i\operatorname*{Res}_{u=i\sqrt{1-a^2}}\frac{1}{(1-a^2)+u^2}=\frac{2\pi}{\sqrt{1-a^2}}. $$
