How to evaluate $\int \cos^2x \ dx$

Solution 1:

Consider $$I=\int \cos^2(x)\,dx \qquad J=\int \sin^2(x)\,dx $$ So $$I+J =\int dx=x\tag 1$$ $$I-J =\int \left(\cos^2(x)-\sin^2(x) \right) dx=\int \cos(2x) \,dx=\frac 12 \sin(2x)\tag 2$$ Add both to get $$2I=x+\frac 12 \sin(2x)$$ $$I=\frac x2+\frac 14 \sin(2x)$$

Solution 2:

You can make use of the double angle formula for cosine:

$$\begin{eqnarray}\cos(2x) & = & 2 \cos^2 (x) - 1 \\ \cos^2 (x) & = & \frac{1}{2}\left(\cos (2x) + 1\right)\\ \int \cos^2 x\ dx & = & \frac{1}{2} \int \left(\cos(2x) + 1 \right) dx \\ & = & \frac{1}{2}\left[\frac{1}{2}\sin(2x) + x + C \right] \\ & = & \frac{1}{4}\sin(2x) + \frac{1}{2}x + C \end{eqnarray}$$

Solution 3:

Hint : Use the identity $\cos 2x=2\cos^2 x-1$

i.e. $$\cos^2 x=\frac{\cos 2x +1}{2}$$