Use residue theorem to establish the integration formula: $$\int_0^{2\pi} \frac{\cos^2(3\theta)}{5-4\cos(2\theta)}d\theta = \frac{3\pi}{8}$$
Hi, so I'm stuck on this question. I've gotten up to computing the residues as being $z_{+/-} = 1/\sqrt2$ and $z = 0$ though I'm not sure how to go from here.
EDIT: Okay I've gotten to the point of knowing that the value of the integral is equal to the sum of the residues at each singularity, though I am having difficulty with computing the residue at $z = 0$. That is the only issue I'm having left.
Notice the bounds of integration $[0,2\pi]$ is the interval used to parameterize the unit circle as $z=e^{i\theta}$. In this case, we make the following substitutions. $$\begin{align*} \cos(\theta)&=\frac{z+z^{-1}}{2}\\ dz&=ie^{i\theta}d\theta \Leftrightarrow d\theta=\frac{dz}{iz} \end{align*}$$ The first substitution comes straight from the properties of $z=e^{i\theta}$ on the unit circle: $\cos(\theta)=({e^{i\theta}+e^{-i\theta}})/{2}$. $$\begin{align*} \int_0^{2\pi}\frac{\cos^2(3\theta)}{5-4\cos(2\theta)}\ d\theta&=\int_{|z|=1}\frac{\left(\frac{z^3+z^{-3}}{2}\right)^2}{5-4\left(\frac{z^2+z^{-2}}{2}\right)}\ \frac{dz}{iz}\\ &=\int_{|z|=1}\frac{z^6+2+z^{-6}}{4i\left(5z-2(z^3+z^{-1})\right)}\ dz\\ &=\int_{|z|=1}\frac{z^{12}+2z^6+1}{4i(5z^7-2z^9-2z^5)}\ dz\\ &=\int_{|z|=1}\frac{z^{12}+2z^6+1}{4iz^5(-2z^4+5z^2-2)}\ dz \end{align*}$$ Here let, $$f(z)=\frac{z^{12}+2z^6+1}{4iz^5(-2z^4+5z^2-2)}$$ notice the poles of the function lie at $z=0,\pm2^{1/2},\pm2^{-1/2}$ but only $z=0,\pm2^{-1/2}$ lie within the contour. The Residue theorem implies, $$\int_{|z|=1}f(z)\ dz=2\pi i \sum\left[\text{residues of}\ f\ \text{inside}\ |z|=1\right]$$ at $z=0$ the pole is of order $5$ and we could use the formula for higher-order poles, $$\mathrm{Res}(f,z_0)=\frac{1}{(n-1)!}\lim_{z\to z_0}\frac{d^{n-1}}{dz^{n-1}}\left((z-z_0)^nf(z)\right)$$ where $z_0$ is a pole of order $n$, but this will get pretty messy so we will find the residue through the laurent expansion of $f$ around $z=0$ with the required accuracy. $$\begin{align*} f(z)=\frac{z^{12}+2z^6+1}{4iz^5(-2z^4+5z^2-2)}&=\frac{1}{4iz^5}\cdot\frac{1}{-2z^4+5z^2-2}\cdot (z^{12}+2z^6+1)\\ &=-\frac{1}{8iz^5}\cdot\frac{1}{1-\left(\frac{5}{2}z^2-z^4\right)}\cdot(1+\mathcal{O}(z^6))\\ &=-\frac{1}{8iz^5}\cdot\left[1+\left(\frac{5}{2}z^2-z^4\right)+\left(\frac{5}{2}z^2-z^4\right)^2+\mathcal{O}(z^6)\right]\cdot(1+\mathcal{O}(z^6))\\ &=-\frac{1}{8iz^5}\cdot\left[1+\frac{5}{2}z^2+\frac{21}{4}z^4+\mathcal{O}(z^6)\right] \end{align*}$$ Thus, the residue (coeff of $z^{-1}$ term) is, $$\text{Res}(f,0)=-\frac{21}{32i}=\frac{21}{32}i$$ the identity $i^{-1}=-i$ was used. Next, at $z=2^{-1/2}$ the pole is simple so with L'Hôpital's rule, $$\text{Res}\left(f,\frac{1}{\sqrt2}\right)=\lim_{z\to \frac{1}{\sqrt2}}\left[\left(z-\frac{1}{\sqrt2}\right)\frac{z^{12}+2z^6+1}{4iz^5(-2z^4+5z^2-2)}\right]=-\frac{27}{64}i$$ at $z=-2^{-1/2}$ the pole is simple again. $$\text{Res}\left(f,-\frac{1}{\sqrt2}\right)=\lim_{z\to -\frac{1}{\sqrt2}}\left[\left(z+\frac{1}{\sqrt2}\right)\frac{z^{12}+2z^6+1}{4iz^5(-2z^4+5z^2-2)}\right]=-\frac{27}{64}i$$ Hence, $$\begin{align*} \int_0^{2\pi}\frac{\cos^2(3\theta)}{5-4\cos(2\theta)}\ d\theta&=\int_{|z|=1}\frac{z^{12}+2z^6+1}{4iz^5(-2z^4+5z^2-2)}\ dz\\ &=2\pi i \left(\text{Res}(f,0)+\text{Res}\left(f,\frac{1}{\sqrt2}\right)+\text{Res}\left(f,-\frac{1}{\sqrt2}\right)\right)\\ &=2\pi i \left(\frac{21}{32}i-\frac{27}{64}i-\frac{27}{64}i\right)\\ &=\frac{3}{8}\pi. \end{align*}$$