# Compute $\int_0^1\frac{\ln^2(1+x)}{1+x^2}\, dx$

How to prove

$$I=\int_0^1\frac{\ln^2(1+x)}{1+x^2}\ dx=4\Im\operatorname{Li}_3(1+i)-\frac{7\pi^3}{64}-\frac{3\pi}{16}\ln^22-2\ln2\ G$$

Where $$\operatorname{Li}_3(x)$$ is the the trilogarithm function and $$G$$ is the Catalan constant.

Variant approaches are appreciated.

I proved here in Eq $$(1)$$:
\begin{align} \int_0^1\frac{\ln^2(1+x)}{1+x^2}\ dx&=\Im\operatorname{Li}_3(1+i)-\frac{\pi^3}{32}+\overset{\text{IBP}}{\int_0^1\frac{\ln x\ln(1+x)}{1+x^2}\ dx}\\ &=\Im\operatorname{Li}_3(1+i)-\frac{\pi^3}{32}-\int_0^1\frac{\ln x\tan^{-1}x}{1+x}\ dx-\int_0^1\frac{\ln(1+x)\tan^{-1}x}{x}\ dx\\ \end{align} FDP beautifully calculated here the first integral: $$\displaystyle\int_0^1\frac{\ln x\tan^{-1}x}{1+x}\ dx=\frac12G\ln2-\frac{\pi^3}{64}$$

and I managed here to find the second integral: $$\displaystyle\int_0^1 \frac{\ln(1+x)\tan^{-1}x}{x}\ dx=\frac{3\pi^3}{32}+\frac{3\pi}{16}\ln^22+\frac32G\ln2-3\text{Im}\operatorname{Li}_3(1+i)$$

Plugging the results of the two integrals, we get the closed form of the original integral.

• Pardon my ignorance: What is IBP? – user679268 Jul 1 '19 at 2:29
• Integration by parts – Ali Shadhar Jul 1 '19 at 2:42
• Just to add as in this post, then $$\Im\left[\operatorname{Li}_3\big(1+i\big)\right] =\sqrt2 \;{_4F_3}\left(\begin{array}c\tfrac12,\tfrac12,\tfrac12,\tfrac12\\ \tfrac32,\tfrac32,\tfrac32\end{array}\middle|\;\tfrac12\right)-\frac1{192}\pi^3$$ – Tito Piezas III Jul 1 '19 at 3:21
• @TitoPiezasIII and can be expressed in $\operatorname{Li}_3\left(\frac{1+i}{2}\right)$ based on the identity $\operatorname{Li}_3(x)+\operatorname{Li}_3(1-x)+\operatorname{Li}_3\left(1-\frac1x\right)=\frac16\ln^3x-\frac12\ln^2x\ln(1-x)+\zeta(2)\ln x+\zeta(3)\$, $x=i$ – Ali Shadhar Jul 1 '19 at 3:25
• Nice work (+1). I love integrals involving $\mathrm G$. – clathratus Jul 1 '19 at 7:12

A solution with two bonuses:

First lets define :

$$X=\int_0^1\frac{\ln^2(1+x)}{1+x^2}dx$$

$$Y=\int_0^1\frac{\ln(1-x)\ln(1+x)}{1+x^2}dx$$

$$Z=\int_0^1\frac{\ln x\ln(1+x)}{1+x^2}dx$$

also we will be using the two auxiliary integrals (proved below):

$$\mathcal{J}=\int_0^1\frac{\ln^2(1-x)}{1+x^2}dx=-2\ \text{Im}\operatorname{Li}_3(1+i)+\frac{3\pi}{16}\ln^22+\frac{7}{64}\pi^3$$

$$\mathcal{K}=\int_0^\infty\frac{\ln^2(1+x)}{1+x^2}dx=2\ \text{Im}\operatorname{Li}_3(1+i)$$

My technique here is to establish three relations and solve them as a system of equations.

First relation:

We know that the value of $$\int_0^1\frac{\ln^2 x}{1+x^2}dx=\frac{\pi^3}{16}$$ and by subbing $$x\mapsto \frac{1-x}{1+x}$$ we get

$$\frac{\pi^3}{16}=\int_0^1\frac{\ln^2(1-x)}{1+x^2}dx-2\int_0^1\frac{\ln(1-x)\ln(1+x)}{1+x^2}dx+\int_0^1\frac{\ln^2(1+x)}{1+x^2}dx$$

substitute the value of $$\mathcal{J}$$ to get

$$X-2Y=2\ \text{Im}\operatorname{Li}_3(1+i)-\frac{3\pi^3}{64}-\frac{3\pi}{16}\ln^22\tag1$$

Second relation:

We start with $$\int_0^1\frac{\ln x\ln(1-x)}{1+x^2}dx$$ where if we sub $$x\mapsto \frac{1-x}{1+x}$$ we get

$$\int_0^1\frac{\ln^2(1+x)}{1+x^2}-\int_0^1\frac{\ln(1-x)\ln(1+x)}{1+x^2}-\int_0^1\frac{\ln x\ln(1+x)}{1+x^2}=-\ln2\underbrace{\int_0^1\frac{\ln\left(\frac{1-x}{1+x}\right)}{1+x^2}}_{x\mapsto (1-x)/(1+x)}$$

or

$$X-Y-Z=\ln2\ G\tag2$$

Third relation:

We manipulate the integral $$A$$:

$$\int_0^1\frac{\ln^2(1+x)}{1+x^2}dx=\int_0^\infty\frac{\ln^2(1+x)}{1+x^2}dx-\underbrace{\int_1^\infty\frac{\ln^2(1+x)}{1+x^2}dx}_{x\mapsto 1/x}$$

