Proof. We want to determine the integral of \sin^2(x), that is:
\begin{align*} \int \sin^2(x) dx. \end{align*}
\begin{align*} \int \sin^2(x) dx &= \int \frac{1}{2}(1 - \cos(2x)) dx \\ &= \frac{1}{2} \int (1 - \cos(2x)) dx, \quad \sin^2(x) = \frac{1}{2}(1 - \cos(2x)) \\ &= \frac{1}{2} \bigg(x - \frac{1}{2}\sin(2x)\bigg) + C \\ &= \frac{x}{2} - \frac{1}{4}\sin(2x) + C \\ &= \frac{x}{2} - \frac{1}{4}\cdot 2\sin(x)\cos(x) + C, \quad \sin(2x) = 2\sin(x)\cos(x) \\ &= \frac{1}{2}(x - \sin(x)\cos(x)) + C. \end{align*}