How do I evaluate this integral using cauchy's residue theorem. $$\int_0^{2\pi} \dfrac{\cos 2 \theta}{1+\sin^2 \theta}d\theta$$
$$=\dfrac{-2}{i}\oint_{|z|=1} \dfrac{z^4+1}{z(z^4-4z^2-2z+1)}dz $$
I am stuck on how to use Cauchy's residue theorem since the bottom does not factor nicely. I know $z=-1$, $z=0.3111$ and $z=0$ lie within the contour but not sure where to go from here.
 A: By symmetry, our integral is just:
$$ \color{red}{I}=4\int_{0}^{\pi/2}\frac{\cos(2\theta)}{1+\sin^2\theta}\,d\theta = 4\int_{0}^{\pi/2}\frac{1-2\cos^2\varphi}{1+\cos^2\varphi}\,d\varphi \tag{1}$$
($\varphi=\frac{\pi}{2}-\theta$) and through the substitution $\varphi=\arctan t$ we get:
$$ I = 4\int_{0}^{+\infty}\frac{t^2-1}{(1+t^2)(2+t^2)}\,dt =\color{red}{\pi(3\sqrt{2}-4)}\tag{2}$$
where the last step follows from partial fraction decomposition:
$$ \frac{t^2-1}{(t^2+1)(t^2+2)} = \frac{3}{2+t^2}-\frac{2}{1+t^2}.\tag{3}$$
A: First, use the formula $$\sin^2(\theta)=\frac{1-\cos(2\theta)}{2}.$$ Your integral is $$I = 2\Re \int_0^{2\pi} \frac{e^{2i\theta}}{3-\cos(2\theta)}d\theta = 4\Re \int_0^{2\pi} \frac{e^{2i\theta}}{6-e^{2i\theta}-e^{-2i\theta}}d\theta=4\Re \frac{1}{i} \int_{C(0,1)}\frac{z^3}{6z^2-z^4-1}dz.$$ Now you can easily use residue theorem. The trick here was to use the real part for the numerator to simplify the computations.
A: Using trig. identities and eulers formula and long division:
$$
 \int_0^{2 \pi} \dfrac{ \cos 2 \theta}{1+\sin^2 \theta} d \theta=\int_0^{2 \pi} \dfrac{ \cos 2 \theta}{1+\frac{1}{2}(1-\cos 2\theta)}$$
 $$=2\int_0^{2 \pi} \dfrac{ \cos 2 \theta}{3-\cos 2\theta}$$
 $$= 2 \int_0^{2 \pi} - d\theta + 6\int_0^{2\pi}\dfrac{d \theta}{3- \cos 2\theta}$$
 $$-4\pi +\dfrac{12}{i}\oint_{|z|=1}\dfrac{zdz}{(-z^4+6z^2-1)}$$
 $$-4 \pi +\dfrac{12}{i}\oint_{|z|=1}\dfrac{zdz}{(z-1-\sqrt{2})(z+1+\sqrt{2})(z-\sqrt{2}+1)(z+\sqrt{2}-1)}$$
 $$=-4 \pi +24\pi Res(f;\sqrt{2}-1)+24 \pi Res(f;-\sqrt{2}+1) $$
 $$-4\pi + \frac{3}{2}\sqrt{2}\pi+\frac{3}{2} \sqrt{2} \pi $$
 $$\pi(3\sqrt{2}-4)$$
This what I was looking for. I'm not sure if this is correct or not but it did match one of the answers.
