How to integrate $\int_0^\infty \frac{\arctan(x) dx}{x(1+x^2)}$?

How would one evaluate the integral $$\int_0^\infty \frac{\arctan(x) \,dx}{x(1+x^2)}$$?

I was told it had a nice closed form and could have been solved with differentiation under the integral sign; however, I tried to set $$I(\alpha) = \int_0^\infty \frac{\arctan(\alpha x) \,dx}{x(1+x^2)}$$ and got nowhere (the resulting integral was very messy). Is there a much more clever substitution that can be used to tackle the integral?

Rewrite

$$\frac{\arctan{x}}{x} = \int_0^1 \frac{du}{1+x^2 u^2}$$

Then plugging this in and reversing the order of integration, we get the integral; value as

\begin{align}\int_0^1 \frac{du}{u^2} \, \int_0^{\infty} dx \, \left (\frac1{\frac1{u^2}+x^2} \frac1{1+x^2} \right ) &= \int_0^1 \frac{du}{1-u^2} \, \int_0^{\infty} dx \left ( \frac1{1+x^2}-\frac1{\frac1{u^2}+x^2} \right )\\ &= \int_0^1 \frac{du}{1-u^2} \, \frac{\pi}{2} (1-u) \\ &= \frac{\pi}{2} \log{2}\end{align}

Let $x=\tan u$ then $$\int_0^\infty \frac{\arctan(x) \,dx}{x(1+x^2)}=\int_0^{\pi/2} \frac{u}{\tan u}\ du =\int_0^{\pi/2} u\cot u\ du$$ now use $$\int_0^{\pi/2} u\cot u \ du=\dfrac{\pi}{2}\ln2$$

• How do you evaluate $I(a)$? I think the integral diverges. – Batominovski Sep 12 '18 at 3:51
• @Batominovski I dont think $I(a)$ give the final answer. it's better I use usually method. I'll correct that. thank you. – Nosrati Sep 12 '18 at 3:53

Let

$$I=\int_0^\infty \frac{\arctan(x) \,dx}{x(1+x^2)}.$$

The change of variable $\arctan x=t$ give us

$$I=\int_0^{\pi/2} \frac{t\cos t \,dt}{\sin t}=\frac{1}{2}\pi\log{2}$$

• How do you obtain the last integral, though? – Batominovski Sep 12 '18 at 3:52

Let $x=\tan(u)$, then \begin{align} \int_0^\infty\frac{\arctan(x)\,\mathrm{d}x}{x\left(1+x^2\right)} &=\int_0^{\pi/2}u\cot(u)\,\mathrm{d}u\\ &=\int_0^{\pi/2}u\,\mathrm{d}\log(\sin(u))\\ &=-\int_0^{\pi/2}\log(\sin(u))\,\mathrm{d}u\\[6pt] &=\frac\pi2\log(2) \end{align} where the last step uses $(2)$ from this answer.

The approach you were pointed to isn't that messy; we have $$I'=\int_0^\infty\frac{1}{1-\alpha^2}\bigg(\frac{1}{1+x^2}-\frac{\alpha^2}{1+\alpha^2 x^2}\bigg)dx=\frac{\pi/2}{1+\alpha},$$so from $I(0)=0$ we get $$I(\alpha)=\frac{\pi}{2}\ln|1+\alpha|,\,I(1)=\frac{\pi}{2}\ln 2.$$However, I think Ron Gordon's use of Feynman's trick is more interesting than this use of Feynman's trick.

A special case of Ramanujan's master theorem for integrating even functions over the positive reals was found by Glaisher in the late 19th century. If $f(x)$ is an even function with a series expansion around zero of the form:

$$f(x) = \sum_{n=0}^{\infty}(-1)^n c_n x^{2n}$$

then

$$\int_0^{\infty}f(x) dx = \frac{\pi}{2}c_{-\frac{1}{2}}$$

if the integral converges. Here the rigorous definition of $c_{-\frac{1}{2}}$ follows from the rigorous statement of Ramanujan's master theorem, but in practice one can simply analytically continue the $c_k$ to fractional values of $k$ in a natural way, e.g. by replacing factorials by gamma functions etc.

In this case, we have:

$$c_n = \sum_{k=0}^n\frac{1}{2k+1}\tag{1}$$

The natural way to analytically continue integer limits of summations to the reals or the complex plane is given here. To evaluate $c_{-\frac{1}{2}}$ one can consider the large $n$ asymptotic expansion of $c_n$, treating $n$ as a continuous variable there allows one to shift lower limit of the summation to $\frac{1}{2}$, allowing one to extract the value of the summation from 0 to $-\frac{1}{2}$.

From the asymptotic formula:

$$\sum_{k=1}^{n}\frac{1}{k} = \log(n) +\gamma +\mathcal{O}\left(n^{-1}\right)\tag{2}$$

we can derive the large $n$ asymptotics of $c_n$ by considering the summation over even $k$:

$$\sum_{k=1}^{n}\frac{1}{2k} = \frac{1}{2}\sum_{k=1}^{n}\frac{1}{k} =\frac{1}{2}\log(n) +\frac{1}{2}\gamma +\mathcal{O}\left(n^{-1}\right)\tag{3}$$

Using(2) and (3) we can then write:

$$c_n = \sum_{k=1}^{2n+2}\frac{1}{k} - \sum_{k=1}^{n+1}\frac{1}{2k} = \log(2) + \frac{1}{2}\log(n+1)+\frac{1}{2}\gamma +\mathcal{O}\left(n^{-1}\right)\tag{4}$$

Then the summation to $n$ in (1) can also be written as a summation to some arbitrary $u$ plus the summation from $u+1$ to $n$. This rule continues to hold for fractional summations whren $u$ and $n$ are arbitrary real or complex numbers. We thus have:

$$c_n = c_{-\frac{1}{2}} + \sum_{k=\frac{1}{2}}^n \frac{1}{2k+1}\tag{5}$$

We can write:

$$\sum_{k=\frac{1}{2}}^n \frac{1}{2k+1} = \sum_{k=1}^{n+\frac{1}{2}} \frac{1}{2k} = \frac{1}{2}\log\left(n+\frac{1}{2}\right) +\frac{1}{2}\gamma +\mathcal{O}\left(n^{-1}\right)$$

Inserting this in (5) and using (4), we then find:

$$c_{-\frac{1}{2}} = \log(2) + \frac{1}{2}\log(n+1) - \frac{1}{2}\log\left(n+\frac{1}{2}\right) + \mathcal{O}\left(n^{-1}\right)$$

Since there cannot be any dependence on $n$, the r.h.s. is actually a constant but this is not visible to us as we're not keeping track of any $\mathcal{O}\left(n^{-1}\right)$ terms. But taking the limit of $n\to\infty$ makes it clear that $c_{-\frac{1}{2}} = \log(2)$, therefore:

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