4

Evaluate : $\int^{\pi}_{0}\ln^2\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right)dx$

we have : \begin{align*} I &= 2\int^{\pi}_{0}\ln^2(1+a^2-2a\cos(x)) -\ln(1+a^2-2a\cos(x))\ln(1+a^2+2a\cos(x)) dx \\ &= 2\int^{\pi}_{0} \ln(1+a^2+2a\cos(x))\ln\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right)dx \end{align*}

I found this : $$\ln\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right) = 4\sum_{k=1}^{\infty}\frac{a^{2k-1}\cos((2k-1)x)}{2k-1}$$ This integral is very difficult

i need help to evaluate .

Gary
  • 36,640
Delta
  • 1

5 Answers5

8

Quanto's derivation above is valid for $|a|<1$. Now, let us consider the case $|a|>1$. Let $b = 1/a$, so $|b|<1$. The argument of the logarithm in the integral can be rewritten as: $$ \frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)} = \frac{a^2(1/a^2+1+2/a\cos x)}{a^2(1/a^2+1-2/a\cos x)} = \frac{1+b^2+2b\cos(x)}{1+b^2-2b\cos(x)} $$ The expression inside the integral is unchanged if we replace $a$ with $1/a$. Let $I(a)$ be the value of the integral for a given $a$. Then $I(a) = I(1/a)$. So, for $|a|>1$, we can use the result for $|b|<1$: $$ I(a) = I(b) = 4\pi(\text{Li}_2(b^2) - \text{Li}_2(-b^2)) = 4\pi\left(\text{Li}_2\left(\frac{1}{a^2}\right) - \text{Li}_2\left(-\frac{1}{a^2}\right)\right) $$ For $|a|=1$, the integrand has a singularity at one of the endpoints of the interval. At this point, the value of the integrand diverges to infinity. However, this is an integrable singularity.

Credit to Gary, we have (for $a=1, -1$): $$4 \int_{0}^{\pi} \log^2 \left( \tan \left( \frac{x}{2} \right) \right) \, dx = 8 \int_{0}^{+\infty} \frac{\log^2t}{1 + t^2} \, dt = \pi^3$$

Thus, the value of the integral is given by: $$ \int^{\pi}_{0}\ln^2\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right) \,dx = \begin{cases} 4\pi(\text{Li}_2(a^2) - \text{Li}_2(-a^2)) & \text{if } |a| < 1 \\ \pi^3 & \text{if } |a| = 1 \\ 4\pi\left(\text{Li}_2\left(\frac{1}{a^2}\right) - \text{Li}_2\left(-\frac{1}{a^2}\right)\right) & \text{if } |a| > 1 \end{cases} $$

Numerical Verification using scipy

$a$ Numerical Result Analytical Result
$0.5$ $2.505504791515$ $2.505504791515$
$0.8$ $13.921356064019$ $13.921356064019$
$2.0$ $2.505504791515$ $2.505504791515$
$5.0$ $0.495753852554$ $0.495753852554$

Edit

Interestingly, we can further write the solutions to the integral in terms of the Legendre Chi Function of order 2.

The definition of $\chi_2(z)$ is: $$ \chi_2(z) = \sum_{k=0}^{\infty} \frac{z^{2k+1}}{(2k+1)^2} = z + \frac{z^3}{9} + \frac{z^5}{25} + \cdots \quad (\text{for } |z| \le 1) $$ Using this we can say that: $$ \boxed{\text{Li}_2(z) - \text{Li}_2(-z) = 2 \chi_2(z)} $$

This comes directly from the series definitions: $$\text{Li}_2(z) = \sum_{n=1}^{\infty} \frac{z^n}{n^2} = \frac{z}{1^2} + \frac{z^2}{2^2} + \frac{z^3}{3^2} + \frac{z^4}{4^2} + \cdots$$ $$\text{Li}_2(-z) = \sum_{n=1}^{\infty} \frac{(-z)^n}{n^2} = -\frac{z}{1^2} + \frac{z^2}{2^2} - \frac{z^3}{3^2} + \frac{z^4}{4^2} - \cdots$$

Subtracting the second series from the first, all the even-power terms cancel out, and the odd-power terms double: $$ \text{Li}_2(z) - \text{Li}_2(-z) = 2\left(\frac{z}{1^2} + \frac{z^3}{3^2} + \frac{z^5}{5^2} + \cdots\right) = 2\chi_2(z) $$

