# compute one improper integral involving arctangent

Compute $$\int_{0}^{\infty} \frac{\arctan(ax)}{x(1+x^{2})}dx$$

$\frac{\pi}{2}\ln(1+a)$ when $a \geq 0$

$-\frac{\pi}{2}\ln(1-a)$ when $a < 0$

Here is my problem, and I can't even dive into a appropriate first step. The most difficult part is the $\arctan$ which I have no idea to eliminate. Thank you for help.

• Differentiate w.r.t $a$ and you will get an easier integral. – Mhenni Benghorbal Jun 30 '14 at 9:07
• The correct result is $\mathop{\text sgn}(a) \pi \ln(1+|a|)/2$ – Fabian Jun 30 '14 at 9:10
• I have add the missing little 'minus' on the second condition. sorry for that. – Zhen Zhang Jun 30 '14 at 9:17

You want to evaluate $$I(a) = \int_0^\infty\! dx\,\frac{\arctan(a x)}{x (1+x^2)}.$$

It is easy to see (because $\arctan(0)=0$) that $I(0)=0$. Moreover, we have $$I'(a)= \int_0^\infty \!dx \frac{1}{(1+x^2)(1+ a^2 x^2)}.$$ The last integral can be integrated by standard methods (e.g. partial fraction expansion), and we obtain $$I'(a) = \frac{a \arctan(a x) -\arctan(x)}{a^2 -1}\Bigg|_{x=0}^\infty = \frac{\pi}2 \frac{|a| -1}{a^2-1} = \frac{\pi}2 \frac{1}{1 +|a|}.$$

Another integration yields the final result $$I(a)= \int_0^a\!db\,I'(b) = \frac{\pi}2 \int_0^a\!db\,(1+|b|)^{-1} = \frac\pi2 \mathop{\rm sgn}(a)\ln(1+|a|).$$

Another approach is to consider $\displaystyle f(z) = \frac{\ln(1-iaz)}{z(1+z^{2})}$ (where $a \ge 0$) and integrate around a contour on the complex plane 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,

\begin{align} \int_{-\infty}^{\infty} \frac{\ln |1-iax| - i \arctan (ax) }{x(1+x^{2})} \ dx &= \int_{-\infty}^{\infty} \frac{\frac{1}{2}\ln(1+a^{2}x^{2}) - i \arctan(ax)}{x(1+x^{2})} \ dx \\ &= 2 \pi i \ \text{Res}[f(z),i] \\ &= 2 \pi i \ \lim_{z \to i} \frac{\ln(1-iaz)}{z(z+i)} \\ &= - i \pi \ln(1+a) . \end{align}

But

\begin{align} \int_{-\infty}^{\infty} \frac{\frac{1}{2}\ln (1+a^{2}x^{2}) - i \arctan (ax) }{x(1+x^{2})} \ dx &= \int_{-\infty}^{\infty} \frac{\frac{1}{2}\ln(1+a^{2}x^{2})}{x(1+x^{2})} \ dx - i \int_{-\infty}^{\infty} \frac{\arctan (ax)}{x(1+x^{2})} \ dx \\ &= 0 - 2i \int_{0}^{\infty} \frac{\arctan (ax)}{x(1+x^{2})} \ dx \\ &= -2i \int_{0}^{\infty} \frac{\arctan (ax)}{x(1+x^{2})} \ dx \end{align}

since the first integrand is odd and the second integrand is even.

So we have

$$-2i \int_{0}^{\infty} \frac{\arctan (ax)}{x(1+x^{2})} \ dx = - i \pi \ln(1+a)$$

which implies

$$\int_{0}^{\infty} \frac{\arctan (ax)}{x(1+x^{2})} \ dx = \frac{\pi}{2} \ln(1+a) \ , \ a \ge 0.$$

But since $\arctan$ is an odd function,

$$\int_{0}^{\infty} \frac{\arctan (ax)}{x(1+x^{2})} \ dx = \frac{\pi}{2} \text{sgn}(a) \ln(1+|a|) .$$

• Look super awesome ... Thank you anyway :) – Zhen Zhang Jun 30 '14 at 11:36
• This is a good demonstration of the usefulness of contour integration (+1). It is hard to beat a trick like differentiation under the integral, though :-) – robjohn Jun 30 '14 at 17:42
• @Sacheo Thanks. – Random Variable Jun 30 '14 at 20:04
• @robjohn Thanks. The evaluation turned out to be surprisingly simple. – Random Variable Jun 30 '14 at 20:06


Set $\ds{t \equiv 1 - \ic x\quad\imp\quad x = \pars{t - 1}\ic}$: \begin{align}&\color{#c00000}{\int_{0}^{\infty} {\arctan\pars{ax} \over x\pars{1+x^{2}}}\,\dd x} =-\,\half\,a\verts{a}\,\Im\int_{1 + \infty\ic}^{1 - \infty\ic} {\ln\pars{t} \over \pars{t - 1}\ic\bracks{-\pars{t - 1}^{2} + a^{2}}}\,\ic\,\dd t \\[3mm]&=-\,\half\,a\verts{a}\,\Im\color{#00f}{% \int_{1 - \infty\ic}^{1 + \infty\ic}{\ln\pars{t}\over \pars{t - 1}\pars{t - r_{-}}\pars{t - r_{+}}}\,\dd t} \quad \mbox{where}\quad r_{\pm} = 1 \pm \verts{a} \end{align}

Now, we'll evaluate the $\ds{\color{#00f}{\mbox{'blue integral'}}}$. We take the "$\ds{\ln}$-branch cut" along the negative $\ds{t}$-semi-axis and close the contour in a semi-circle "to the right" $\ds{\pars{~t > 1~}}$: \begin{align}&\color{#c00000}{\int_{0}^{\infty} {\arctan\pars{ax} \over x\pars{1+x^{2}}}\,\dd x} =-\,\half\,a\verts{a}\,\Im\bracks{-2\pi\ic\, {\ln\pars{r_{+}} + \ic 0 \over \pars{r_{+} - 1}\pars{r_{+} - r_{-}}}} \\[3mm]&=\pi\,a\verts{a}\,\bracks{% {\ln\pars{1 + \verts{a}} \over \verts{a}\pars{2\verts{a}}}} \end{align}

$$\color{#66f}{\large\int_{0}^{\infty} {\arctan\pars{ax} \over x\pars{1+x^{2}}}\,\dd x ={\pi \over 2}\,\sgn\pars{a}\ln\pars{1 + \verts{a}}}$$