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.

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*} $$