Using this identity, we can rewrite the result much more cleanly.

For $|a| < 1$ with $z=a^2$, $$ 4\pi \times (2\chi_2(a^2)) = 8\pi \chi_2(a^2) $$

For $|a| > 1$ with $z=1/a^2$, $$ 4\pi \times \left(2\chi_2\left(\frac{1}{a^2}\right)\right) = 8\pi \chi_2\left(\frac{1}{a^2}\right) $$

Thus, the value of the integral can be written more elegantly as:

$$ \int^{\pi}_{0}\ln^2\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right) \,dx = \begin{cases} 8\pi \chi_2(a^2) & \text{if } |a| < 1 \\ \pi^3 & \text{if } |a| = 1 \\ 8\pi \chi_2\left(\frac{1}{a^2}\right) & \text{if } |a| > 1 \end{cases} $$

  • 2
    For $a=1$, the singularity is integrable and the integral is $$ 4\int_0^\pi {\log ^2 \left( {\tan \left( {\frac{x}{2}} \right)} \right){\rm d}x} = 8\int_0^{ + \infty } {\frac{{\log ^2 t}}{{1 + t^2 }}{\rm d}t} = \pi ^3 , $$ the common value of the two formulae for $|a|<1$ and $|a|>1$. Same for $a=-1$. – Gary Jun 08 '25 at 13:04
  • 7
    @Gary Nice catch - thanks :) I was too hasty in my conclusion, thinking that the integral diverged fast enough. – Bumblebee Jun 08 '25 at 13:29
6

\begin{align} & \int_0^\pi\ln^2\frac{1 + 2a\cos x + {a^2}}{1 - 2a\cos x + {a^2}} dx\\ =& \int_0^\pi \int_ {-a}^{a} \int_ {-a} ^{a} \frac{4(t-\cos x)(s-\cos x)}{(1 - 2t \cos x + t^2)(1 - 2s \cos x + s^2)}ds dt dx\\ =& \underset{}{\int_{-a}^{a}\int_{-a}^{a}} \frac{2\pi}{1-st}dsdt =2\pi \int_{-a}^{a}\frac{\ln(1+at)-\ln(1-at)}tdt \\ =&\ 4\pi [ \text{Li}_2({a^2})-\text{Li}_2({-a^2})] \end{align}

Quanto
  • 120,125
  • 6
    This is the solution for $|a| < 1$, but for $|a|>1$ we have $$4\pi\left(\text{Li}_2\left(\frac{1}{a^2}\right) - \text{Li}_2\left(-\frac{1}{a^2}\right)\right)$$ – Bumblebee Jun 08 '25 at 12:42
2

