How to find $\int_{0}^{\pi/2} \log ({1+\cos x}) dx$ using real-variable methods? How do you find the value of this integral, using real methods?
$$I=\displaystyle\int_{0}^{\pi/2} \log ({1+\cos x}) dx$$
The answer is $2C-\dfrac{\pi}{2}\log {2}$ where $C$ is Catalan's constant.
 A: If you don't mind, this is another solution that is more simplistic. Integrating by parts gives
\begin{align}
I
&=\int^{\pi/2}_0\ln(1+\cos{x})dx\\
&=\int^{\pi/2}_0\frac{x\sin{x}}{1+\cos{x}}dx\\
&=\int^{\pi/2}_0\frac{x\tan{x}}{\sec{x}+1}\frac{\sec{x}-1}{\sec{x}-1}dx\\
&=\underbrace{\int^{\pi/2}_0\frac{x}{\sin{x}}dx}_{2G}-\int^{\pi/2}_0\frac{x}{\tan{x}}dx\\
&=2G-\int^{\pi/2}_0x\cot{x}dx\\
&=2G+\int^{\pi/2}_0\ln\sin{x}dx\\
&=2G-\frac{\pi}{2}\ln{2}
\end{align}
A: Using Weierstrass substitution
$$
t=\tan\frac x2\qquad;\qquad\cos x=\frac{1-t^2}{1+t^2}\qquad;\qquad dx=\frac{2}{1+t^2}\ dt
$$
we obtain
\begin{align}
\int_0^{\Large\frac\pi4}\ln(1+\cos x)\ dx&=2\underbrace{\int_0^1\frac{\ln2}{1+t^2}\ dt}_{\color{blue}{\text{set}\ t=\tan\theta}}-2\color{red}{\int_0^1\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt}\\
&=\frac{\pi}{2}\ln2-2\color{red}{\int_0^1\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt}.\tag1
\end{align}
Consider
\begin{align}
\int_0^\infty\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt&=\int_0^1\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt+\underbrace{\int_1^\infty\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt}_{\large\color{blue}{t\ \mapsto\ \frac1t}}\\
&=2\int_0^1\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt-2\int_0^1\frac{\ln t}{1+t^2}\ dt\\
\color{red}{\int_0^1\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt}&=\frac12\underbrace{\int_0^\infty\frac{\ln\left(1+t^2\right)}{1+t^2}\ dt}_{\color{blue}{\text{set}\ t=\tan\theta}}+\int_0^1\frac{\ln t}{1+t^2}\ dt\\
&=-\underbrace{\int_0^{\Large\frac\pi2}\ln\cos\theta\ d\theta}_{\color{blue}{\Large\text{*}}}+\sum_{k=0}^\infty(-1)^k\underbrace{\int_0^1 t^{2k}\ln t\ dt}_{\color{blue}{\Large\text{**}}}\\
&=\frac\pi2\ln2-\text{G},\tag2
\end{align}
where $\text{G}$ is Catalan's constant.
$(*)$ can be proven by using the symmetry of $\ln\cos\theta$ and $\ln\sin\theta$ in the interval $\left[0,\frac\pi2\right]$ and $(**)$ can be proven by using formula
$$
\int_0^1 x^\alpha \ln^n x\ dx=\frac{(-1)^n n!}{(\alpha+1)^{n+1}}, \qquad\text{for }\  n=0,1,2,\ldots
$$
Thus, plugging in $(2)$ to $(1)$ yields
\begin{align}
\int_0^{\Large\frac\pi4}\ln(1+\cos x)\ dx
=\large\color{blue}{2\text{G}-\frac{\pi}{2}\ln2}.\tag{Q.E.D.}
\end{align}
A: If I may give my two cents for what it's worth. 
Another way would be to consider the handy Fourier series for $\log(\cos(x/2))$
Starting with the identity mentioned up top, that $1+\cos(x)=2\cos^{2}(x/2)$
write  $\displaystyle \log(2\cos^{2}(x/2))=\log(2)+2\log(\cos(x/2))$
Using the series $\displaystyle \log(\cos(x/2))=\sum_{k=1}^{\infty}\frac{(-1)^{k+1}\cos(kx)}{k}-\log(2)$
$=\displaystyle 2\sum_{k=1}^{\infty}\int_{0}^{\frac{\pi}{2}}\frac{(-1)^{k+1}\cos(kx)}{k}-\frac{\pi}{2}\log(2)\int_{0}^{\frac{\pi}{2}}dx$
$=\displaystyle 2\sum_{k=1}^{\infty}\frac{(-1)^{k+1}\sin(\pi k/2)}{k^{2}}-\frac{\pi}{2}\log(2)\tag{1}$
Notice the Clausen series now obtained. It has period:
$\displaystyle \begin{array}{rcl}k=1&k=2&k=3& k=4& k=5& k=6&k=7&k=8 \\ 1&0&-1&0&1&0&-1&0\end{array}$
See how it repeats with period 4 from 1 to -1?. 
What we now have is the series $2\displaystyle \sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{(2k-1)^{2}}=2G$
Put this together with $\frac{-\pi}{2}\log$ in (1) and get:
$$2G-\frac{\pi}{2}\log(2)$$
A: By using $\cos(x)=\frac{1-\tan^2(x/2)}{1+\tan^2(x/2)}$ we have:
$$\begin{eqnarray*} I = 2\int_{0}^{1}\frac{\log 2-\log(1+t^2)}{1+t^2}dt&=&2\int_{0}^{1}\frac{\log 2-\log t-\log(1/t+t)}{1+t^2}dt\\&=&2I_1-2I_2-2I_3,\end{eqnarray*}$$
where:
$$I_1=\int_{0}^{1}\frac{\log 2}{1+t^2}\,dt = \frac{\pi}{4}\log 2,$$
$$I_2=\int_{0}^{1}\frac{\log t}{1+t^2}\,dt = \sum_{k=0}^{+\infty}(-1)^k\int_{0}^{1}t^{2k}\log t\,dt = -C,$$
$$I_3=\int_{0}^{1}\frac{\log(t+1/t)}{t^2+1}\,dt=\int_{1}^{+\infty}\frac{\log u}{u\sqrt{u^2-1}}\,du=\int_{0}^{1}\frac{-\log\nu}{\sqrt{1-\nu^2}}\,d\nu,$$
$$ I_3=-\int_{0}^{\pi/2}\log\cos t\,dt=\frac{\pi}{2}\log 2,$$
hence:

