I have to calculate the integral
$$I=\int_{0}^{2\pi}\frac{\cos^2(3\theta)}{5-4\cos(2\theta)}d\theta$$
using residues, but I'm having trouble calculating the residue in $z=0$. If you rewrite the integral by stating $z=exp(i\theta)$, and letting gamma be the unitary circle, then:
$$I=\int_{\gamma} \frac {(\frac {z^9+1}{2z^3})^2}{5-2(z^2+z^{-2})}\frac{1}{zi}dz$$
Well, if you do a little algebra you have that
$$\frac {(\frac {z^9+1}{2z^3})^2}{5-2(z^2+z^{-2})}\frac{1}{zi}=\frac{1}{4i}\frac{(z^9+1)^2}{z^5(-2z^4+5z^2-2)}$$
I'm struggling with the residue of this function in $z=0$. Any ideas?
This is an exercise taken from the book Churchill's about Complex Analysis, in case that is useful.
PD: I have made a mistake when replacing the cosines, and the function is a bit different. Iǘe already edited it.
After normalising a little, you need the coefficient of $z^4$ in the Taylor series of
$$\frac{1+2z^9+z^{18}}{1 - \frac{5}{2}z^2 + z^4},$$
if you haven't made any mistakes in your computation thus far (which I haven't checked). Then expand the denominator in a geometric series. Since $9 > 4$, only the $1$ of the numerator is relevant for the coefficient of $z^4$, and
$$\frac{1}{1 - \frac{5}{2}z^2 + z^4} = 1 + \left(\frac{5}{2}z^2-z^4\right) + \left(\frac{5}{2}z^2-z^4\right)^2 + O(z^6)$$
makes it easy to see the coefficient of $z^4$ is $\frac{25}{4} - 1$.