Evaluate $\int\frac{d\theta}{1+x\sin^2(\theta)}$ We have to evaluate $$\int\frac{d\theta}{1+x\sin^2(\theta)}$$

Here is all my steps:

$$\tan\frac{\theta}{2}=\omega\Rightarrow \sin(\theta)=\frac{2\omega}{1+\omega^2}\Rightarrow 1+x\sin^2{(\theta)}=1+\frac{x 4\omega^2}{(\omega^2+1)^2}$$
Therefore: $$\int\frac{d\theta}{1+x\sin^2(\theta)}=2\int\frac{\omega^2+1\:\ d \omega}{(\omega^2+1)^2+x(2\omega)^2}=2\left(\int\frac{\omega^2\:\ d \omega}{(\omega^2+1)^2+x(2\omega^2)}+\int\frac{d\omega}{(\omega^2+1)^2+x(2\omega)^2}\right)$$ 

I don't know if I'm wrong somewhere but I don't have ideea how can I continue...

 A: Instead of the half-angle substitution I would try using
$$\frac{1}{1+x\sin^2\theta} = \frac{1}{(1+x)\sin^2\theta + \cos^2\theta}= \frac{\sec^2\theta}{(1+x)\tan^2\theta + 1}.$$
Now substitute $u=\sqrt{|1+x|}\tan \theta$ (I don't see a way to avoid splitting the cases $x>-1$ and $x<-1$).
A: Hint: Let $$\sin \theta = \pm\frac{\omega}{\sqrt {1 +\omega^2}} \implies 1  +x\sin ^2 \theta = 1 + \frac{x\omega^2}{1 + \omega^2} = \frac{1 + (1 + x) \omega^2}{1 + \omega^2 }$$
where $\omega = \tan \theta$. Then 
$$\int \frac{1 + \omega^2}{1  +(1 + x)\omega^2} d\theta = \int \frac{\sec^2 \theta}{1 + (1 +x)\tan^2 \theta} d\theta$$
Can you take it from here?
A: If you prefer to solve this integral using the tangent half-angle substitution, I would recommend using a power-reduction formula to reduce the $\sin^2{\theta}$ term before proceeding to the tangent half-angle substitution step. This yields a much simpler rational function to integrate. We find:
$$\begin{align}
\int\frac{\mathrm{d}\theta}{1+\alpha\sin^2{\left(\theta\right)}}
&=\int\frac{\mathrm{d}\theta}{1+\frac{\alpha}{2}\left(1-\cos{\left(2\theta\right)}\right)}\\
&=\int\frac{\mathrm{d}\theta}{1+\frac{\alpha}{2}-\frac{\alpha}{2}\cos{\left(2\theta\right)}}\\
&=\int\frac{\mathrm{d}\phi}{2+\alpha-\alpha\cos{\left(\phi\right)}};~~~\small{\left[2\theta=\phi\right]}\\
&=\int\frac{\frac{2}{1+t^2}\,\mathrm{d}t}{2+\alpha-\alpha\frac{1-t^2}{1+t^2}};~~~\small{\left[\phi=2\arctan{\left(t\right)}\right]}\\
&=\int\frac{2\,\mathrm{d}t}{(2+\alpha)(1+t^2)-\alpha(1-t^2)}\\
&=\int\frac{\mathrm{d}t}{\left(\alpha+1\right)t^2+1}.\\
\end{align}$$
The rest of the calculation is quite straightforward, though the three cases $a>-1$ and $a=-1$ and $a<-1$ have to be treated separately (unless you're comfortable with complex numbers).
A: $$
\tan\frac{\theta}{2}=\omega,\qquad \sin(\theta)=\frac{2\omega}{1+\omega^2},\qquad d\theta=\frac{2\,d\omega}{1+\omega^2}
$$
\begin{align}
& \int\frac{d\theta}{1+x\sin^2(\theta)} = \int \frac{\dfrac{2\,d\omega}{1+\omega^2}}{1+x\left(\dfrac{2\omega}{1+\omega^2}\right)^2} = \int \frac{2(1+\omega^2)\,d\omega}{(1+\omega^2)^2 + 4\omega^2 x} \\[10pt]
= {} & \int \frac{2(1+\omega^2)\,d\omega}{\omega^4 + (2+4x)\omega^2 + 1}
= \int \frac{2(1+\omega^2)\,d\omega}{\Big(\omega^4 + (2+4x)\omega^2 + (1+2x)^2 \Big) + 1 - (1+2x)^2} \\[10pt]
= {} & \int \frac{2(1+\omega^2)\,d\omega}{\Big(\omega^2 + 1+2x \Big)^2 + 1 - (1+2x)^2} = \int \frac{2(1+\omega^2)\,d\omega}{\Big(\omega^2 + 1+2x \Big)^2 - (4x+4x^2)} \\[10pt]
= {} & \int \frac{2(1+\omega^2)\,d\omega}{\Big(\omega^2 + 1+2x - 2\sqrt{x+x^2}\Big)\Big( \omega^2 + 1+2x + 2\sqrt{x+x^2} \Big)} \\[10pt]
= {} & \int \left( \frac A {\omega^2 + 1+2x - 2\sqrt{x+x^2}} + \frac B{\omega^2 + 1+2x + 2\sqrt{x+x^2}} \right) \,d\omega.
\end{align}
We do not need $A\omega+B$ and $C\omega+D$ in the numerators because in every place where $\omega$ appears it's $\omega^2$.
If $x\ge 0$ then $1+2x\pm\sqrt{x+x^2}$ is positive regardless of whether it's plus or minus. Therefore we should get some arctangents.
