<s>[INST] 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.
 [/INST] \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}
</s>