Evaluate $\int_0^\pi\frac{\ln\left(1+\cos\theta\right)}{\cos\theta}\,d\theta$ The problem is to evaluate:
$$\int_{0}^{\pi}{\left(\frac{\ln{\left(1+\cos{\theta}\right)}}{\cos{\theta}}\,d\theta\right)}$$
An estimate for the integral is $4.9348022$.
There is a similarity between this integral and the dilogarithm function, which is defined by:
$$\operatorname{Li}_2(z):=-\int_{0}^{z}{\left(\frac{\ln{\left(1-t\right)}}{t}\,dt\right)}$$
but I am not sure how to use this effectively.
In addition, there are two singularities in the interval of integration: one singularity when $\theta\to\pi$ and the integrand increases without bound, and one removable 'hole' at $\theta=\pi/2$, where the limit of the value of the integrand is $1$.
Integration by parts does not seem to simplify the integral. I also tried some substitutions, such as $x=\cos{\theta}$:
$$\int_{-1}^{1}{\left(\frac{\ln{\left(1+x\right)}}{x\sqrt{1-x^2}}\,dx\right)}$$
which brings it closer to the dilogarithm form. The Weierstrass substitution $x=\tan{\left(\theta/2\right)}$ gives:
$$\int_{0}^{\infty}{\left(\frac{2}{1-x^2}\cdot\ln{\left(\frac{2}{1+x^2}\right)}\,dx\right)}$$
Any ideas? Thanks!
 A: Hint: Making use of symmetry and the tangent half-angle substitution, we find
$$\begin{align}
\mathcal{I}
&=\int_{0}^{\pi}\mathrm{d}\theta\,\frac{\ln{\left(1+\cos{\left(\theta\right)}\right)}}{\cos{\left(\theta\right)}}\\
&=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\theta\,\frac{\ln{\left(1+\cos{\left(\theta\right)}\right)}}{\cos{\left(\theta\right)}}+\int_{\frac{\pi}{2}}^{\pi}\mathrm{d}\theta\,\frac{\ln{\left(1+\cos{\left(\theta\right)}\right)}}{\cos{\left(\theta\right)}}\\
&=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\theta\,\frac{\ln{\left(1+\cos{\left(\theta\right)}\right)}}{\cos{\left(\theta\right)}}-\int_{0}^{\frac{\pi}{2}}\mathrm{d}\theta\,\frac{\ln{\left(1-\cos{\left(\theta\right)}\right)}}{\cos{\left(\theta\right)}};~~~\small{\left[\theta\mapsto\pi-\theta\right]}\\
&=\int_{0}^{\frac{\pi}{2}}\mathrm{d}\theta\,\frac{\ln{\left(\frac{1+\cos{\left(\theta\right)}}{1-\cos{\left(\theta\right)}}\right)}}{\cos{\left(\theta\right)}}\\
&=\int_{0}^{1}\mathrm{d}t\,\frac{2}{1+t^{2}}\cdot\frac{1+t^{2}}{1-t^{2}}\ln{\left(\frac{1}{t^{2}}\right)};~~~\small{\left[\tan{\left(\frac{\theta}{2}\right)}=t\right]}\\
&=-4\int_{0}^{1}\mathrm{d}t\,\frac{\ln{\left(t\right)}}{1-t^{2}}.\\
\end{align}$$
A: Just to finish David H's answer, since $\int_{0}^{1}t^{m}(-\log t)\,dt = \frac{1}{(m+1)^2}$ for any $m\in\mathbb{N}$, by expanding $\frac{1}{1-t^2}$ as $1+t^2+t^4+t^6+\ldots$ we get:
$$\int_{0}^{\pi}\log(1+\cos\theta)\frac{d\theta}{\cos\theta}=4\int_{0}^{1}\frac{-\log(t)}{1+t^2}=4\sum_{m=0}^{+\infty}\frac{1}{(2m+1)^2} = \color{blue}{\frac{\pi^2}{2}} \approx 4.9348022.$$

