where $a>1$ calculate $$\int_{0}^{\pi} \dfrac{dx}{a+\sin^2(x)}$$
I tried to use the regular $z=e^{ix}$ in $|z|=1$ contour. ($2\sin(x) = z-\frac1z)$, but it turned out not to work well because $\sin(x)$ in denominator. could not found a good variables change either.
We can facilitate the complex plane analysis by making use of the identity
$$\sin^2x=\frac{1-\cos 2x}{2}$$
Then, we have
$$\begin{align} I(a)&=\int_0^{\pi}\frac{1}{a+\sin ^2x}dx\\\\ &=\int_0^{\pi}\frac{2}{(2a+1)-a\cos 2x}dx\\\\ &=\int_0^{2\pi}\frac{1}{(2a+1)-\cos x}dx \tag 1 \end{align}$$
Now, we move to the complex plane and let $z=e^{ix}$ in $(1)$. Thus, $dx=\frac{dz}{iz}$ and we have
$$I(a)=i\oint_{|z|=1}\frac{2}{z^2-2(2a+1)z+1}dz$$
The pole inside the unit circle is at $z=(2a+1)-\sqrt{(2a+1)^2-1}$. Thus, using the residue theorem we have
$$\bbox[5px,border:2px solid #C0A000]{I(a)=\frac{\pi}{\sqrt{a(a+1)}}}$$