I'm trying to solve evaluate $\int_{0}^{2\pi} \frac{\cos 2\theta}{2+\cos \theta} d\theta$. What I did is the Cauchy-Residue Theorem approach.
I can have $z = e^{i\theta}$ where $\theta \in [0,2\pi]$. So $dz/(iz) = d\theta$. Since $\cos \theta = \frac{z+z^{-1}}{2}$ and $\sin \theta = \frac{z-z^{-1}}{2i}$, it follows that $\cos 2\theta = \frac{z^2+z^{-2}}{2}$.
So substituting, we have $\int_{|z| = 1} \frac{z^4+1}{z^2+4z+1}dz$. But I'm stuck in here. Can you help me? Please!!! I will truly appreciate all the help.
Let $z_1=-2+\sqrt{3}$ and $z_2=-2-\sqrt{3}$. Then $z_1,z_2$ are the zeros of $z^2+4z+1,$ we have $|z_2| >1$ and $|z_2|<1.$ Thus
$$\int_{|z| = 1} \frac{z^4+1}{z^2+4z+1}dz= 2 \pi i Res(f;z_1),$$
where $f(z)=\frac{z^4+1}{z^2+4z+1}.$ $f$ has at $z_1$ a simple pole, thus
$$Res(f;z_1)= \lim_{z \to z_1}(z-z_1)f(z).$$
$\lim_{z \to z_1}(z-z_1)f(z)$ is easy to calculate.