4

In my research I came across the integral $$ \int_0^\pi \log|1 + 2\cos(x)| \, dx. $$ Maple wasn't able to evaluate it exactly, but gave a complex answer that is extremely close to $0$. So I put it in Wolfram Alpha, which gave an answer of $0$ but wouldn't give me a proof without me paying for Pro. (As an academic I'm pretty sure I could very easily get free access to this - but I thought that this question might be nice for the Math.SE community, as it's quite an intriguing result for which I could not find a proof using a Google search.)

So my question is: why is this $0$?


Equivalent formulations: $$ \int_0^{\frac{2\pi}3} \log(1 + 2\cos(x)) \, dx \ = \ -\int_{\frac{2\pi}3}^\pi \log(-1-2\cos(x)) \, dx $$ or (by multiplying the original integral by 2) $$ \int_0^{\pi} \log(1 + 4\cos(x) + 2\cos(2x)) \, dx \ = \ 0. $$ By symmetry, the integrals from $0$ to $\pi$ can equivalently be taken as $0$ to $2\pi$ (in which case also $\cos$ can equivalently be replaced by $\sin$).

  • If you take $x=2\pi/3$, then $|1+2\cos x|=0$ and $\log 0=-\infty$. – markvs Sep 17 '20 at 22:12
  • Yes, I have fixed it. I guess this why Maple failed to calculate it. – markvs Sep 17 '20 at 22:19
  • 1
    @JCAA Just because the function goes to $-\infty$ doesn't mean the integral can't be computed. – Théophile Sep 17 '20 at 22:19
  • It can, it just is not a proper integral. – markvs Sep 17 '20 at 22:20
  • 1
    Maple 2019 gives me an answer of $$-i{\it dilog} \left( 3/2+i\sqrt {3}/2 \right) -i{\it dilog} \left( 3/2 -i\sqrt {3}/2 \right) -i{\pi}^{2}/6+i{\it dilog} \left( 1/2-i\sqrt { 3}/2 \right) +i{\it dilog} \left( i\sqrt {3}/2+1/2 \right) $$ It is unable to simplify that to $0$, which is not the same as "wasn't able to evaluate it exactly". – Robert Israel Sep 17 '20 at 22:26
  • @RobertIsrael Thank you, that's interesting. It was probably around 2015 that I did the Maple computation, and back then I don't recall it giving me an analytic expression, only a numerical approximation. – Julian Newman Sep 17 '20 at 23:25
  • 2
    We have $$\frac 1 2 \int_0^{2 \pi} \ln |1 + 2 \cos x| , dx = \ \frac 1 2 \int_0^{2 \pi} \ln |e^{i x} - e^{2 \pi i/3}| , dx + \frac 1 2 \int_0^{2 \pi} \ln |e^{i x} - e^{-2 \pi i/3}| , dx = \ \int_0^{2 \pi} \ln |e^{i x} - 1| , dx.$$ The rest is as here. – Maxim Sep 18 '20 at 14:31
  • Thanks to everyone for the answers. I had to make a choice as to which one to mark as the accepted answer, so I went for the most slick self-contained answer. – Julian Newman Sep 18 '20 at 17:43

4 Answers4

3

The integrand is $$\ln|e^{ix}+1+e^{-ix}|=\ln\left|\frac{\sin(3x/2)}{\sin(x/2)}\right| =\ln|2\sin(3x/2)|-\ln|2\sin(x/2)|.$$ It's well-known that $$\int_0^{\pi}\ln(2\sin x)\,dx=0.$$ By the relation $\sin(\pi-x)=\sin x$ then $$\int_0^{\pi/2}\ln(2\sin x)\,dx=0$$ and by periodicity, $$\int_{m\pi/2}^{(m+1)\pi/2}\ln|2\sin x|\,dx=0$$ for integers $m$, and so $$\int_{m\pi/2}^{n\pi/2}\ln|2\sin x|\,dx=0$$ for integers $m$ and $n$.

