Proof. We want to determine the integral of \cos^2(x), that is:
\begin{align*} \int \cos^2(x) dx. \end{align*}
\begin{align*} \int \cos^2(x) dx &= \int \frac{1}{2}(1 + \cos(2x)) dx \\ &= \frac{1}{2} \int (1 + \cos(2x)) dx, \quad \text{ }\cos^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 \text{ } \sin(2x) = 2\sin(x)\cos(x) \\ &= \frac{1}{2}(x + \sin(x)\cos(x)) + C. \end{align*}