Residue theorem integral calculation Use the residue theorem to calculate
$$\int_{0}^{2\pi}  \frac {27} {(5+4\sin\theta)^2} d\theta $$
I know
$$ \operatorname{Res}_{z_0} f = \frac 1 {2\pi i} \int_\gamma d\theta f(\theta) $$
My question is how do I plug in that function in this formula?
Thanks!
 A: The trick for this type of question is  $$\int_0^{2\pi} \frac{d\theta}{(a+b\sin\theta)^2}= \displaystyle \frac{2\pi ab}{(a^2-b^2)^{3/2}} $$
Here $a=5$ and $b=4.$
Therefore,
$$\int_{0}^{2\pi}  \frac {27} {(5+4\sin\theta)^2} d\theta =  \frac{27 \cdot 2\pi \cdot 5\cdot 4}{(25-16)^{3/2}}=40\pi.$$
A: The integral between $0$ and $2\pi$ should make you think of the unit circle $C(0,1)$. The parametrization is done by $e^{i\theta}$ with $\theta \in [0,2\pi].$ Hence you can write 
\begin{align*}
\int_{0}^{2\pi}  \frac {27} {(5+4\sin\theta)^2} d\theta & = \int_{0}^{2\pi}  \frac {27} {(5-2i(e^{i\theta}-e^{-i\theta}))^2} d\theta\\
& =\frac{1}{i} \int_{C(0,1)} \frac{27}{z(5-2i(z-1/z))^2} dz \\
& =\frac{1}{i} \int_{C(0,1)} \frac{27z}{(-2iz^2+5z+2i)^2} dz
\end{align*}
The two poles of order $2$ are $\frac{-5\pm\sqrt{21}}{-4i}$. The only pole in the unit disk is $\frac{-5+\sqrt{21}}{-4i}$. Applying the usual formula for residue, you find that $$Res\left(\frac{27z}{(-2iz^2+5z+2i)^2},\frac{-5+\sqrt{21}}{-4i}\right) = \lim_{z\to \frac{-5+\sqrt{21}}{-4i}}\left(\frac{27z}{z-\frac{5-\sqrt{21}}{4i} }\right)'=5.$$ Hence $$\int_{0}^{2\pi}  \frac {27} {(5+4\sin\theta)^2} d\theta = 10\pi,$$ which is the good answer according to mathematica. 
