Answer
$\frac{sin 2x}{4}+\frac{x}{2}+C$
Work Step by Step
$\int cos^{2}xdx= \int cos x cos xdx$
Applying integration by parts, we get
$\int cos x cos xdx$
$=cos x sin x-\int(-sin x\times sin x)dx$
$=cos xsin x+ \int sin^{2}xdx$
$=cos xsinx+\int(1-cos^{2}x)dx$
$= cosxsinx+\int 1dx- \int cos^{2}xdx$
Adding $\int cos^{2}xdx$ to both sides of the equation, we have
$2\int cos^{2}xdx= cosxsinx+x+C$
$⇒\int cos^{2}xdx= \frac{1}{2}(cosxsinx+x)+C$
As $cosx sinx = \frac{sin2x}{2}$,
$\int cos^{2}xdx= \frac{sin 2x}{4}+\frac{x}{2}+C$