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.
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)$$
HINT: Try substitution $\cos x= t$