Evaluate $\int_{0}^{2\pi}\frac{1}{1+\sin^{2}(\theta)}d\theta$

complex-analysisdefinite integralsintegration

I'm pretty sure the idea is to interpret this integral as a contour integral over a closed path in the complex plane.
$$I = \int_{0}^{2\pi}\frac{1}{1+\sin^{2}(\theta)}d\theta$$

We take $C = \{z \in \mathbb{C} : |z| = 1\}$, which is positively oriented.

$$z = e^{i\theta}$$
$$\frac{dz}{d\theta} = ie^{i\theta} = iz \rightarrow d\theta = \frac{dz}{iz} $$
$$\sin(\theta) = \frac{e^{i\theta}-e^{-i\theta}}{2i} = \frac{z-z^{-1}}{2i} $$

$$\sin^2(\theta) = \frac{z^2 – 2zz^{-1} + z^{-2}}{(2i)^2} = \frac{z^2 – 2 + z^{-2}}{-4} $$

After some manipulation:

$$I = \frac{4}{i}\oint_{C}\frac{z}{-z^4+6z^2-1}dz$$

After that one should obtain the roots of the polynomial in the denominator and solve the integral either by residues or using Cauchy's formula. However, I'm not sure how to find the roots. This was in the context of an exam, so I assume something must be wrong if the roots are too difficult to find, or if they are not "nice" numbers.

Is there a more clever way of going about this? I tried calculating the residue at infinity, but $\frac{1}{z^{2}}f(\frac{1}{z})$ yields the exact same function and it doesn't get any easier.

Thanks.

Best Answer

Contour integration is a chance, but not the only one. For instance, symmetry gives $$ \int_{0}^{2\pi}\frac{d\theta}{1+\sin^2\theta}=4\int_{0}^{\pi/2}\frac{d\theta}{1+\sin^2\theta}=4\int_{0}^{\pi/2}\frac{d\theta}{1+\cos^2\theta}\stackrel{\theta\mapsto\arctan u}{=}4\int_{0}^{+\infty}\frac{du}{2+u^2} $$ and the last integral clearly equals $\color{red}{\pi\sqrt{2}}$.