# 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. Aug 8, 2017 at 20:18
• Numerically, $4.9348022 \approx \pi^2 / 2$, which should give some hints. Aug 8, 2017 at 20:45
• Aug 8, 2017 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 ? Aug 9, 2017 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. Aug 9, 2017 at 1:20
• Nice work, wished there was a table of content. Aug 9, 2017 at 1:41
• @ZaidAlyafeai: I definitely have to add it, thanks for the suggestion ;) Aug 9, 2017 at 1:42
• Jack D'Aurizio: Very nice work !
– FDP
Aug 9, 2017 at 7:28

$\newcommand{\bbx}{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}{\displaystyle{#1}} \newcommand{\expo}{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}{\mathcal{#1}} \newcommand{\mrm}{\mathrm{#1}} \newcommand{\pars}{\left(\,{#1}\,\right)} \newcommand{\partiald}[]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}{\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}

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