Integral of $\int 2\,\sin^{2}{x}\cos{x}\,dx$ I am asked as a part of a question to integrate $$\int 2\,\sin^{2}{x}\cos{x}\,dx$$
I managed to integrate it using integration by inspection:
$$\begin{align}\text{let } y&=\sin^3 x\\
              \frac{dy}{dx}&=3\,\sin^2{x}\cos{x}\\
              \text{so }\int 2\,\sin^{2}{x}\cos{x}\,dx&=\frac{2}{3}\sin^3x+c\end{align}$$
However, looking at my notebook the teacher did this:
$$\int -\left(\frac{\cos{3x}-\cos{x}}{2}\right)$$
And arrived to this result:
$$-\frac{1}{6}\sin{3x}+\frac{1}{2}\sin{x}+c$$
I'm pretty sure my answer is correct as well, but I'm curious to find out what how did do rewrite the question in a form we can integrate.

Another natural approach is the substitution $u=\sin x$. 
The path your instructor chose is less simple. We can rewrite $\sin^2 x$ as $1-\cos^2x$, so we are integrating $2\cos x-2\cos^3 x$. Now use the identity $\cos 3x=4\cos^3 x-3\cos x$ to conclude that $2\cos^3 x=\frac{1}{2}\left(\cos 3x+3\cos x\right)$.
Remark: The identity $\cos 3x=4\cos^3 x-3\cos x$ comes up occasionally, for example in a formula for solving certain classes of cubic equations. The same identity comes up when we are proving that the $60^\circ$ angle cannot be trisected by straightedge and compass.
