I am studying for a qualifying exam, and this contour integral is getting pretty messy:
$\displaystyle I = \int_0^{\pi} \dfrac{\cos(4\theta)}{1+\cos^2(\theta)} d\theta $
I first notice that the integrand is an even function hence
$\displaystyle I = \dfrac{1}{2} \int_{-\pi}^{\pi} \dfrac{\cos(4\theta)}{1+\cos^2(\theta)} d\theta $
Then make the substitutions $\cos(n\theta) = \dfrac{e^{in\theta}+e^{-in\theta}}{2}$, and $z=e^{i\theta}$ to obtain:
$\displaystyle I = \dfrac{1}{2} \int_{||z||=1} \dfrac{\dfrac{z^4+z^{-4}}{2}}{1+\left(\dfrac{z+z^{-1}}{2}\right)^2} \dfrac{-i}{z}dz = -i \int_{||z||=1} \dfrac{z^8+1}{z^3(z^4+6z^2+1)} dz$
Now, assuming this is right so far, this seems "straight-forward" in the sense that I know what to do. However, it gets ugly. I was hoping there might be a better method to evaluate this integral.
Thanks