# How to solve this complex indefinite integral? In a contour

I have to solve this indefinite integral $$\int_{0}^{\pi} \frac{\cos(4\theta)}{1+\cos^2(\theta)}\, d\theta$$

I changed $$\cos(4\theta)$$ for $$\frac{e^{4i\theta}+e^{-4i\theta}}{2}$$ on the unit disk, but my teacher told me that this shouldn't be done.

What should I do?

• First, this is not an indefinite integral. You want to integrate around the entire circle and write it as a contour integral $\int_{|z|=1} f(z)\,dz$ for an appropriate function $f(z)$. – Ted Shifrin May 21 at 0:25
• sorry for my mistake. I did try to find the appropiate $f(z)$ by doing the change that I mentioned – Estrellita42 May 21 at 0:28

Use the formula $$\cos 2x=2\cos^2 x-1,$$ you will get $$\cos(4\theta)=8\cos^4 \theta-8\cos^2 \theta+1.$$
Let $$t=1+\cos^2(\theta)$$, then $$\frac{\cos(4\theta)}{1+\cos^2(\theta)}=8 t-24+\frac{17}{t}.$$
$$\int_{0}^{\pi} \frac{\cos(4\theta)}{1+\cos^2(\theta)}\, d\theta =2\int_{0}^{\pi/2} \frac{\cos(4\theta)}{1+\cos^2(\theta)}\, d\theta$$ $$=2\int_{0}^{\pi/2} \left(8(1+\cos^2 \theta)-24+\frac{17}{1+\cos^2 \theta}\right) \, d\theta$$ $$=\left(-12+\frac{17}{\sqrt 2}\right)\pi.$$
Hint: $$I=\int_{0}^{\pi} \frac{2\cos^22\theta-1}{1+\frac12(1+\cos2\theta)} d\theta$$ with substitution $$\phi=2\theta$$ we have $$I=\int_{0}^{2\pi} \frac{2\cos^2\phi-1}{3+\cos \phi} d\phi$$ now take $$\cos \phi=\dfrac12(z+\dfrac1z)$$ and $$d\phi=\dfrac{dz}{iz}$$ and use residue theorem.
• Isn't this literally the same thing as $z=e^{i\theta}$, which his/her teacher told not to? – acarturk May 21 at 0:46
• The point is to end up with a rational function $f(z)$ to integrate around the unit circle by applying the Residue Theorem. You didn't say that explicitly, but it's there. – Ted Shifrin May 21 at 0:50