$\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a + \sin^2(\theta)} = \frac{\pi}{2\sqrt{a(a+1)}}$, for $a > 0$ 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. 
 A: Hint
Let $u=\tan(\theta),$ or $\theta=\arctan(u).$ Then the integral becomes
$$\int_{0}^{\infty} \frac{1}{a+\frac{u^2}{1+u^2}} \frac{1}{1+u^2} \ du= \int_{0}^{\infty} \frac{1}{(a+1)u^2+a} \ du,$$
Can you take it from here ? 
A: 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$. 
A: Multiply numerator and denominator by $\csc^2x$,
$$ \int \frac{\csc^2 \theta}{a \csc^2 \theta+1} \,d\theta$$
use $\csc^2\theta = \cot^2\theta+1$ and substitute $u\mapsto \cot \theta$,
$$ - \int \frac{1}{au^2 + a + 1}\,du $$
factor out $1/(a+1)$,
$$ \frac{-1}{a+1} \int \frac{1}{\frac{au^2}{a+1}+1}\,du $$
substitute $t\mapsto u\sqrt{\frac{a}{a+1}}$,
$$ -\frac 1 a \sqrt{\frac{a}{a+1}} \int \frac{1}{t^2+1}\, dt $$
use arctan derivative,
$$ -\frac 1 a \sqrt{\frac{a}{a+1}} \arctan(t) + c $$
and finally substitute back in to get,
$$ \frac{1}{\sqrt{a(a+1)}} \cdot \arctan\left( \frac{\tan \theta}{\sqrt{a/(a+1)}}\right) + c $$
Now evaluate at the endpoints and you should get the RHS of your identity.
A: 
\begin{align} \int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a +
> \sin^2(\theta)}  &=  \frac{\pi}{2[a(a+1)]^\frac{1}{2}} \end{align}

\begin{align}
I=
\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a + \sin^2(\theta)} 
&= 
\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{(\sqrt{a+1} + \cos\theta)
 (\sqrt{a+1} - \cos\theta} 
\\
&=\frac1{2\sqrt{a+1}}
\left(
\int_0^{\tfrac\pi2}
\frac{d\theta}{\sqrt{a+1} + \cos\theta}
+
\int_0^{\tfrac\pi2}
\frac{d\theta}{\sqrt{a+1} - \cos\theta}
\right)
.
\end{align}
Now we can use  a table integral
\begin{align}
\int \frac{dx}{u+v\cos x}
&=
\frac2{\sqrt{u^2-v^2}}
\arctan\left( \frac{(u-v)\tan\tfrac{x}2}{\sqrt{u^2-v^2}} \right)
,\quad u^2>v^2
\end{align}
for $u=\sqrt{a+1}$, $v=\pm 1$.
\begin{align}
I&=
\frac1{2\,u}
\frac2{\sqrt{u^2-1}}
\left(
\arctan\left(
\sqrt{\frac{u-1}{u+1}}\tan\tfrac\pi4
\right)
+
\arctan\left(
\sqrt{\frac{u+1}{u-1}}\tan\tfrac\pi4
\right)
\right)
,\\
&=
\frac1{u\,\sqrt{u^2-1}}
\left(
\arctan\left(
\sqrt{\frac{u-1}{u+1}}
\right)
+
\arctan\left(
\sqrt{\frac{u+1}{u-1}}
\right)
\right)
.
\end{align}
And since $\arctan x+\arctan \tfrac1x=\tfrac\pi2$ for $x>0$, we have
\begin{align}
I&=
\frac{\pi}{2\,\sqrt{a+1}\,\sqrt{a}}
.
\end{align}
A: Another method is as follows. Using $2\sin^{2}t = 1 - \cos 2t$ we can see that $$\int_{0}^{\pi/2}\frac{dt}{a + \sin^{2}t} = 2\int_{0}^{\pi/2}\frac{dt}{2a + 1 - \cos 2t}$$ and putting $2t = z$ we get the integral as $$\int_{0}^{\pi}\frac{dz}{2a + 1 - \cos z}$$ which is equal to $$\frac{\pi}{\sqrt{(2a + 1)^{2} - 1^{2}}} = \frac{\pi}{2\sqrt{a(a+1)}}$$ The above integral is a special case of the general formula $$\int_{0}^{\pi}\frac{dx}{A + B\cos x} = \int_{0}^{\pi}\frac{dx}{A - B\cos x} = \frac{\pi}{\sqrt{A^{2} - B^{2}}}$$ which holds if $A > |B|$. The general formula can be established using the substitution $$(A + B\cos x)(A - B\cos y)= A^{2} - B^{2}$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\int_{0}^{\pi/2}{\dd\theta \over a + \sin^{2}\pars{\theta}} & =
\int_{0}^{\pi/2}{\sec^{2}\pars{\theta}\,\dd\theta \over
a\sec^{2}\pars{\theta} + \tan^{2}\pars{\theta}} =
\int_{0}^{\pi/2}{\sec^{2}\pars{\theta}\,\dd\theta \over
\pars{a + 1}\tan^{2}\pars{\theta} + a}
\\[5mm] & =
{1 \over a}\,\root{a \over a + 1}\int_{0}^{\pi/2}{%
\root{\pars{a + 1}/a}\sec^{2}\pars{\theta}\,\dd\theta \over
\bracks{\root{\pars{a + 1}/a}\tan\pars{\theta}}^{\,2} + 1}
\\[5mm] & \stackrel{x\ \equiv\ \root{\pars{a + 1}/a}\tan\pars{\theta}}{=}\,\,\,
{1 \over \root{a\pars{a + 1}}}\
\underbrace{\int_{0}^{\infty}{\dd x \over x^{2} + 1}}
_{\ds{=\ {\pi \over 2}}}\ =\
\bbx{\pi \over 2\,\bracks{a\pars{a + 1}}^{1/2}}
\end{align}