\begin{gathered} \Omega=\int_0^\pi \ln ^2\left(\frac{1+2 a \cos x+a^2}{1-2 a \cos x+a^2}\right) d x \\ \Omega=\underbrace{\int_0^\pi \ln ^2\left(1+2 a \cos x+a^2\right) d x}_{x \rightarrow \pi-x}+\int_0^\pi \ln ^2\left(1-2 a \cos x+a^2\right) d x-2 \int_0^\pi \ln \left(1+2 a \cos x+a^2\right) \ln \left(1-2 a \cos x+a^2\right) d x \\ \Omega=2 \int_0^\pi \ln ^2\left(1-2 a \cos x+a^2\right) d x-2 \int_0^\pi \ln \left(1+2 a \cos x+a^2\right) \ln \left(1-2 a \cos x+a^2\right) d x \\ \text { if }|a|<1: \ln \left(1-2 a \cos x+a^2\right)=-2 \sum_{n=1}^{\infty} \frac{a^n \cos (n x)}{n} \text { also : } \int_0^\pi \cos (n x) \cos (k x) d x= \begin{cases}\frac{\pi}{2} & \text { if } n=k \\ 0 & \text { if } n \neq k\end{cases} \\ \int_0^\pi \ln ^2\left(1-2 a \cos x+a^2\right) d x=4 \sum_{n=1}^{\infty} \frac{a^n}{n} \sum_{n=1}^{\infty} \frac{a^k}{k} \int_0^\pi \cos (n x) \cos (k x) d x=2 \pi \sum_{n=1}^{\infty} \frac{a^{2 n}}{n^2}=2 \pi \operatorname{Li}_2\left(a^2\right) \\ \int_0^\pi \ln \left(1+2 a \cos x+a^2\right) \ln \left(1-2 a \cos x+a^2\right) d x=4 \sum_{n=1}^{\infty} \frac{(-a)^n}{n} \sum_{n=1}^{\infty} \frac{a^k}{k} \int_0^\pi \cos (n x) \cos (k x) d x=2 \pi \sum_{n=1}^{\infty} \frac{\left(-a^2\right)^n}{n^2}=2 \pi \operatorname{Li}_2\left(-a^2\right) \\ \frac{1}{4 \pi} \int_0^\pi \ln ^2\left(\frac{1+2 a \cos x+a^2}{1-2 a \cos x+a^2}\right) d x=\left\{\begin{array}{cc} \operatorname{Li}_2\left(a^2\right)-\operatorname{Li}_2\left(-a^2\right) & \text { if }|a|<1 \\ \operatorname{Li}_2\left(\frac{1}{a^2}\right)-\operatorname{Li}_2\left(-\frac{1}{a^2}\right) & \text { if }|a| \geq 1 \end{array}\right. \end{gathered}

1

Here is another method by complex analysis. Suppose $|a|<1$. Then \begin{align} & \int_0^\pi\ln^2\frac{1 + 2a\cos x + {a^2}}{1 - 2a\cos x + {a^2}} dx\\ =& \frac12\int_0^{2\pi}\ln^2\frac{1 + 2a\cos x + {a^2}}{1 - 2a\cos x + {a^2}} dx\\ =& \frac1{2}\int_0^{2\pi}\ln^2\frac{(a+\cos x)^2+\sin^2x}{(a-\cos x)^2+\sin^2x} dx\\ \overset{z=e^{ix}}=& \frac1{2i}\int_{|z|=1}\frac1{z}\ln^2\frac{(a+z)(a+\bar z)}{(a-z)(a-\bar z)} dz\\ =& \frac1{2i}\int_{|z|=1}\frac1{z}\bigg[\ln\bigg(\frac{1+\frac az}{1-\frac az}\bigg)+\ln\bigg(\frac{1+az}{1-az}\bigg)\bigg]^2 dz\tag1\\ =& \frac1{2i}\int_{|z|=1}\frac1{z}\bigg[2\sum_{n=1}^\infty\frac1{2n-1}\bigg(\frac{a}{z}\bigg)^{2n-1}+2\sum_{n=1}^\infty\frac1{2n-1}(az)^{2n-1}\bigg]^2 dz\tag2\\ =& \frac4{2i}\cdot2\pi i\cdot2\sum_{n=1}^\infty\frac{a^{4n-2}}{(2n-1)^2}\tag3\\ =&\ 4\pi [ \text{Li}_2({a^2})-\text{Li}_2({-a^2})]. \end{align} Here from (1) to (2), the following result $$\ln\left(\frac{1+x}{1-x}\right)=2\sum_{n=0}^{\infty}\frac{x^{2n+1}}{2n+1},|x|<1$$ is used. From (2) to (3), Cauchy Theorem is used. If $|a|> 1$, use the same trick.

xpaul
  • 47,821
1

Suppose $|a|<1$. You are in the right direction. What you need is to use the following result to get the answer $$ \int_0^\pi\cos((2m-1)x)\cos((2n-1)x)dx=\frac\pi2\delta_{mn}. $$ In fact, using $$\ln\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right) = 4\sum_{k=1}^{\infty}\frac{a^{2k-1}\cos((2k-1)x)}{2k-1}$$ you can have \begin{align*} I&=\int^{\pi}_{0} \ln^2\left({\frac{1+a^2+2a\cos(x)}{1+a^2-2a\cos(x)}}\right)dx\\ &=\int^{\pi}_{0} \left(4\sum_{k=1}^{\infty}\frac{a^{2k-1}\cos((2k-1)x)}{2k-1}\right)^2dx\\ &=16\int^{\pi}_{0} \left(\sum_{k=1}^{\infty}\frac{a^{2(2k-1)}\cos^2((2k-1)x)}{(2k-1)^2}+2\sum_{j<k}^{\infty}\frac{a^{(2(j+k-1)}\cos((2j-1)x)\cos((2k-1)x)}{(2j-1)(2k-1)}\right)dx\\ &=16\cdot\frac\pi2\sum_{k=1}^{\infty}\frac{a^{2(2k-1)}}{(2k-1)^2}\\ &=\ 4\pi [ \text{Li}_2({a^2})-\text{Li}_2({-a^2})]. \end{align*}

xpaul
  • 47,821