Integrating trig function I'm stuck at this problem:
$$ \int{\sqrt{(\sin^2 x)^2 + (2\sin x \cos x)^2}dx} = \int{\sqrt{\sin^2 x \sin^2 x + 4\sin^2 x \cos^2 x} dx}$$
I tried a few trig identities: $\sin^2 x = \frac{1-\cos 2x}{2}  $ and $ \cos^2 x = \frac{1+\cos 2x}{2} $ and $\sin^2 x + \cos^2 x = 1$. Keep hitting dead end. Any tips?
 A: $$\begin{align} &\int{\sqrt{\sin^2x \sin^2x + 4\sin^2 x \cos^2 x} dx} \\ &
=\int{\sqrt{\sin^2x( \sin^2x + 4\cos^2 x)} dx} \\ &
=\begin{cases}\int{\sin x\sqrt{( \sin^2x + 4\cos^2 x)} dx} & & & &, \sin x \geq 0 \\ -\int{\sin x\sqrt{( \sin^2x + 4\cos^2 x)} dx} & & & &, \sin x < 0\end{cases} \\ &
=\begin{cases}\int{\sin x\sqrt{(1 + 3\cos^2 x)} dx} & & & & & &, \sin x \geq 0 \\ -\int{\sin x\sqrt{(1 + 3\cos^2 x)} dx} & & & & & &, \sin x < 0\end{cases} \\ &
=\begin{cases}-\frac{1}{\sqrt3}\int{\sin x\sqrt{(1 + 3\cos^2 x)} d(\sqrt3\cos x)} & , \sin x \geq 0 \\ \frac{1}{\sqrt3}\int{\sin x\sqrt{(1 + 3\cos^2 x)} d(\sqrt3\cos x)} & , \sin x < 0\end{cases}\end{align}$$
Now say $z=\sqrt3\cos x$. Then the integration becomes
$$=\begin{cases}-\frac{1}{\sqrt3}\int{\sin x\sqrt{1 + z^2} dz} & , \sin x \geq 0 \\ \frac{1}{\sqrt3}\int{\sin x\sqrt{1 + z^2} dz} & , \sin x < 0\end{cases}$$
I hope you can finish it now, using the necessary formula. The formula can be deduced using integration by parts and proper substitutions and is denoted in the linked page as no. 8. 

A: Try a substitution with the last expression that you have

$$\int\sqrt{\sin^4(x)+4\sin^2(x)\cos^2(x)}dx\quad u=\cos(x)$$.

This leads us to the following integral where we do another substitution:

$$\int\sqrt{3u^2+1}du \quad\!\! \text{substitute}\quad\!\! u=\sqrt{\dfrac{a}{b}}\tan (v) \quad\!\!\text{where}\quad\!\! a=1 \quad\!\!\text{and} \quad\!\!b=3$$

Then, the integral becomes the following:

$$\int\dfrac{\sqrt{\tan^2(v)+1}+\sec^2(v)}{\sqrt{3}}$$

and the rest is more or less is using trig identities.
