# How to use complex analysis to find the integral $\int^\pi_{−\pi} \frac 1 {1+\sin^2(\theta)} d\theta$?

How can I use complex analysis to solve the following:

$$\int^\pi_{−\pi} \frac 1 {1+\sin^2(\theta)} d\theta$$

• Is that $\sin(2\theta)$ or $\sin^2(\theta)$? – Joshua Mundinger Dec 16 '14 at 20:08
• @Alqatrkapa doesn't matter much for the strategy, which seems to be what the OP is asking for. – mrf Dec 16 '14 at 20:13
• @mrf True, but regardless it's good for the long-term quality of the question. – Joshua Mundinger Dec 16 '14 at 20:14
• intended $sin^2 \theta$ – magoo Dec 16 '14 at 20:18

Start with $$z=e^{i\theta} \\ \log z=i\theta \\ \theta=-i\log z \\ d\theta=-\frac izdz$$ Now we substitute $z$ into our integral. $$\oint\frac{-i}{z(1+\sin^2(-i\log z))}dz \\$$ Analyzing just the $\sin$ part for a moment: \begin{align} \sin(-i\log z)&=-\frac i2\left(e^{i(-i\log z)}-e^{-i(-i\log z)}\right)\\ &=-\frac i2\left(e^{\log z}-e^{-\log z}\right) \\ &=-\frac i2\left(z-\frac 1z\right) \\ &=\frac{i(1-z^2)}{2z} \end{align} Now we go back to the integral: $$\oint\frac{-i}{z\left(1+\left(\frac{i(1-z^2)}{2z}\right)^2\right)}dz \\ =\oint\frac{-i}{z\left(1-\frac{(1-z^2)^2}{4z^2}\right)}dz \\ =i\oint\frac{1}{\frac{1-6z^2+z^4}{4z}}dz \\ =i\oint\frac{4z}{1-6z^2+z^4}dz$$ Now we can do partial fraction decomposition on the integrand to expose its poles: $$=\frac{i}{2\sqrt{2}}\oint\frac{1}{z-(-1-\sqrt{2})}-\frac{1}{z-(-1+\sqrt{2})}-\frac{1}{z-(1-\sqrt{2})}+\frac{1}{z-(1+\sqrt{2})}dz \\$$ Two of these poles (the negative ones) are inside the unit circle, our integration contour. By Cauchy's integral formula, we get the value of the integral: $$2\pi i\left(\frac{i}{2\sqrt{2}}(-1-1)\right)=2\pi\frac{-2}{-2\sqrt{2}}=\sqrt{2}\pi$$
Put $z=e^{i\theta}$ and rewrite using Euler's forumulas to transform the integral to a complex curve integral along the unit circle.
A mixed technique is most suited for solving this problem. We have: $$I = 4\int_{0}^{\pi/2}\frac{d\theta}{1+\sin^2\theta}=4\int_{0}^{\pi/2}\frac{d\theta}{1+\cos^2\theta}$$ and substituting $\theta=\arctan t$: $$I = 4\int_{0}^{+\infty}\frac{dt}{(1+t^2)\left(1+\frac{1}{1+t^2}\right)}=2\int_{-\infty}^{+\infty}\frac{dt}{2+t^2},$$ where the last integral can be approached through the residue theorem or by explicit integration: $$2\int_{-\infty}^{+\infty}\frac{dt}{2+t^2}=\sqrt{2}\int_{\mathbb{R}}\frac{du}{1+u^2}=\color{red}{\pi\sqrt{2}.}$$
• $\displaystyle{1 \over 1 + \sin^{2}\left(\,\theta\,\right)} ={\sec^{2}\left(\,\theta\,\right) \over \sec^{2}\left(\,\theta\,\right) + \tan^{2}\left(\,\theta\,\right)}={\sec^{2}\left(\,\theta\,\right) \over 2 + \tan^{2}\left(\,\theta\,\right)}$ – Felix Marin Dec 17 '14 at 18:54