# Solve this integral:$\int_0^\infty\frac{\arctan x}{x(x^2+1)}\mathrm dx$

I occasionally found that $\displaystyle\int_0^{\Large\frac{\pi}{2}}\dfrac{x}{\tan x}=\dfrac{\pi}{2}\ln 2$.

I tried that

$$\int_0^{\Large\frac{\pi}{2}}\dfrac{x}{\tan x}=\int_0^{\Large\frac{\pi}{2}}x \ \mathrm d(\ln \sin x)=-\int_0^{\Large\frac{\pi}{2}}\ln (\sin x)=\dfrac{\pi}{2}\ln 2$$ Then I tried another method $$\int_0^{\Large\frac{\pi}{2}}\dfrac{x}{\tan x}=\int_0^\infty\dfrac{\arctan x}{x(x^2+1)}\mathrm dx$$ I tried to expand $\arctan x$ and $\dfrac{1}{1+x^2}$, but got nothing, also I was confused that whether $\displaystyle\int_0^\infty$ and $\displaystyle\sum_{i=0}^\infty$ can exchange or not? If yes, on what condition?

• – Blex Aug 29 '15 at 11:15
• Using $\int_a^bf(x)\ dx=\int_a^bf(a+b-x)\ dx$ $\displaystyle\int_0^{\frac{\pi}{2}}\dfrac{x}{\tan x}=\int_0^{\frac{\pi}{2}}x\tan x\ dx$ $\int x\tan x\ dx=x\int\tan x\ dx-\int\left(\dfrac{dx}{dx}\int\tan x\ dx\right)dx$ $=x\int\tan x\ dx-\int\left(\ln\sec x\right)dx$ $=x\int\tan x\ dx+\int\left(\ln\cos x\right)dx$ See math.stackexchange.com/questions/37829/… – lab bhattacharjee Aug 29 '15 at 11:20

I just want to seek ways that have nothing to do with $\ln (\sin x)$.

Hint. You may consider $$I(a):=\int_0^\infty\frac{\arctan (ax)}{x(x^2+1)}\:\mathrm dx,\quad 0<a<1, \tag1$$ and obtain $$I'(a)=\int_0^\infty\frac1{(x^2+1)(a^2x^2+1)}\:\mathrm dx.$$ By using partial fraction decomposition, we have $$\frac1{(x^2+1)(a^2x^2+1)}=\frac1{\left(1-a^2\right) \left(x^2+1\right)}-\frac{a^2}{\left(1-a^2\right) \left(a^2 x^2+1\right)}$$ giving \begin{align} I'(a)&=\frac1{\left(1-a^2\right)}\int_0^\infty\!\frac1{x^2+1}\:\mathrm dx-\frac{a^2}{\left(1-a^2\right)}\int_0^\infty\frac1{a^2x^2+1}\:\mathrm dx\\\\ &=\frac1{\left(1-a^2\right)}[\arctan x]_0^\infty-\frac{a^2}{\left(1-a^2\right)}\left[\frac{\arctan (ax)}a\right]_0^\infty\\\\ &=\frac1{\left(1-a^2\right)}\frac{\pi}2-\frac{a}{\left(1-a^2\right)}\frac{\pi}2\\\\ &=\frac{\pi}2\frac1{1+a} \tag2 \end{align} Since $I(0)=0$, by integrating $(2)$, you easily get

$$\int_0^\infty\frac{\arctan (ax)}{x(x^2+1)}\:\mathrm dx=\frac{\pi}2\: \ln (a+1), \qquad 0\leq a <1,$$

from which, by letting $a \to 1^-$, you deduce

$$\int_0^\infty\frac{\arctan x}{x(x^2+1)}\:\mathrm dx=\frac{\pi}2 \ln 2$$

as announced.

Before providing my solution, I'd must admit that Oliver Oloa provides the way to calculate this integral. I merely provide a different approach, using Fourier transforms.

First a comment. I tried to use a symmetry argument saying that $$\int_0^{+\infty}f(x+1/x)\arctan x\frac{dx}{x} =\frac{\pi}{4}\int_0^{+\infty} f(x+1/x)\frac{dx}{x},$$ but I was not able to put this integral into that form. Now to the solution:

