# 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!

• Since the integral is symmetric, you can integrate from $-\pi/2$ to $\pi/2$ by multiplying the integral with $1/2$. Then you can substitute $e^{i\theta}$ and use the residue theorem. – user424862 Aug 8 '17 at 20:18
• Numerically, $4.9348022 \approx \pi^2 / 2$, which should give some hints. – nbubis Aug 8 '17 at 20:45
• – Nosrati Aug 8 '17 at 21:03

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}

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.

• What is that document ? – Zaid Alyafeai Aug 9 '17 at 0:49
• @ZaidAlyafeai: they are my course notes, Zaid. The 2017 edition will start at October, I hope to bring some good and a fair amount of sharp tools to young students. – Jack D'Aurizio Aug 9 '17 at 1:20
• Nice work, wished there was a table of content. – Zaid Alyafeai Aug 9 '17 at 1:41
• @ZaidAlyafeai: I definitely have to add it, thanks for the suggestion ;) – Jack D'Aurizio Aug 9 '17 at 1:42
• Jack D'Aurizio: Very nice work ! – FDP Aug 9 '17 at 7:28


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}}}$$