Unfortunately, there is no simple substitution that can be used to evaluate this integral (like, for example,
\(u=\cos{x}\)). Also, you can’t just integrate
\(\cos^2{x}\) as if it were 2
\(\cos{x}\) functions multiplied together,,
\begin{align*}
\int \cos^2{x} \,dx \amp\neq \int \cos{x} \,dx \cdot \int \cos{x} \,dx\\
\int \cos^2{x} \,dx \amp\neq \sin^2{x} + C
\end{align*}
Instead, we have to use a particular trigonometric identity, called the power-reducing identities. There are 2 of them, one for cosine and one for sine,
\begin{equation*}
\cos^2{x} = \frac{1+\cos{(2x)}}{2} \qquad \text{and} \qquad \sin^2{x} = \frac{1-\cos{(2x)}}{2}
\end{equation*}
As their name suggests, these identities express
\(\cos^2{x}\) and
\(\sin^2{x}\) (cosine and sine to the 2nd power) in terms of
\(\cos{(2x)}\text{,}\) which is to the 1st power.
These identities can be derived from the double-angle identities for cosine,
\begin{align*}
\cos{(2x)} \amp= 2\cos^2{x} - 1\\
\cos{(2x)} \amp= 1 - 2\sin^2{x}
\end{align*}
If you solve the first equation to isolate for
\(\cos^2{x}\text{,}\) and the second equation for
\(\sin^2{x}\text{,}\) you get the power-reducing identities.
Using these identities, we can evaluate the integral of
\(\cos^2{x}\text{,}\)
\begin{align*}
\int \cos^2{x} \,dx \amp= \int \frac{1 + \cos{(2x)}}{2} \,dx\\
\amp= \frac{1}{2} \int (1 + \cos{(2x)}) \,dx\\
\amp= \frac{1}{2} \brac{x + \frac{1}{2} \sin{(2x)}} + C
\end{align*}
Further, the double-angle identity
\(\sin{(2x)} = 2 \sin{x} \cos{x}\) can be used to rewrite the antiderivative in terms of only single angles
\(x\text{,}\)
\begin{align*}
\amp= \frac{1}{2} x + \frac{1}{2} \sin{x} \cos{x} + C\\
\amp= \frac{1}{2}(x + \sin{x} \cos{x}) + C
\end{align*}