Addendum: it might be interesting to point out that the identity
$$ \sum_{n\geq 1}\frac{1}{n^2}=\sum_{n\geq 1}\frac{3}{n^2\binom{2n}{n}}$$
can be proved by applying the tangent half-angle substitution to a similar integral.
As a reference, please have a look at page 27 here.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[15px,#ffe]{\ds{\int_{0}^{\pi}
{\ln\pars{1 + \cos\pars{\theta}} \over \cos\pars{\theta}}\,\dd\theta}} =
\int_{0}^{\pi}{\ln\pars{2\cos^{2}\pars{\theta/2}} \over
2\cos^{2}\pars{\theta/2} - 1}\,\dd\theta
\\[5mm] &\ \stackrel{\theta/2\ \mapsto\ \theta}{=}\,\,\,
2\int_{0}^{\pi/2}{\ln\pars{2} + 2\ln\pars{\cos\pars{\theta}} \over 2\cos^{2}\pars{\theta} - 1}\,\dd\theta =
\int_{0}^{\pi/2}{\ln\pars{2} - \ln\pars{\tan^{2}\pars{\theta} + 1} \over
1 - \tan^{2}\pars{\theta}}\,
\sec^{2}\pars{\theta}\,\dd\theta
\\[5mm] & \stackrel{x\ =\ \tan\pars{\theta}}{=}\,\,\,
\int_{0}^{\infty}{\ln\pars{2} - \ln\pars{x^{2} + 1} \over 1 - x^{2}}\,\dd x
\\[5mm] & =
\int_{0}^{1}{\ln\pars{2} - \ln\pars{x^{2} + 1} \over 1 - x^{2}}\,\dd x +
\int_{1}^{\infty}{\ln\pars{2} - \ln\pars{x^{2} + 1} \over 1 - x^{2}}\,\dd x
\\[5mm] & =
\int_{0}^{1}{\ln\pars{2} - \ln\pars{x^{2} + 1} \over 1 - x^{2}}\,\dd x +
\int_{1}^{0}{\ln\pars{2} - \ln\pars{1/x^{2} + 1} \over 1 - 1/x^{2}}
\pars{-\,{\dd x \over x^{2}}}
\\[5mm] & =
\int_{0}^{1}{\ln\pars{2} - \ln\pars{x^{2} + 1} \over 1 - x^{2}}\,\dd x -
\int_{0}^{1}{\ln\pars{2} - \ln\pars{1 + x^{2}} + 2\ln\pars{x} \over
1 - x^{2}}\dd x =
-2\int_{0}^{1}{\ln\pars{x} \over 1 - x^{2}}\dd x
\\[5mm] & \stackrel{x^{2}\ \mapsto\ x}{=}\,\,\,
-2\sum_{n = 0}^{\infty}\overbrace{\int_{0}^{1}\ln\pars{x}x^{2n}\dd x}^{\ds{-\,{1 \over \pars{2n + 1}^{2}}}}\ =\
2\pars{\sum_{n = 1}^{\infty}{1 \over n^{2}} -
\sum_{n = 1}^{\infty}{1 \over \pars{2n}^{2}}} =
{3 \over 2}\ \overbrace{\sum_{n = 1}^{\infty}{1 \over n^{2}}}^{\ds{\pi^{2} \over 6}} = \bbx{\pi^{2} \over 4}
\end{align}
A: I know this is an old question with an accepted answer, but I was surprised to see no one coming up with the following solution by differentiation under the integral sign, (which is the most straightforward method for this integral IMHO) and so I thought it would be helpful to add this here:
$$I(a):=\int_0^\pi\frac{\ln(1+a\cos{\theta})}{\cos{\theta}}\,d\theta, a\in[0,1]$$
$$\frac{dI}{da}=\frac d{da}\int_0^\pi\frac{\ln(1+a\cos{\theta})}{\cos{\theta}}\,d\theta$$
$$=\int_0^\pi\frac1{\cos\theta}\frac\partial{\partial a}{\ln(1+a\cos{\theta})}d\theta$$
$$=\int_0^\pi\frac1{\cos\theta}{\frac{\cos\theta}{1+a\cos{\theta}}}d\theta$$
$$=\int_0^\pi\frac1{1+a\cos{\theta}}d\theta$$
$$=\frac\pi{\sqrt{1-a^2}}$$
$$\because I(0)=\int_0^\pi\frac{\ln(1)}{\cos\theta}\,d\theta=0,$$
$$\therefore I(a)=I(0)+\int_0^a\frac{dI}{da}da=\int_0^a\frac\pi{\sqrt{1-a^2}}dx=\pi\arcsin a$$
$$\boxed{\int_0^\pi\frac{\ln(1+\cos\theta)}{\cos\theta}\,d\theta=I(1)=\pi\arcsin 1=\frac{\pi^2}2}$$
So by differentiating under the integral sign, one is left only with the integral $\int_0^\pi\frac{d\theta}{1+a\cos{\theta}}$, which is much simpler to evaluate. Below is one solution by complex analysis. For anyone uncomfortable with complex analysis, the substitution $t=\tan\frac\theta2$ (and other symmetry/trigonometry tricks) will work as well.
$$J=\int_0^\pi\frac{d\theta}{1+a\cos\theta}$$
Substituting $\theta\rightarrow2\pi-\theta, d\theta\rightarrow-d\theta$,
$$J=-\int_{2\pi}^\pi\frac1{1+a\cos(2\pi-\theta)}d\theta=\int_\pi^{2\pi}\frac1{1+a\cos\theta}d\theta$$
$$\therefore 2J=\int_0^{2\pi}\frac1{1+a\cos\theta}d\theta\implies J=\frac1 2\int_0^{2\pi}\frac1{1+a\cos\theta}d\theta$$
$$J=\frac1 2\int_0^{2\pi}\frac1{1+a(\frac{e^{i\theta}+e^{-i\theta}}2)}d\theta=\int_0^{2\pi}\frac1{2+ae^{i\theta}+ae^{-i\theta}}d\theta$$
Substitute $z=e^{i\theta},dz=ie^{i\theta}d\theta\implies d\theta=\frac{dz}{iz}$
$$J=\oint_C \frac1{2+az+a/z}\frac{dz}{iz}=\frac1{ia}\oint_C\frac{dz}{z^2+(2/a)z+1}$$
where $C$ is the counterclockwise contour over the unit circle. By the residue theorem,
$$J=\frac1{ia}2\pi i\sum Res\frac1{z^2+(2/a)z+1}$$
$\frac{-1+\sqrt{1-a^2}}a$ is the only root of $z^2+(2/a)z+1$ within the unit circle, and its residue is $\frac a{2\sqrt{1-a^2}}$
$$\boxed{\therefore J=\int_0^\pi\frac{d\theta}{1+a\cos\theta}=\frac1{ia}\cdot2\pi i\cdot \frac a{2\sqrt{1-a^2}}=\frac\pi{\sqrt{1-a^2}}}$$
A: Noting that the transformation $\theta \mapsto \pi-\theta$ converts
\begin{equation}
I=\int_{0}^{\pi} \frac{\ln (1-\cos \theta)}{-\cos \theta} d \theta
\end{equation}
Adding them yields $$
\begin{aligned}
2 I&=\int_{0}^{\pi} \frac{1}{\cos \theta} \ln \left(\frac{1+\cos \theta}{1-\cos \theta}\right) d \theta \\
&=\int_{0}^{\pi} \frac{1}{\cos \theta} \ln \left(\frac{2 \cos ^{2} \frac{1}{2}}{2 \sin ^{2} \frac{\theta}{2}}\right) d \theta \\
&=2 \int_{0}^{\pi} \frac{1}{\cos \theta} \ln \left(\cot \frac{\theta}{2}\right) d \theta
\end{aligned}
$$
Letting $ x=\tan \frac{\theta}{2} $ gives
$$
\begin{aligned}
I &=\int_{0}^{\infty} \frac{1+t^{2}}{1-t^{2}} \ln \left(\frac{1}{t}\right) \frac{2 d t}{1+t^{2}} \\
&=-2 \int_{0}^{\infty} \frac{\ln t}{1-t^{2}} d t \\
&=-2\left(-\frac{\pi^{2}}{4}\right) \\
&=\frac{\pi^{2}}{2}
\end{aligned}
$$
