$\int_{0}^{\frac{\pi}{2}}\frac{d\theta}{a + \sin^2(\theta)} = \frac{\pi}{2\sqrt{a(a+1)}}$, for $a > 0$

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 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$.