Compute $\int_0^{2\pi} \frac{\cos \theta}{5+4\cos\theta}\,d\theta$ using contour integration This question was asked in my complex analysis quiz and I was unable to solve it there.

Show that $\displaystyle \int_0^{2\pi}\frac{\cos (\theta)}{5+ 4\cos(\theta)}\,d\theta = -\frac{\pi}{3} $.

5 + 4 cos $\theta$ is zero iff $cos(\theta) $= -5/4. So, there are no poles of the equation $\frac{\cos (\theta) } { 5+ 4\cos (\theta)}$. So, I think that residue theorem can't be used here.
Can you please give a hint or two on how to solve this problem using complex analysis?
 A: The idea here is to consider an integral of a complex valued function around the unit circle which will become your integral once you parametrize. Cauchy's theorems can then be applied to evaluate the complex integral. Consider
$$ \int_{C(0,1)} \frac{z}{2z^2+5z+2} \, dz $$
where $C(0,1)$ is the unit circle. Parametrizing we have
$$ \int_0^{2\pi} \frac{e^{i\theta}}{2e^{2i\theta}+5e^{i\theta}+2} ie^{i\theta} \, d \theta = \int_0^{2\pi} \frac{ie^{i\theta}}{2e^{i\theta}+5+2e^{-i\theta}} \, d\theta = \int_0^{2\pi} \frac{ie^{i\theta}}{5+4\cos \theta} \, d\theta $$
and so what we need to find is the imaginary part of the complex integral. Factoring and applying Cauchy's integral formula gives
$$  \int_{C(0,1)} \frac{z}{2z^2+5z+2} \, dz = \int_{C(0,1)} \frac{z}{2(z+2)\left(z+\frac{1}{2} \right)} \, dz = 2\pi i \left. \frac{z}{2(z+2)} \right|_{z=-\frac{1}{2}} = -\frac{\pi i}{3} $$
since the only pole within the unit circle is a simple pole at $-\frac{1}{2}$. Equating imaginary parts gives the value $-\frac{\pi}{3}$ for your integral.
