This is part 3 of our series on very nasty logarithmic integrals. Please have a look at part 1 and part 2 before reading this post.
Integral #5
The first integral that we will evaluate in this post is the following: $$ I_1 = \int_0^1 \frac{\log^2(x) \arctan(x)}{1+x^2}dx $$ Of course, one can use brute force methods to find a closed form anti-derivative in terms of polylogarithms. Instead, a more elegant solution is possible by contour integration.
We’ll integrate the principal branch of $f(z) = \frac{\arctan(z)}{1+z^2}\left(\text{arctanh}^2(z) + \frac{\pi^2}{16} \right)$ around the following contour:

where
- $\gamma_{3,\epsilon}$ is an arc parameterized by $e^{it}$, where $\arctan\left(\frac{\epsilon \sqrt{4-\epsilon^2}}{2-\epsilon^2} \right)\leq t \leq \frac{\pi}{2} – \arctan\left(\frac{\epsilon \sqrt{4-\epsilon^2}}{2-\epsilon^2} \right)$.
- $\gamma_{2,\epsilon}$ and $\gamma_{4,\epsilon}$ are circular indents of radius $\epsilon$ around the branch points at $z=1$ and $z=i$, respectively.
- $\gamma_{1,\epsilon}$ is a straight line joining $0$ and $1-\epsilon$.
- $\gamma_{4,\epsilon}$ is a straight line joining $(1-\epsilon)i$ and $0$.
For the integral over $\gamma_{3,\epsilon}$, we will take advantage of the following identities: $$ \begin{aligned} \arctan(e^{i\theta}) &= \frac{\pi}{4}+\frac{i}{2} \log\left(\frac{1+\tan \frac{\theta}{2}}{1-\tan \frac{\theta}{2}} \right), \quad 0\leq \theta \leq \frac{\pi}{2} \\ \text{arctanh}(e^{i\theta}) &= -\frac{1}{2}\log \left(\tan\frac{\theta}{2} \right)+\frac{i\pi}{4}, \quad 0\leq \theta \leq \frac{\pi}{2}\\ \end{aligned} $$ We have $$ \begin{aligned} \lim_{\epsilon\to 0^+} \int_{\gamma_{3,\epsilon}}f(z) \; dz &= i \int_0^{\frac{\pi}{2}}f(e^{i\theta}) e^{i\theta} \; d\theta \\ &= \frac{i}{2} \int_0^{\frac{\pi}{2}}\frac{\left( \frac{\pi}{4}+\frac{i}{2} \log\left(\frac{1+\tan \frac{\theta}{2}}{1-\tan \frac{\theta}{2}} \right)\right)\left( -\frac{i\pi}{4}\log \left(\tan\frac{\theta}{2} \right)+\frac{1}{4}\log^2\left(\tan \frac{\theta}{2} \right) \right)}{\cos \theta}d\theta \end{aligned} $$ The real part of the above integral is $$ \begin{aligned} \text{Re}\left[\lim_{\epsilon\to 0^+} \int_{\gamma_{3,\epsilon}}f(z) \; dz \right] &= \int_0^\frac{\pi}{2} \frac{\frac{1}{16}\log^2\left(\tan\frac{\theta}{2} \right)\log\left(\frac{1-\tan \frac{\theta}{2}}{1+\tan \frac{\theta}{2}} \right)+\frac{\pi^2}{32}\log\left(\tan\frac{\theta}{2} \right)}{\cos \theta} d\theta \\ &= \int_0^1 \frac{\frac{1}{8}\log^2\left(u \right)\log\left(\frac{1-u}{1+u} \right)+\frac{\pi^2}{16}\log\left(u \right)}{1-u^2} du \quad \left(u= \tan\frac{\theta}{2} \right) \\ &= -\frac{1}{8} \int_0^1 \frac{\log^2(u)\log\left(\frac{1+u}{1-u}\right)}{1-u^2} + \frac{\pi^2}{16}\left(-\frac{\pi^2}{8} \right) \\ &= \frac{1}{16}\int_0^1 \frac{\log(u) \log^2\left(\frac{1-u}{1+u} \right)}{u}du – \frac{\pi^4}{128} \quad \color{blue}{\cdots (3)} \end{aligned} $$ Using the results from part 1, we get $$ \begin{aligned} \int_0^1 \frac{\log(u)\log^2\left(\frac{1-u}{1+u} \right)}{u}du &= \frac{7}{4}\int_0^1 \frac{\log(u)\log^2(1-u)}{u}du + 2\int_0^1 \frac{\log(u)\log^2(1+u)}{u}du \\ &= \frac{7}{4}\left(2\zeta(4) – 2\sum_{n=1}^\infty \frac{H_n}{n^3} \right)+2\left(2\text{Li}_4(-1)+2\sum_{n=1}^\infty\frac{(-1)^{n+1} H_n}{n^3} \right) \\ &= -\frac{7\pi^4}{144}+4\sum_{n=1}^\infty \frac{(-1)^{n+1}H_n}{n^3} \end{aligned} $$ By Cauchy’s integral theorem, the sum of (1), (2) and (3) is equal to zero. Therefore, $$ \begin{aligned} &\; -\frac{I_1}{2} + \frac{5\pi^4}{512}+\frac{1}{16}\left(-\frac{7\pi^4}{144}+4 \sum_{n=1}^\infty \frac{(-1)^{n+1}H_n}{n^3}\right)-\frac{\pi^4}{128} = 0 \\ &\implies I_1 = -\frac{5\pi^4}{2304}+\frac{1}{2}\sum_{n=1}^\infty (-1)^{n+1}\frac{H_n}{n^3} \\ &\implies I_1 = -\frac{5\pi^4}{2304}+\frac{1}{2}\left(\frac{11\pi^4}{360}+\frac{\pi^2}{12}\log^2(2)-\frac{\log^4(2)}{12} -\frac{7}{4}\log(2)\zeta(3)-2\text{Li}_4\left(\frac{1}{2} \right)\right) \\ &\implies \boxed{I_1 = \frac{151 \pi ^4}{11520}+\frac{\pi ^2}{24} \log ^2(2)-\frac{\log ^4(2)}{24} -\frac{7}{8} \zeta (3) \log (2)-\text{Li}_4\left(\frac{1}{2}\right)} \end{aligned} $$ Refer to this post for the evaluation of $\sum_{n=1}^\infty (-1)^{n+1}\frac{H_n}{n^3}$.
Integral #6
The next integral that we’ll evaluate is $$ I_2 = \int_0^1 \frac{\log^3(x) \arctan(x)}{1+x^2}dx \quad \color{blue}{\cdots (4)} $$ Using the transformation $x\mapsto \frac{1}{x}$, we write the integral as: $$ \begin{aligned} I_2 &= -\int_1^\infty\frac{\log^3(x)\left(\frac{\pi}{2}-\arctan(x) \right)}{1+x^2}dx \quad \color{blue}{\cdots (5)} \end{aligned} $$ Adding up equations (4) and (5) and dividing both sides by 2 gives us: $$ \begin{aligned} I_2 &= -\frac{\pi}{4}\int_1^\infty \frac{\log^3(x)}{1+x^2}dx + \frac{1}{2}\int_0^\infty \frac{\log^3(x) \arctan(x)}{1+x^2}dx\\ &= \frac{\pi}{4}\int_0^1 \frac{\log^3(x)}{1+x^2}dx + \frac{1}{2}\int_0^\infty \frac{\log^3(x) \arctan(x)}{1+x^2}dx \end{aligned} $$ Note that $$ \begin{aligned} \int_0^1 \frac{\log^3(x)}{1+x^2}dx &= \sum_{n=0}^\infty (-1)^n \int_0^1 x^{2n}\log^3(x) \; dx \\ &= -6\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^4} \\ &= -6\beta(4) \end{aligned} $$ So, we have $$ I_2 = – \frac{3\pi}{2}\beta(4) + \frac{1}{2}\int_0^\infty \frac{\log^3(x) \arctan(x)}{1+x^2}dx \quad \color{blue}{\cdots (6)} $$ To evaluate the integral in the above equation, we will use the Feynman technique. Define the function $F:[0,\infty) \to \mathbb{R}$ as $F(s) = \int_0^\infty \frac{\log^3(x)\arctan(s x)}{1+x^2}dx$. Now, we have $$ F'(s) = \int_0^\infty \frac{x \log^3(x)}{(1+x^2)(1+s^2 x^2)}dx $$ Before evaluating $F'(s)$, we will evaluate the simpler integral $\int_0^\infty \frac{x \log(x)}{(1+x^2)(1+s^2 x^2)}dx$. To do this, integrate the principal branch of $g(z) = \frac{z\log^2(-z)}{(1+z^2)(1+s^2 z^2)}$ around the following “key hole” contour:

where:
- $\gamma_{1,\epsilon, R}$ is a line joining the points $\sqrt{R^2-\epsilon^2}-i\epsilon$ and $-i\epsilon$.
- $\gamma_{2,\epsilon, R}$ is a line joining the points $i\epsilon$ and $\sqrt{R^2-\epsilon^2}+i\epsilon$.
- $\gamma_{3,\epsilon}$ is parameterized by $\epsilon e^{-i t}$ where $\frac{\pi}{2} \leq t \leq \frac{3\pi}{2}$.
- $\gamma_{4,R}$ is parameterized by $R e^{i t}$ where $\arctan\left(\frac{\epsilon}{\sqrt{R^2-\epsilon^2}} \right) \leq t \leq 2\pi – \arctan\left(\frac{\epsilon}{\sqrt{R^2-\epsilon^2}} \right)$.