# How do I evaluate the indefinite integral int(1+cos(x))^2dx ?

Sep 8, 2014

$\int {\left(1 + \cos x\right)}^{2} \mathrm{dx} = \frac{3}{2} x + 2 \sin x + \frac{1}{4} \sin 2 x + C$

Let us look at some details.
By multiplying out the integrand,
$\int {\left(1 + \cos x\right)}^{2} \mathrm{dx} = \int \left(1 + 2 \cos x + {\cos}^{2} x\right) \mathrm{dx}$
by ${\cos}^{2} x = \frac{1 + \cos 2 x}{2}$,
$= \int \left(1 + 2 \cos x + \frac{1 + \cos 2 x}{2}\right) \mathrm{dx}$
by cleaning us the integrand,
$= \int \left(\frac{3}{2} + 2 \cos x + \frac{1}{2} \cos 2 x\right) \mathrm{dx}$
by finding antiderivatives,
$= \frac{3}{2} x + 2 \sin x + \frac{1}{4} \sin 2 x + C$