Integrate $\left[\arctan\left(x\right)/x\right]^{2}$ between $-\infty$ and $+\infty$

I have tried to calculate $$ \int_{-\infty}^{\infty}\left[\arctan\left(x\right) \over x\right]^{2}\,{\rm d}x $$ with integration by parts and that didn't work.

I looked up the indefinite integral and found it contained a polylogarithm which I don't know how to use so I tried contour integration but got stuck.

$${\tt\mbox{Wolfram Alpha said the answer is}}\,\,\,{\large \pi\log\left(4\right)}$$

Can anyone show me how to do this integral ?.


Solution 1:

$$ \begin{align} \int_{-\infty}^\infty\left(\frac{\arctan(x)}{x}\right)^2\mathrm{d}x &=2\int_0^\infty\left(\frac{\arctan(x)}{x}\right)^2\mathrm{d}x\tag{1}\\ &=2\int_0^\infty\left(\frac\pi2-\arctan(u)\right)^2\mathrm{d}u\tag{2}\\ &=2\int_0^{\pi/2}\left(\frac\pi2-v\right)^2\,\mathrm{d}\tan(v)\tag{3}\\ &=4\int_0^{\pi/2}\tan(v)\left(\frac\pi2-v\right)\,\mathrm{d}v\tag{4}\\ &=4\int_0^{\pi/2}w\cot(w)\,\mathrm{d}w\tag{5}\\ &=4\int_0^{\pi/2}w\,\mathrm{d}\log(\sin(w))\tag{6}\\ &=-4\int_0^{\pi/2}\log(\sin(w))\,\mathrm{d}w\tag{7} \end{align} $$ Explanation:
$(1)$: integrand is even, halve the domain and double
$(2)$: substitute $x=1/u$
$(3)$: substitute $u=\tan(v)$
$(4)$: integrate by parts
$(5)$: substitute $v=\pi/2-w$
$(6)$: $\mathrm{d}\log(\sin(w))=\cot(w)\,\mathrm{d}w$
$(7)$: integrate by parts

Steven Stadnicki suggests that we should mention
$\ \ $In the explanation of $(4)$, note that $\lim\limits_{v\to\pi/2}\left(\frac\pi2-v\right)^2\tan(v)=0$
$\ \ $In the explanation of $(7)$, note that $\lim\limits_{w\to0}w\log(\sin(w))=0$

Note that $$ \begin{align} &\int_0^{\pi/2}\log(\sin(w))\,\mathrm{d}w\\ &=\int_0^{\pi/2}\log(2\sin(w/2)\cos(w/2))\,\mathrm{d}w\\ &=\frac\pi2\log(2)+\int_0^{\pi/2}\log(\sin(w/2))\,\mathrm{d}w+\int_0^{\pi/2}\log(\cos(w/2))\,\mathrm{d}w\\ &=\frac\pi2\log(2)+2\int_0^{\pi/4}\log(\sin(w))\,\mathrm{d}w+2\int_0^{\pi/4}\log(\cos(w))\,\mathrm{d}w\\ &=\frac\pi2\log(2)+2\int_0^{\pi/4}\log(\sin(w))\,\mathrm{d}w+2\int_{\pi/4}^{\pi/2}\log(\sin(w))\,\mathrm{d}w\\ &=\frac\pi2\log(2)+2\int_0^{\pi/2}\log(\sin(w))\,\mathrm{d}w\tag{8} \end{align} $$ Therefore, $$ \int_0^{\pi/2}\log(\sin(w))\,\mathrm{d}w=-\frac\pi2\log(2)\tag{9} $$ Combining $(7)$ and $(9)$ yields $$ \int_{-\infty}^\infty\left(\frac{\arctan(x)}{x}\right)^2\mathrm{d}x =2\pi\log(2)\tag{10} $$

Solution 2:

You can use the following way to evaluate. It is pretty neat and simple. Let $$ I(a,b)=\int_{-\infty}^\infty\frac{\arctan(ax)\arctan(bx)}{x^2}dx. $$ Clearly $I(0,b)=I(a,0)=0$ and $I(1,1)=I$. Now \begin{eqnarray} \frac{\partial^2I(a,b)}{\partial a\partial b}&=&\int_{-\infty}^\infty\frac{1}{(1+a^2x^2)(1+b^2x^2)}dx\\ &=&\frac{1}{a^2-b^2}\int_{-\infty}^\infty\left(\frac{a^2}{1+a^2x^2}-\frac{b^2}{1+b^2x^2}\right)dx\\ &=&\frac{1}{b^2-a^2}\pi(a-b)\\ &=&\frac{\pi}{a+b}. \end{eqnarray} Hence $$ I=\int_0^1\int_0^1\frac{\pi}{a+b}dadb=2\pi\ln2.$$