Since the integrand is even, our integral equals $$\frac{1}{2}\int_{-\infty}^{+\infty}\frac{\arctan x}{x(1+x^2)}\,dx.$$ We need to know the Fourier transforms $$\mathcal F\Bigl[\frac{1}{1+x^2}\Bigr](\xi)=\sqrt{\frac{\pi}{2}}e^{-|\xi|}\quad\text{and}\quad \mathcal F\Bigl[\frac{\arctan x}{x}\Bigr](\xi)=\sqrt{\frac{\pi}{2}}\int_{|\xi|}^{+\infty}\frac{e^{-t}}{t}\,dt.$$ By Parseval's formula, $$\int_0^{+\infty}\frac{\arctan x}{x(1+x^2)}\,dx= \frac{1}{2}\sqrt{\frac{\pi}{2}}\sqrt{\frac{\pi}{2}} \int_{-\infty}^{+\infty} e^{-|\xi|}\int_{|\xi|}^{+\infty} \frac{e^{-t}}{t}\,dt\,d\xi.$$ The integrand is even in $\xi$, so we get $$\frac{\pi}{2}\int_0^{+\infty}e^{-\xi}\int_{\xi}^{+\infty}\frac{e^{-t}}{t}\,dt\,d\xi.$$ Changing the order of integrations, and calculating the inner one, we get $$\frac{\pi}{2}\int_0^{+\infty}\frac{e^{-t}}{t}\int_0^t e^{-\xi}\,d\xi \,dt= \frac{\pi}{2}\int_0^{+\infty}\frac{e^{-t}}{t}(1-e^{-t})\,dt$$ Now, the last integral is a Frullani integral that equals $\log 2$, so we finally get that $$\int_0^{+\infty}\frac{\arctan x}{x(1+x^2)}\,dx=\frac{\pi}{2}\log 2.$$

Another chance is given by the following representation associated with the cotangent function $$1-x\cot x=\sum_{n\geq 1}\left(\frac{x}{\pi n-x}-\frac{x}{\pi n+x}\right)\tag{1}$$ that comes from applying $\frac{d}{dx}\log(\cdot)$ to the Weierstrass product for the sine function.
If you integrate both sides of $(1)$ over $\left(0,\frac{\pi}{2}\right)$ the original integral is transformed into a series that is easy to handle through summation by parts and Stirling's inequality. The final outcome is $$\int_{0}^{\pi/2}\left(1-x\cot x\right)\,dx = \frac{\pi}{2}\left(1-\log 2\right)\tag{2}$$ that is equivalent to the claim. Anyway, there is a well-known symmetry trick for computing $\int_{0}^{\pi/2}\log\sin(x)\,dx$, that probably gives the slickest approach.

\begin{align} J&=\int_0^\infty\frac{\arctan x}{x(x^2+1)}\mathrm dx\tag1\\ &=\int_0^1\frac{\arctan x}{x(x^2+1)}\mathrm dx+\int_1^\infty\frac{\arctan x}{x(x^2+1)}\mathrm dx \end{align}

In the latter integral perform the change of variable $y=\dfrac{1}{x}$,

\begin{align} J&=\int_0^1\frac{\arctan x}{x(x^2+1)}\mathrm dx+\int_0^1\frac{x\arctan\left(\dfrac{1}{x}\right)}{x^2+1}\mathrm dx\\ &=\left(\int_0^1\frac{\arctan x}{x}\mathrm dx-\int_0^1\frac{x\arctan x}{1+x^2}\mathrm dx\right)+\dfrac{\pi}{2}\int_0^1 \dfrac{x}{x^2+1}dx-\int_0^1\frac{x\arctan x}{x^2+1}\mathrm dx\\ &=\left(\int_0^1\frac{\arctan x}{x}\mathrm dx-2\int_0^1\frac{x\arctan x}{1+x^2}\mathrm dx\right)+\dfrac{\pi}{4}\ln 2 \end{align}

In $(1)$ perform the change of variable $x=\dfrac{2y}{1-y^2}$,

\begin{align} J&=\int_0^1 \dfrac{(1-y^2)\arctan\left(\dfrac{2y}{1-y^2}\right)}{y(1+y^2}dy\\ &=2\int_0^1 \dfrac{(1-y^2)\arctan y}{y(1+y^2}dy\\ &=2\left(\int_0^1\frac{\arctan x}{x}\mathrm dx-2\int_0^1\frac{x\arctan x}{1+x^2}\mathrm dx\right) \end{align}

Therefore,

$\displaystyle \int_0^1\frac{\arctan x}{x}\mathrm dx-2\int_0^1\frac{x\arctan x}{1+x^2}\mathrm dx=\dfrac{J}{2}$

Therefore,

$\displaystyle J=\dfrac{J}{2}+\dfrac{\pi}{4}\ln 2$

Finally,

$\boxed{J=\displaystyle \dfrac{\pi}{2}\ln 2}$
