Integral $\int_0^1 \left(\arctan x \right)^2\,dx$

Evaluate

$$\int_0^1 \left(\arctan x \right)^2\,dx$$

The answer should be

$${\pi^2\over16} + \frac{\pi\ln(2)}{4} -C$$

where $C$ is Catalan's constant.

How do I proceed?

I tried doing integration by parts twice and got stuck at $$\int_0^1{\frac{\log\left(\frac1{x}+x\right)}{1+x^2}}\,dx$$


Integrating by parts twice,

$$ \begin{align} \int_{0}^{1} (\arctan x)^{2} \ dx &= x (\arctan x)^{2} \Big|^{1}_{0} - 2 \int_{0}^{1} \frac{x \arctan x}{1+x^{2}} \ dx \\ &= \frac{\pi^{2}}{16} - 2 \int_{0}^{1} \frac{x \arctan x}{1+x^{2}} \ dx \\ &= \frac{\pi^{2}}{16} - \arctan(x) \ln(1+x^{2}) \Big|^{1}_{0} + \int_{0}^{1} \frac{\ln (1+x^{2})}{1+x^{2}} \ dx \\ &= \frac{\pi^{2}}{16} - \frac{\pi}{4} \ln 2 + \int_{0}^{1} \frac{\ln(1+x^{2})}{1+x^{2}} \ dx \end{align}$$

Let $x = \tan t $.

Then

$$\begin{align}\int_{0}^{1} (\arctan x)^{2} \ dx &=\frac{\pi^{2}}{16} - \frac{\pi}{4} \ln 2 - 2 \int_{0}^{\pi /4} \ln (\cos t) \ dt \\ &= \frac{\pi^{2}}{16} - \frac{\pi}{4} \ln 2 -2 \int_{0}^{\pi /4} \left( \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n} \cos (2nt) - \ln 2 \right) \ dt \\ &= \frac{\pi^{2}}{16} - \frac{\pi}{4} \ln 2 - 2 \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n}\int_{0}^{\pi /4} \cos (2nt) \ dt + \frac{\pi}{2} \ln 2 \\ &= \frac{\pi^{2}}{16} + \frac{\pi}{4} \ln 2 - \sum_{n=1}^{\infty} \frac{\sin \left(\frac{\pi n}{2} \right)}{n^{2}} \\ &= \frac{\pi^{2}}{16} + \frac{\pi}{4} \ln 2 - \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^{2}} \\ &= \frac{\pi^{2}}{16} + \frac{\pi}{4} \ln 2 - C \end{align}$$

Fourier series of Log sine and Log cos


$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{1}\arctan^{2}\pars{x}\,\dd x ={\pi^{2} \over 16} + {\pi\ln\pars{2} \over 4} - C:\ {\large ?}.\quad}$ $\ds{C}$ is the Catalan Constant.

