<s>[INST] Integral $\int \frac{dx}{\sin^2 (x) + \sin(2x)}$ We have to do the following integration 
$$\int \frac{dx}{\sin^2 (x) + \sin(2x)}$$
I tried as
In the numerator, $1 =  \sin^2(x)+\sin(2x)+\cos^2(x)-\sin(2x)$
But now how to proceed?
 [/INST] \begin{align}
\int\frac{dx}{\sin^2(x)+\sin(2x)}&=\int\frac{\sec^2(x)}{\sin^2(x)\sec^2(x)+2\sin(x)\cos(x)\sec^2(x)}dx\\
&=\int\frac{\sec^2(x)}{\tan^2(x)+2\tan(x)}dx
\end{align}
Letting $u:=\tan(x)$, then $du=\sec^2(x)dx$ gives
\begin{align}
\int\frac{dx}{\sin^2(x)+\sin(2x)}&=\int\frac{du}{u^2+2u}\\
&=\int\frac{du}{(u+1)^2-1}
\end{align}
Letting $z:=u+1$, then $dz = du$ gives
\begin{align}
\int\frac{dx}{\sin^2(x)+\sin(2x)}&=\int\frac{dz}{z^2-1}\\
&=-\text{artanh }(z)+C\\
&=-\text{artanh }(u+1)+C\\
\end{align}
Reversing the final substitution gives

$$\int\frac{dx}{\sin^2(x)+\sin(2x)} = -\text{artanh }(\tan(x)+1)+C$$

</s>