1. ## definite integral, evaluation

2. If you know the result of this famous integral :

$\int_0^{\frac{\pi}{2} } \ln[\sin(x)]~dx = -\frac{\pi}{2}\ln{2}$

what to do with your problem is changing $1 + \cos(x)$ to $2 \cos^2(\frac{x}{2})$ , and remind that

$\int_0^{\pi } \ln[\cos(\frac{x}{2})] ~dx = 2 \int_0^{\frac{\pi}{2} } \ln[\cos(x)]~dx = 2 \int_0^{\frac{\pi}{2} } \ln[\sin(x)]~dx = -\pi \ln{2}$

Or another way :

Consider

$\int_0^{\pi} = \int_0^{\frac{\pi}{2}} + \int_{\frac{\pi}{2}}^{\pi}$

$\int_0^{\pi} \ln[ 1 + \cos(x) ] ~dx = \int_0^{\frac{\pi}{2}} \ln[ 1 + \cos(x) ] ~dx + \int_{\frac{\pi}{2}}^{\pi} \ln[ 1 + \cos(x) ] ~dx$

for the second integral , sub . $t = \pi - x$ we obtain

$\int_0^{\frac{\pi}{2}} \left( \ln[ 1 + \cos(x) ] + \ln[ 1 - \cos(x) ] \right ) ~dx$

$= 2 \int_0^{\frac{\pi}{2}} \ln[\sin(x)]~dx = -\pi\ln{2}$

Edited :

I just find another solution by means of magic differentiation :

Let

$I(a) = \int_L \ln[ 1 + a \cos(x) ] ~dx$

for brevity , I replace $\int_0^{\frac{\pi}{2}}$ with $\int_L$

Take differentiation ,

$I'(a) = \int_L \frac{ \cos(x) }{1 + a \cos(x) } ~dx$

$I'(a) = \int_L [ \frac{1}{a} - \frac{1}{a} \cdot \frac{1}{1 + a \cos(x)}] ~dx$

$= \frac{\pi}{a} - \frac{\pi}{a} \cdot \frac{1}{\sqrt{1 - a^2}}$

Therefore ,

$I(a) = \pi \left ( \ln(a) - \int \frac{1}{a\sqrt{1 - a^2 }} ~da \right )$

Sub. $a = 1/t$

$I(a) = \pi \left ( \ln(a) - \ln( a + \sqrt{1 - a^2} ) + \ln(a)\right ) + K$

$= \pi \ln(a + \sqrt{1-a^2})+K$

we know $I = I(1) - I(0)$ so

$I = -\pi\ln{2}$

3. here's a completely different approach:

$\int_{0}^{\pi }{\ln (1+\cos x)\,dx}=\int_{0}^{\pi }{\int_{0}^{1}{\frac{\cos x}{1+t\cos x}\,dt}\,dx},$ reverse integration order and after some straightforward computations we get $\pi \int_{0}^{1}{\frac{\sqrt{1-t^{2}}-1}{t\sqrt{1-t^{2}}}\,dt}.$

substitution $u=\ln\big(1+\sqrt{1-t^2}\big)$ solves the integral achieving the value $-\ln2,$ thus the original integral equals $-\pi\ln2,$ as shown above.