$$ I = 2C-\frac{\pi}{2}\log 2.$$

A: $$
\begin{aligned}
\int_{0}^{\frac{\pi}{2}} \ln (1+\cos x) d x &=\int_{0}^{\frac{\pi}{2}} \ln \left(2 \cos ^{2} \frac{x}{2}\right) d x \\
&=\int_{0}^{\frac{\pi}{2}} \ln 2 d x+2 \int_{0}^{\frac{\pi}{2}} \ln \left(\cos \frac{x}{2}\right) d x \\
&=\frac{\pi}{2} \ln 2+4 \int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x \\
&=\frac{\pi}{2} \ln 2+4\left(-\frac{\pi}{2} \ln 2+\frac{G}{2}\right)
\end{aligned}
$$ where the last integral comes from my post:
$\int_{0}^{\frac{\pi}{4}} \ln (\cos x) d x=-\frac{\pi}{4} \ln 2+\frac{G}{2}$.
Hence we can conclude that
$$
\boxed{\int_{0}^{\frac{\pi}{2}} \ln (1+\cos x) d x= \frac{G}{2}-\frac{\pi}{2} \ln 2,}
$$
where G is the Catalan’s constant.
A: \begin{align}J&=\int_0^{\frac{\pi}{2}}\ln(1+\cos x)dx\\
K&=\int_0^{\frac{\pi}{2}}\ln(1-\cos x)dx\\
J+K&=2\int_0^{\frac{\pi}{2}}\ln(\sin x)dx\\
&=\int_0^{\frac{\pi}{2}}\ln(\sin x)dx+\underbrace{\int_0^{\frac{\pi}{2}}\ln(\sin x)dx}_{u=\frac{\pi}{2}-x}\\
&=\int_0^{\frac{\pi}{2}}\ln(\sin u\cos u)du\\
&=\int_0^{\frac{\pi}{2}}\ln\left(\frac{\sin(2u)}{2}\right)du\\
&\overset{z=2u}=\frac{1}{2}\int_0^\pi \ln\left(\frac{\sin z}{2}\right)dz \\
&=\frac{1}{2}\int_0^\pi \ln\left(\sin z\right)dz-\frac{1}{2}\pi\ln 2 \\
&=\frac{1}{2}\int_0^{\frac{\pi}{2}} \ln\left(\sin z\right)dz+\frac{1}{2}\underbrace{\int_{\frac{\pi}{2}}^\pi \ln\left(\sin z\right)dz}_{t=\pi-z}-\frac{1}{2}\pi\ln 2\\
&=\frac{1}{2}(J+K)-\frac{1}{2}\pi\ln 2\\
J+K&=\boxed{-\pi\ln 2}\\
K-J&=\int_0^{\frac{\pi}{2}}\ln\left(\frac{1-\cos x}{1+\cos x}\right)dx\\
&\overset{u=\sqrt{\frac{1-\cos x}{1+\cos x}}}=4\int_0^1 \frac{\ln u}{1+u^2}du=-4\text{G}\\
J&=\frac{1}{2}\Big((J+K)-(K-J)\Big)=\frac{1}{2}(-\pi\ln 2+4\text{G})=\boxed{2\text{G}-\frac{1}{2}\pi\ln 2}
\end{align}