Set $\ds{\quad x \equiv \tan\pars{\theta}\quad\imp\quad\theta = \arctan\pars{x}}$: \begin{align}&\color{#c00000}{\int_{0}^{1}\arctan^{2}\pars{x}\,\dd x} =\int_{0}^{\pi/4}\theta^{2}\sec^{2}\pars{\theta}\,\dd\theta ={\pi^{2} \over 16} - \int_{0}^{\pi/4}\tan\pars{\theta}\pars{2\theta}\,\dd\theta \\[3mm]&={\pi^{2} \over 16} + \ln\pars{1 \over \root{2}}2\,{\pi \over 4} -2\int_{0}^{\pi/4}\ln\pars{\cos\pars{\theta}}\,\dd\theta \\[3mm]&={\pi^{2} \over 16} - {1 \over 4}\,\pi\ln\pars{2} - \int_{0}^{\pi/4} \ln\pars{\half\bracks{2\sin\pars{\theta}\cos\pars{\theta}}\cot\pars{\theta}} \,\dd\theta \\[3mm]&={\pi^{2} \over 16} - {1 \over 4}\,\pi\ln\pars{2} + {1 \over 4}\,\pi\ln\pars{2} - \int_{0}^{\pi/4}\ln\pars{\cot\pars{\theta}}\,\dd\theta -\int_{0}^{\pi/4}\ln\pars{\sin\pars{2\theta}}\,\dd\theta \end{align}

However, a integral representation of $\ds{C}$ is given by: $$ C = \int_{0}^{\pi/4}\ln\pars{\cot\pars{\theta}}\,\dd\theta $$ such that $$ \color{#c00000}{\int_{0}^{1}\arctan^{2}\pars{x}\,\dd x} ={\pi^{2} \over 16} - C -\half\color{#00f}{\int_{0}^{\pi/2}\ln\pars{\sin\pars{\theta}}\,\dd\theta}\tag{1} $$

Also, \begin{align}&\color{#00f}{\int_{0}^{\pi/2}\ln\pars{\sin\pars{\theta}}\,\dd\theta} =\half\bracks{\int_{0}^{\pi/2}\ln\pars{\sin\pars{\theta}}\,\dd\theta +\int_{0}^{\pi/2}\ln\pars{\cos\pars{\theta}}\,\dd\theta} \\[3mm]&=\half\int_{0}^{\pi/2}\ln\pars{\sin\pars{2\theta} \over 2}\,\dd\theta =-\,{1 \over 4}\,\pi\ln\pars{2} +{1 \over 4}\int_{0}^{\pi}\ln\pars{\sin\pars{\theta}}\,\dd\theta \\[3mm]&=-\,{1 \over 4}\,\pi\ln\pars{2} +{1 \over 4}\int_{0}^{\pi/2}\ln\pars{\sin\pars{\theta}}\,\dd\theta +{1 \over 4}\int_{\pi/2}^{\pi}\ln\pars{\sin\pars{\theta}}\,\dd\theta \\[3mm]&=-\,{1 \over 4}\,\pi\ln\pars{2} +\half\color{#00f}{\int_{0}^{\pi/2}\ln\pars{\sin\pars{\theta}}\,\dd\theta} \end{align}

$$ \imp\quad\color{#00f}{\int_{0}^{\pi/2}\ln\pars{\sin\pars{\theta}}\,\dd\theta} = -\,\half\,\pi\ln\pars{2} $$

Replace this result in $\pars{1}$: $$\color{#66f}{\large% \int_{0}^{1}\arctan^{2}\pars{x}\,\dd x ={\pi^{2} \over 16} + {\pi\ln\pars{2} \over 4} - C} \approx 0.2453 $$


If one know that $\displaystyle \int_0^{\dfrac{\pi}{2}}\log (\sin (x))dx=-\dfrac{\pi}{2}\log(2)$

so then :

$\displaystyle \int_0^\dfrac{\pi}{2}\dfrac{x}{\tan x }dx=\dfrac{\pi}{2}\log(2)$ (by integration by parts)

Let $I=\displaystyle \int_0^\dfrac{\pi}{2}\dfrac{x}{\tan x }dx$

Change of variable $u=\tan x$ :

$I=\displaystyle \int_0^{+\infty} \dfrac{\arctan x}{x(1+x^2)}dx$

$I=\displaystyle \int_0^1 \dfrac{\arctan x}{x(1+x^2)}dx+\int_1^{+\infty} \dfrac{\arctan x}{x(1+x^2)}dx$

in the second integral, in the right member make the change of variable $u=\dfrac{1}{x }$ $I= \displaystyle\int_0^1 \dfrac{\arctan x}{x(1+x^2)}dx+ \int_0^1 \dfrac{x\arctan \Big(\dfrac{1}{x}\Big) }{1+x^2}dx$

For $x>0$ one have $\arctan\Big(\dfrac{1}{x}\Big)+\arctan x=\dfrac{\pi}{2}$

$I= \displaystyle\int_0^1 \dfrac{\arctan x}{x(1+x^2)}dx+\dfrac{\pi}{2}\int_0^1\dfrac{x}{1+x^2}dx-\int_0^1\dfrac{x\arctan x}{1+x^2}dx$

But: $\dfrac{1}{x(1+x^2)}=\dfrac{1}{x}-\dfrac{x}{1+x^2}$

So then:

$I=\displaystyle\int_0^1 \dfrac{\arctan x}{x}dx-\displaystyle\int_0^1 \dfrac{x\arctan x}{1+x^2}dx+\dfrac{\pi}{2}\int_0^1\dfrac{x}{1+x^2}dx-\int_0^1\dfrac{x\arctan x}{1+x^2}dx$

Hence: $I=\displaystyle\int_0^1 \dfrac{\arctan x}{x}dx-2\displaystyle\int_0^1 \dfrac{x\arctan x}{1+x^2}dx+\dfrac{\pi}{4}\Big[\log(1+x^2)\Big]_0^1$

and so:

$I=\displaystyle\int_0^1 \dfrac{\arctan x}{x}dx-2\displaystyle\int_0^1 \dfrac{x\arctan x }{1+x^2}dx+\dfrac{\pi}{4}\log(2)$

But: the derivative of $x\rightarrow(\arctan x)^2$ is $x\rightarrow\dfrac{2\arctan x }{1+x^2}$

So then:

$I=\displaystyle\int_0^1 \dfrac{\arctan x}{x}dx-\Big(\big[ x(\arctan x)^2\big]_0^1-\int_0^1(\arctan x)^2 dx\Big)+\dfrac{\pi}{4}\log(2)$ $I=\displaystyle\int_0^1\dfrac{\arctan x }{x}dx-\dfrac{\pi^2}{16}+\int_0^1(\arctan x)^2 dx$

But $I=\dfrac{\pi}{2}\log(2)$ so then:

$$\displaystyle\int_0^1 (\arctan x)^2 dx=\dfrac{\pi^2}{16}-G+\dfrac{\pi}{4}\log(2)$$

where $\displaystyle G=\int_0^1 \dfrac{\arctan x}{x}dx$ is the Catalan's constant.


I believe it is interesting to look at your definite integral in terms of the more general result $$\begin{align} \int (\arctan x)^2dx=&x(\arctan x)^2 -\frac{1}{2}\log(1+x^2)\arctan x+ \log2\arctan x+\tag{1}\label{eq:main}\\ &-\Im\left\{\mbox{Li}_2\left(\frac{1+ix}{2}\right)\right\}+K.\end{align}$$ where $\mbox{Li}_2(z)$ is dilogarithm function. The above expression can be calculated by letting $$\omega = \frac{1+ix}{2}=|\omega|\mbox{e}^{i\arctan x}\tag{2}\label{eq:omega}$$ and then noting that $$|\omega|^2 = \omega \cdot (1-\omega).\tag{3}\label{eq:mod}$$ Thus, from \eqref{eq:omega}, $$\begin{align} \log \omega &= \log|\omega|+i\arctan x=\\ &=\frac{1}{2}\log|\omega|^2+i\arctan x=\\ &\stackrel{\eqref{eq:mod}}=\frac{1}{2}\log\omega + \frac{1}{2}\log(1-\omega)+ i\arctan x.\end{align}$$ This finally gives the following expression for the inverse tangent function: $$\arctan x = -\frac{i}{2}[\log \omega + \mbox{Li}_1(\omega)],\tag{4}\label{eq:arctan}$$ where $$ \mbox{Li}_1(z) = -\log(1-z).$$ Using \eqref{eq:arctan} to calculate the integral, $$\begin{align}\int(\arctan x)^2dx &= -\frac{1}{4}\int[\log\omega + \mbox{Li}_1(\omega)]^2 dx=\\ &=\frac{i}{2}\int[\log\omega +\mbox{Li}_1(\omega)]^2d\omega,\end{align}$$ and recalling that the integral definition of the dilogarithm is $$ \mbox{Li}_2(z) = -\int_0^z\frac{\log(1-u)}{u}du = \int_0^z\frac{\mbox{Li}_1(u)}{u}du$$ easily leads to \eqref{eq:main}. So the definite integral is $$\int_0^1 (\arctan x)^2 dx = \frac{\pi^2}{16} + \frac{(\log 2) \pi}{8}- \Im\left\{\mbox{Li}_2\left(\frac{1+i}{2}\right)\right\}.$$ The value of the dilogarithm in $\frac{1+i}{2}$ can be determined using Landen's identity, as detailed here, which was pointed out to me by user153012: $$ \mbox{Li}_2\left(\frac{1+i}{2}\right) = \frac{5\pi^2}{96} - \frac{(\log 2)^2}{8} + i\left[C - \frac{(\log 2)\pi}{8}\right], $$ $C$ being Catalan's constant. This confirms the result obtained in the previous answers, i.e. $$\int_0^1 (\arctan x)^2 dx = \frac{\pi^2}{16} + \frac{(\log 2) \pi}{4} - C $$