<s>[INST] Integral $\int \frac {dx}{\sin^2 x + \tan^2x}$ 
I am trying to find the following integral: 
  $$\int \frac {dx}{\sin^2 x + \tan^2x}$$

I have tried the common thing to do when encountering rational functions that contains rational functions and converting everything in  terms of $\tan \frac{x}{2}$ then substituting it.
$$\tan\frac{x}{2}=t\Rightarrow \sin x=\frac{2t}{1+t^2},\ \cos x=\frac{1-t^2}{1+t^2},\  dx=\frac{2}{1+t^2}dt$$
$$\Rightarrow \int \frac{dx}{\sin^2 x + \frac{\sin^2 x}{\cos^2 x}}=\int \frac{\frac{2}{1+t^2}}{\left(\frac{2t}{1+t^2}\right)^2+\left(\frac{2t}{1-t^2}\right)^2}dt$$
However I am stuck. Is there perhaps an easier way to approach it?
 [/INST] $$\dfrac1{\sin^2x+\tan^2x}=\dfrac{\cos^2x}{\sin^2x(1+\cos^2x)}$$
Method$\#1:$
$$=\dfrac{\cos^2x+1-1}{\sin^2x(1+\cos^2x)}=\csc^2x-\dfrac1{(1-\cos^2x)(1+\cos^2x)}$$
Now $$\dfrac2{(1-\cos^2x)(1+\cos^2x)}=\dfrac1{1-\cos^2x}+\dfrac1{1+\cos^2x}$$
Finally $$\dfrac1{1+\cos^2x}=\dfrac{\sec^2x}{2+\tan^2x}$$
Method$\#2:$
$$\dfrac{\cos^2x}{\sin^2x(1+\cos^2x)}=\dfrac c{(1-c)(1+c)}=\dfrac A{1-c}+\dfrac B{1+c}$$ using Partial Fraction Decomposition where $c=\cos^2x$
</s>