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.

I'd go direct, taking into account that $\,\displaystyle{\int x^2\,dx=\frac{1}{3}x^3 + C}\,$:$$\int 2\sin^2x\cos x\,dx=2\int\sin^2x(d\sin x)=\frac{2}{3}\sin^3x+C$$
This looks simpler to me and less messy than with trigonometric identities.