Solution 3:

\begin{align} \int^{\infty}_{-\infty}\frac{(\arctan{x})^2}{x^2}dx &=2\int^{\infty}_{0}\frac{(\arctan{x})^2}{x^2}dx\tag1\\ &=2\int^{\pi/2}_0u^2\csc^2{u} \ du\tag2\\ &=4\int^{\pi/2}_0u\cot{u} \ du\tag3\\ &=-4\int^{\pi/2}_0\ln\sin{u} \ du\tag4\\ &=2\pi\ln{2}\tag5\\ \end{align} Explanation:
$1)$ Integrand is even
$2)$ Use the substitution $x=\tan{u}$
$3), 4)$ Integrate by parts
$5)$ See here

Solution 4:

Since you mentioned you tried contour integration, I'll add an approach using contour integration.

Consider $ \displaystyle f(z) = \frac{\log^{2}(1-iz)}{z^{2}}$ where the branch cut runs down the imaginary axis from $z=-i$.

And notice that the singularity at the origin is removable.

Now integrate around a contour that consists of the line segment $[-R,R]$ and the upper half of the circle $|z|=R$.

As $R \to \infty$, $ \displaystyle \int f(z) \ dz$ vanishes along the upper half of $|z|=R$.

Therefore,

$$ \int_{-\infty}^{\infty} \frac{\big( \log|1-ix| - i \arctan (x) \big)^{2}}{x^{2}} \ dx = 0 $$

which implies $$\int_{-\infty}^{\infty} \frac{\frac{1}{4} \log^{2}(1+x^{2}) -i \log(1+x^{2}) \arctan (x) - \arctan^{2}(x) }{x^{2}} =0 . $$

And equating the real parts on both sides of the equation we have $$ \begin{align} \int_{-\infty}^{\infty} \frac{\arctan^{2} (x)}{x^{2}} \ dx &= \frac{1}{4} \int_{-\infty}^{\infty} \frac{\log^{2} (1+x^{2})}{x^{2}} \ dx \\ &= \frac{1}{2} \int_{0}^{\infty} \frac{\log^{2}(1+x^{2})}{x^{2}} \ dx \\ &= \frac{1}{4} \int_{0}^{\infty} \frac{\log^{2}(1+u)}{u^{3/2}} \ du \\ &= \frac{1}{4} (8 \pi \log 2)\tag{1} \\ &= 2 \pi \log 2 . \end{align}$$

$(1)$ Integrate $ \int_0^\infty \frac{ \ln^2(1+x)}{x^{3/2}} dx=8\pi \ln 2$

EDIT:

As was stated in Gennaro Marco Devincenzis' answer, integrating by parts shows that $$\int_{-\infty}^{\infty} \frac{\arctan^{2}(x)}{x^{2}} \ dx = 2 \int_{-\infty}^{\infty} \frac{\arctan x}{x(1+x^{2})} \ dx. $$

And that integral as well can be evaluated using contour integration, which is probably preferable since it's just a residue calculation.

See here for the details.

Solution 5:

Disclaimer: It's one of the first times I evaluate an integral whose primitive cannot be found in terms of elementary functions. God it's a drug.

Integrating by parts

$$\int_{-\infty}^{+\infty} \frac{\arctan^2 x}{x^2}dx=\bigg[-\frac{\arctan^2 x}{x}\bigg]_{-\infty}^{+\infty}+2\int_{-\infty}^{+\infty}\frac{\arctan x}{(1+x^2)x}dx$$ The first part yields $0$. For the second consider: $$I(t)=\int_{-\infty}^{+\infty}\frac{\arctan tx}{x(1+x^2)}dx$$ Differentiating under the integral sign: $$I'(t)=\int_{-\infty}^{+\infty}\frac{1}{(1+t^2x^2)(1+x^2)}dx=\frac{\pi}{t+1}$$ $$I(t)=\pi\log(t+1)+C$$ So: $$\int_{-\infty}^{+\infty}\frac{\arctan tx}{x(1+x^2)}dx=\pi\log(t+1)+C$$ Letting $t=0$ we recover $C=0$. So, letting t=1: $$\int_{-\infty}^{+\infty}\frac{\arctan x}{x(1+x^2)}dx=\pi\log(2)$$ Since there was a $2$ in the integration by parts we have: $$\int_{-\infty}^{+\infty} \frac{\arctan^2 x}{x^2}dx=2\int_{-\infty}^{+\infty}\frac{\arctan x}{x(1+x^2)}dx=2\pi\log2=\pi\log4$$