TITLE: $\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a + \sin^2(\theta)} = \frac{\pi}{2\sqrt{a(a+1)}}$, for $a > 0$
QUESTION [7 upvotes]: I want to show that
$$\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a + \sin^2(\theta)} = \frac{\pi}{2\sqrt{a(a+1)}}$$
for $a > 0$.
I try several methods

Substitutions to rationalize
The famous $U = \tan(\frac{\theta}{2})$
Multiplying by conjugates

and other calculus techniques and still, I can not prove the equality. 
Anyone can give me a hint of how should I begin to work this integral?
I'm very ashamed that I can not solve this problem.

REPLY [2 votes]: A complex analysis approach. 
Note that $\sin^2(x)=\frac{1}{2}(1-\cos(t))$ with $t=2x$.  Moreover, let $z=e^{it}$, $dz=zi\,dt$ and $\cos(x)=\frac{1}{2}(z+\frac{1}{z})$, and, by using the Residue Theorem, we find
$$\begin{align}\int_0^{\pi/2}\frac{dx}{a+\sin^2(x)} &=
\frac{1}{2}\int_{-\pi/2}^{\pi/2}\frac{dx}{a+\sin^2(x)}\\
&= \frac{1}{2}\int_{-\pi}^{\pi}\frac{dt}{(1+2a)-\cos(t)}\\
&=i\int_{|z|=1}\frac{dz}{z^2-2(1+2a)z+1}\\
\\&=2\pi i^2\mbox{Res}(f,z_2)=\frac{-2\pi}{2z_2-2(1+2a)}=\frac{\pi}{2\sqrt{a^2+a}}\end{align}$$
where the poles are $z_{1} = 2\sqrt{a^2+a}+1+2a$ and $z_{2} = -2\sqrt{a^2+a}+1+2a$.