Solve complex integral: $\int_{0}^{2\pi} \frac{\cos{3\theta}}{5-4\cos\theta}d\theta$ I'm trying to show that the following complex integral is:
$$\int_{0}^{2\pi} \frac{\cos{3\theta}}{5-4\cos\theta}d\theta = \frac{\pi}{12}$$
I have thought about calculating the residues of this function at where the denominator becomes zero but as $\cos\theta$ is always less or equal to 1, I don't know how to apply this method.
Is there any other way for solving this kind of integrals? Please, could you give me any hint?
Thanks!
 A: Hint:
$$\int_{0}^{2\pi} \frac{\cos3\theta}{5 - 4\cos\theta} \ d\theta = \frac{i}{2}\int_{C} \frac{z^3 +z^{-3}}{z(5 - 2(z+z^{-1}))} \ dz $$
Where $C$ is the unit circle and $z = e^{i\theta}$. Simplifying gives
$$\frac{1}{2i}\int_C\frac{z^6+1}{z^3(-2z^2+5z -2)} $$
Then apply the residue theorem.
A: Let $z=e^{\theta i}$, then $$
I=\int_0^{2 \pi} \frac{e^{3 i \theta} d \theta}{5-4 \cos \theta}=\int_{\kappa(0,1)} \frac{z^3 d z}{i z\left[5-2\left(z+z^{-1}\right)\right]}
$$
where $\kappa(0,1)$ is the unit circle with centre O.
Simplifying and factorising yields
$$I=i \int_{\kappa(0,1)} \frac{z^3}{(2 z-1)(z-2)} d z $$The integrand has a simple pole within $\kappa(0,1)$ at $z=\frac{1}{2} $ and the residue is $$
\begin{aligned}
\operatorname{Res}\left(\frac{z^3}{(2 z-1)(z-2)} ,z= \frac{1}{2}\right) & =\lim _{z \rightarrow \frac{1}{2}}\left(z-\frac{1}{2}\right) \cdot \frac{z^3}{(2 z-1)(z-2)} \\
& =-\frac{1}{24}
\end{aligned}
$$
Hence $$
\int_0^{2 \pi} \frac{\cos 3 \theta d \theta}{5-4 \cos \theta}=Re(I)=Re[2 \pi i \cdot i \cdot(-\frac{1}{24})]=\frac{\pi}{12}
$$
By the way, $$\int_0^{2 \pi} \frac{\sin{3 \theta} d \theta}{5-4 \cos \theta}=0$$