Then $$\int_0^\pi\ln|2\sin(x/2)|\,dx=2\int_0^{\pi/2}\ln(2\sin y)\,dy=\int_0^\pi\ln (2\sin y)\,dy=0$$ and $$\int_0^\pi\ln|2\sin(3x/2)|\,dx=\frac23\int_0^{3\pi/2}\ln|2\sin y|\,dy=0.$$ The original integral is zero.

Angina Seng
  • 158,341
2

$\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} I_{\pm} & \equiv \bbox[5px,#ffd]{\int_{0}^{\pi} \ln\pars{\verts{1 \pm 2\cos\pars{x}}}\,\dd x} \\[5mm] & = \int_{-\pi/2}^{\pi/2}\ln\pars{\verts{1 \mp 2\sin\pars{x}}} \,\dd x \\[5mm] & = \int_{0}^{\pi/2}\ln\pars{\verts{1 \mp 2\sin\pars{x}}}\,\dd x \\[1mm] & + \int_{0}^{\pi/2}\ln\pars{\verts{1 \mp 2\sin\pars{-x}}}\,\dd x \\[5mm] & = \int_{0}^{\pi/2}\ln\pars{\verts{1 - 4\sin^{2}\pars{x}}}\,\dd x \\[5mm] & = \int_{0}^{\pi/2} \ln\pars{\verts{1 - 4\,{1 - \cos{2x} \over 2}}}\,\dd x \\[5mm] & = \int_{0}^{\pi/2} \ln\pars{\verts{-1 + 2\cos\pars{2x}}}\,\dd x \\[5mm] & = {1 \over 2}\int_{0}^{\pi} \ln\pars{\verts{1 - 2\cos\pars{x}}}\,\dd x = {1 \over 2}\,I_{-} \\[5mm] & \implies \left\{\begin{array}{rcl} \ds{I_{+}} & \ds{=} & \ds{{1 \over 2}\,I_{-}} \\ \ds{I_{-}} & \ds{=} & \ds{{1 \over 2}\,I_{-}} \end{array}\right. \\[5mm] &\implies I_{+} \equiv \bbx{\int_{0}^{\pi} \ln\pars{\verts{1 + 2\cos\pars{x}}}\,\dd x = 0} \\ & \end{align}

Felix Marin
  • 89,464
1

$$I=\int_0^\pi \log|1 + 2\cos(x)| \, dx=\int_0^{\frac {2\pi}3} \log|1 + 2\cos(x)| \, dx+\int_{\frac {2\pi}3}^\pi \log|1 + 2\cos(x)| \, dx=I_1+I_2$$ $$I_1=\int_0^{\frac {2\pi}3} \log|1 + 2\cos(x)| \, dx=\frac{1}{54} \left(-4 i \pi ^2+3 \left(\sqrt{3}+i\right) \psi ^{(1)}\left(\frac{1}{3}\right)-3 \left(\sqrt{3}-i\right) \psi ^{(1)}\left(\frac{2}{3}\right)\right)$$ $$I_2=\int_{\frac {2\pi}3}^\pi \log|1 + 2\cos(x)| \, dx=\frac{1}{54} \left(-4 i \pi ^2-3 \left(\sqrt{3}-i\right) \psi ^{(1)}\left(\frac{1}{3}\right)+3 \left(\sqrt{3}+i\right) \psi ^{(1)}\left(\frac{2}{3}\right)\right)$$ $$I=I_1+I_2=-\frac{1}{27} i \left(4 \pi ^2-3 \psi ^{(1)}\left(\frac{1}{3}\right)-3 \psi ^{(1)}\left(\frac{2}{3}\right)\right)=0$$

0

I'm just wondering if you could use the fact that $$\int \ln{f(x)}dx=x\ln{f(x)}-\int\frac{xf'(x)}{f(x)}dx$$ So $$\int\ln(1+2\cos{x})dx=x\ln(1+2\cos{x})-\int \frac{2x\sin{x}}{1+2\cos{x}}dx$$