# Prove that $\int_0^\infty\left(\arctan \frac1x\right)^2 \mathrm d x = \pi\ln 2$

Prove $$\int_0^\infty\left(\arctan \frac1x\right)^2 \mathrm d x = \pi\ln 2$$

Out of boredom, I decided to play with some integrals and Inverse Symbolic Calculator and accidentally found this to my surprise

$$\int_0^\infty\Big(\arctan \frac1x\Big)^2 \mathrm d x = \pi\ln 2 \quad (\text{conjectural}) \,\,\, {\tag{1}}$$

Here is Wolfram Alpha computation which shows (1) to be true to 50 digits. Is (1) true and how to prove it?

I can calculate

$$\int_0^\infty\arctan \frac{1}{x^2}\mathrm d x = \frac{\pi}{\sqrt2}$$

easily by expanding $$\arctan$$ into Maclaurin series. But how to proceed with $$\arctan^2$$?

• Here what you can try. Do integration by part. And you'll get something like this $something + \int arctan(\frac{1}{x})2x\frac{1}{1+\frac{1}{x^2}}\frac{1}{x^2}dx=something+\int arctan(\frac{1}{x})dln(1+x^2)$. Then do integration by part once more. I think you'll get a nice version. – kolobokish Jun 7 at 15:41
• If you take $x=\cot t$, Mathematica gives $\pi \ln 2$ for the transformed integral. – Dr Zafar Ahmed DSc Jun 7 at 16:06
• The answer is here with $n:=2$ because of $\displaystyle \int\limits_0^\infty\left(\arctan\frac{1}{x}\right)^2 dx= \int\limits_0^\infty\left(\frac{\arctan x}{x}\right)^2 dx$ . – user90369 Jun 7 at 16:34

$$\int_0^\infty \arctan^2\left(\frac{1}{x}\right)dx\overset{\frac{1}{x}\to t}=\int_0^\infty \frac{\arctan^2 t}{t^2}dt\overset{IBP}=2\int_0^\infty \frac{\arctan t}{t(1+t^2)}dt$$ $$\overset{t=\tan x}=2\int_0^\frac{\pi}{2} \frac{x}{\tan x}dx\overset{IBP}=-2\int_0^\frac{\pi}{2}\ln(\sin x)dx=\pi\ln 2$$ See here for the last integral.

• Thought about the same (+1) ^^ – mrtaurho Jun 7 at 15:54
• I guess that I got the fast fingers, haha :D – Zacky Jun 7 at 16:01
• Indeed. Also, right now I'm only on mobile from which it is inconvenient to write out an answer containing to much MathJax expressions; otherwise I surely would've beat you ;) – mrtaurho Jun 7 at 16:06
• The limits don’t make sense to me.... If $1/x=t$, then for the lower limit $x\to0\implies t\to\infty$, and for the upper limit $x\to\infty\implies t\to0$, but the order is flipped. What happened there? – gen-z ready to perish Jun 7 at 21:48
• @ChaseRyanTaylor I used the minus sign to flip them. $x=\frac{1}{t}\Rightarrow dx=\color{red}- \frac{1}{t^2}{dt}$. And yes we have $$\int_a^b f(x)dx=-\int_b^a f(x)dx$$ – Zacky Jun 7 at 21:52

First the substitution $$x\mapsto 1/x$$ and then integration by parts yields $$\int_0^\infty\arctan^2x^{-1}\,dx=2\int_0^\infty\frac{\arctan x}{x(1+x^2)}\,dx$$ so it suffices to evaluate the integral on the right. Define the function $$f(a)=\int_0^\infty\frac{\arctan (ax)}{x(1+x^2)}\,dx$$ and differenciate with respecto to $$a$$ to obtain $$f'(a)=\int_0^\infty\frac{dx}{(1+x^2)(a^2+x^2)}= \frac\pi2\frac1{1+a}.$$ Thus $$f(a)=\frac\pi2\log(1+a)+C$$ where the constant $$C$$ can be seen to be $$0$$ letting $$a=0$$. The result is now immediate letting $$a=1$$.

• Not sure about last part, but alternatively we can write:$$\require{cancel} f'(a)=\frac{\pi}{2}\frac{\cancel{1-a}}{\cancel{(1-a)}(1+a)}\Rightarrow f(a)=\frac{\pi}{2} \ln (1+a)+C$$ Now for $a=0$ we get $C=0$ and it follows that $I=2f(1)=\pi \ln 2$ – Zacky Jun 7 at 16:09
• @Zacky Well.... yes, you're completely right, that's faster. I was relying to much on Mathematica :) – user246336 Jun 7 at 16:15

Let $$I(a,b)=\int_0^\infty\left(\arctan \frac ax\right)\left(\arctan \frac bx\right) \mathrm d x.$$ Then $$\begin{eqnarray} \frac{\partial^2I(a,b)}{\partial a\partial b}&=&\int_0^\infty\frac{x^2}{(x^2+a^2)(x^2+b^2)}\mathrm d x\\ &=&\frac{1}{a^2-b^2}\int_0^\infty \bigg(\frac{a^2}{x^2+a^2}-\frac{b^2}{x^2+b^2}\bigg)\mathrm d x\\ &=&\frac{1}{a^2-b^2}\frac\pi2(a-b)\\ &=&\frac{\pi}{2}\frac{1}{a+b} \end{eqnarray}$$ and hence $$I(1,1)=\frac{\pi}{2}\int_0^1\int_0^1\frac{1}{a+b}\mathrm d a\mathrm d b=\frac\pi2\int_0^1(\ln(b+1)-\ln b)\mathrm d b=\pi\ln2.$$

• That is a very nice "generalised" approach. – omegadot Jun 9 at 5:15

Note that $$\arctan \frac{1}{x} = \frac{\pi}{2} - \arctan x$$ (simply draw a triangle with side $$1$$ and $$x$$ and consider the two angles). We then obtain $$I = \int_0^\infty \left( \arctan \frac{1}{x} \right)^2 \mathrm d x = \int_0^\infty \left( \frac{\pi}{2} - \arctan x \right)^2 \mathrm d x,$$ and we make the substitution $$x = \tan u$$ to obtain $$I = \int_0^{\frac{\pi}{2}} \sec^2 u \left( \frac{\pi}{2} - u \right)^2 \mathrm d u = \int_0^{\frac{\pi}{2}} \sec^2 u \left( \frac{\pi}{2} - u \right)^2 \mathrm d u$$ and again making a substitution $$v = \frac{\pi}{2} - u$$ gives $$\int_0^{\frac{\pi}{2}} \frac{v^2}{\sin^2(v)} \mathrm d v$$ which is in fact evaluatable (although requires the polylogarithm function to express): $$\int \frac{v^2}{\sin^2(v)} \mathrm d v = -i(v^2 + \mathrm{Li}_2(e^{2iv}))-v^2 \cot(v) + 2v \ln(1-2e^{iv}) + c,$$ upon which evaluating at both bounds gives $$\pi \ln (2)$$.

Take $$x=\cot t$$, the required integral becomes $$I=\int t^2 \csc^2 t~ dt= -t^2 \cot t-\int 2 t \cot t~ dt= -t^2 \cot t-2t \ln \sin t+ \int 2 \ln \sin t ~ dt.$$ Taking limits from $$t=\pi/2$$ to $$x=0$$ and using the well known integral $$\int_{0}^{\pi/2} \ln \sin t ~dt=-\frac{\pi}{2} \ln 2,$$ we get the required result.