$$=\int_0^\infty\frac{\ln^2(1+x)}{1+x^2}dx-\int_0^1\frac{\ln^2(1+x)}{1+x^2}dx+2\int_0^1\frac{\ln x\ln(1+x)}{1+x^2}dx-\underbrace{\int_0^1\frac{\ln^2x}{1+x^2}dx}_{\pi^3/16}$$

substitute the value of $$\mathcal{K}$$ we get

$$X-Z=\text{Im}\operatorname{Li}_3(1+i)-\frac{\pi^3}{32}\tag3$$

Now we solve the three equations $$(1)$$, $$(2)$$ and $$(3)$$:

$$X-2Y=a,\quad a=2\ \text{Im}\operatorname{Li}_3(1+i)-\frac{3\pi^3}{64}-\frac{3\pi}{16}\ln^22$$

$$X-Y-Z=b,\quad b=\ln2\ G$$

$$X-Z=c,\quad c=\text{Im}\operatorname{Li}_3(1+i)-\frac{\pi^3}{32}$$

we get

$$X=a-2b+2c=4\ \text{Im}\operatorname{Li}_3(1+i)-\frac{7\pi^3}{64}-\frac{3\pi}{16}\ln^22-2\ln2\ G$$

$$Y=-b+c=\text{Im}\operatorname{Li}_3(1+i)-\frac{\pi^3}{32}-\ln2\ G$$

$$Z=a-2b+c=3\ \text{Im}\operatorname{Li}_3(1+i)-\frac{5\pi^3}{64}-\frac{3\pi}{16}\ln^22-2\ln2\ G$$

Proof of $$\mathcal{J}$$:

Note that $$\frac1{1+x^2}=\text{Im}\frac{i}{1-ix}$$ and by using the identity

$$\int_0^1\frac{y\ln^{n}(x)}{1-y+yx}dx=(-1)^{n-1}n!\operatorname{Li}_{n+1}\left(\frac{y}{y-1}\right)$$ which can be found in the book Almost Impossible Integrals, Sums and Series page 5, we get

$$\mathcal{J}=\int_0^1\frac{\ln^2(1-x)}{1+x^2}dx=\text{Im}\int_0^1\frac{i\ln^2(1-x)}{1-ix}dx, \quad x\mapsto 1-x$$

$$=\text{Im}\int_0^1\frac{i\ln^2(x)}{1-i+ix}dx=-2\ \text{Im}\operatorname{Li}_{3}\left(\frac{i}{i-1}\right)=\boxed{\frac{3\pi}{16}\ln^22+\frac{7}{64}\pi^3-2\ \text{Im}\operatorname{Li}_3(1+i)}$$

where the last result follows from using the trilogarithm identity

$$\small{\operatorname{Li}_3(x)+\operatorname{Li}_3(1-x)+\operatorname{Li}_3\left(\frac{x}{x-1}\right)=\frac16\ln^3(1-x)-\frac12\ln x\ln^2(1-x)+\zeta(2)\ln(1-x)+\zeta(3)}$$

Proof of $$\mathcal{K}$$:

This integral was nicely calculated by Cornel:

$$\int_0^\infty\frac{\ln^2(1+x)}{1+x^2}dx\overset{x\mapsto 1/x}{=}\int_0^\infty\frac{\ln\left(\frac{x}{1+x}\right)}{1+x^2}dx\overset{x/(1+x)\mapsto x}{=}\int_0^1\frac{\ln^2x}{x^2+(1-x)^2}dx$$

$$=\text{Im} \int_0^1\frac{(1+i)\ln^2x}{1-(1+i)x}dx=\boxed{2\ \text{Im} \operatorname{Li}_3(1+i)}$$

where the last result follows from using the identity

$$\int_0^1\frac{y\ln^nx}{1-yx}dx=(-1)^{n-1}n!\operatorname{Li}_{n+1}(y)$$

which can be found in the same book mentioned above same page.

If we follow the same approach of evaluating $$\mathcal{J}$$ and $$\mathcal{K}$$ we can get the two generalizations:

$$\int_0^1\frac{\ln^n(1-x)}{1+x^2}dx=(-1)^{n-1}n!\ \text{Im}\left\{\operatorname{Li}_{n+1}\left(\frac{i}{i-1}\right)\right\}$$

$$\int_0^\infty\frac{\ln^n(1+x)}{1+x^2}dx=(-1)^nn!\ \text{Im}\{\operatorname{Li}_{n+1}(1+i)\}$$

A hint.

With

$$\frac{1}{n!}\int\frac{(\ln(x+z))^n}{x-a}\,dx =\sum\limits_{k=0}^n\frac{(\ln(x+z))^k}{k!}(-1)^{n-k+1}\text{Li}_{n-k+1}\left(\frac{x+z}{a+z}\right) + C$$

follows the calculation for:

$$\int\frac{(\ln(1+x))^2}{1+x^2}\,dx = \Im\int\frac{(\ln(x+z))^n}{x-a}\,dx|_{(n,z,a)=(2,1,i)}$$

For the definite integral it's left to simplify $$~\displaystyle \Im\,\text{Li}_1(\frac{2}{1+i})~$$, $$~\displaystyle \Im\,\text{Li}_2(\frac{2}{1+i})~$$, $$~\displaystyle \Im\,\text{Li}_3(\frac{2}{1+i})~$$

and $$~\displaystyle \Im\,\text{Li}_3(\frac{1}{1+i})~$$ .