Definite integration problem (trig). I have this definite integral:
$$
\int_0^\Pi \cos{x} \sqrt{\cos{x}+1} \, dx
$$
For finding the indefinite integral, I have tried substitution, integration by parts, but I'm having trouble solving it.
By parts
$$
\int \cos{x} \sqrt{\cos{x}+1} \, dx\ = \sqrt{\cos{x}+1}\sin{x} + \frac{1}{2} \int \frac{\sin^{2}{x}}{\sqrt{\cos{x}+1}} \, dx
$$
$
f(x) = \sqrt{\cos{x}+1} \\ f'(x) = \frac{1}{2} \frac{-\sin{x}}{\sqrt{\cos{x}+1}} \\ g(x) = \sin{x} \\ g'(x) = \cos{x}
$
I don't know how to approach this further because of the $\sin^{2}{x}$.
Substitution
$
\cos{x} + 1 = u \\ -\sin{x} \, dx = du
$
But I  have no use for $sin\,x$.
I believe it has something to do with trig manipulations.
WolframAlpha tells me to substitute, but I don't understand how to get the first u-substituted integral like shown:

I would really appreciate any help on this. Thank you.
 A: Note  $\displaystyle \sqrt{\cos x+1}=\sqrt{2\cos^2\frac x2-1+1}=\sqrt2\left|\cos \frac x2\right|$
We have
$$\displaystyle
\int_0^\pi \cos x \sqrt{\cos x+1} \, dx=\sqrt2\int_0^\pi \left(1-2\sin^2{\frac x2}\right) \cos\frac x2  \, dx$$
$$=2 \sqrt2\int_0^\pi \left(1-2\sin^2{\frac x2}\right)   \, d\left(\sin\frac x2\right)$$
A: Here is how I would do it:  first, let's recall the cosine double-angle identity.  $$\cos 2x = \cos^2 x - \sin^2 x = \cos^2 x - (1 - \cos^2 x) = 2\cos^2 x - 1.$$ Thus the corresponding half-angle identity can be written $$\cos x = \sqrt{\frac{1 + \cos 2x}{2}}$$ or equivalently, $$\sqrt{1 + \cos x} = \sqrt{2} \cos \frac{x}{2}, \quad 0 \le x \le \pi.$$  So the integral becomes $$I = \int_{x=0}^\pi \sqrt{2} \cos x \cos \frac{x}{2} \, dx.$$  Now recall the angle addition identity $$\cos(a \pm b) = \cos a \cos b \mp \sin a \sin b,$$ from which we obtain $$\cos (a+b) + \cos (a-b) = 2 \cos a \cos b.$$  Then with $a = x$, $b = x/2$, we easily see the integral is now $$I = \frac{1}{\sqrt{2}} \int_{x=0}^\pi \cos \frac{3x}{2} + \cos \frac{x}{2} \, dx.$$  Now it is a simple matter to integrate each term:  $$\begin{align*} I &= \frac{1}{\sqrt{2}} \left[ \frac{2}{3} \sin \frac{3x}{2} + 2 \sin \frac{x}{2} \right]_{x=0}^\pi \\ &= \frac{1}{\sqrt{2}} \left( -\frac{2}{3} + 2 \right) = \frac{2\sqrt{2}}{3}. \end{align*} $$
A: HINT: Note that the sine function is nonnegative on the interval of integration $[0,\pi]$; that is, for all $0\leq x \leq \pi$, $\sin{x}=|\sin{x}|$. If you are substituting $u=\cos{x}+1$, 
$$u=\cos{x}+1\\
\Leftrightarrow u-1=\cos{x}\\
\Leftrightarrow \left(u-1\right)^2=\cos^2{x}\\
\Leftrightarrow -\cos^2{x}=-\left(u-1\right)^2\\
\Leftrightarrow 1-\cos^2{x}=1-\left(u-1\right)^2\\
\Leftrightarrow \sin^2{x}=u\left(2-u\right)\\
\Leftrightarrow |\sin{x}|=\sqrt{u}\sqrt{2-u}.$$
A: You can also use Weierstrass substitution (tangent half-angle substitution).
A: HINT: Try substitution $\cos x= t$ 
