Complex Analysis – Evaluate the Integral $\int_0^{2 \pi} {\cos^2 \theta \over a + b \cos \theta}\; d\theta$

complex-analysisdefinite integrals

Given $a > b > 0$ what is the fastest possible way to evaluate the following integral using Residue theorem. I'm confused weather to take the imaginary part of $z^2$ or whole integral.
$$\int_0^{2 \pi} {\cos^2 \theta \over a + b \cos \theta}\; d\theta$$

Best Answer

If $z=e^{i\theta}$, then $\cos\theta=\dfrac 1 2\left(z+\dfrac1z\right)$, and $dz=ie^{i\theta}\,d\theta/2=iz\,d\theta/2$, so $-2i\dfrac{dz}{z} = d\theta$. Then $$ \int_0^{2\pi} \frac{\cos^2\theta}{a+b\cos\theta} d\theta = \int\limits_\text{circle} \frac{\frac14\left(z+\frac1z\right)^2}{a+\frac b2\left(z+\frac1z\right)}(-i)\frac{dz}{z} = -i\int\limits_\text{circle} \frac{z^4+2z^2+1}{2z^2(2az+b(z^2+1))} dz. $$

This function has a double pole at $z=0$ and simple poles at $\dfrac{-a\pm\sqrt{a^2-b^2}}{b}$. So the question is: for which values of $a,b$ are the simple poles inside the circle? If there's just one simple pole inside the circle at $c$, then the integral becomes $$ \int\limits_\text{circle} \frac{g(z)}{z-c} dz = 2\pi i g(c), $$ where $g(z)$ is whatever's left after you've factored out $1/(z-c)$. If there's more than one simple pole, you need a sum: take values of $g$ at those points and sum them.