TITLE: Evaluate the integral $\int_{0}^{+\infty}\frac{\arctan \pi x-\arctan x}{x}dx$
QUESTION [13 upvotes]: Compute improper integral : $\displaystyle I=\int\limits_{0}^{+\infty}\dfrac{\arctan \pi x-\arctan x}{x}dx$.

REPLY [2 votes]: Let $D=\{(x,y)\in \mathbb R^2:x\le y \le \pi x\}$. Let $f(x,y):=\frac{1}{x(1+y^2)}$. Since $f\ge 0$ is almost everywhere continuous on $D$ and hence is measurable, Tonelli's theorem states that
$$\iint_D f(x,y)\mathrm dx\mathrm dy=\int_0^{\infty}\left (\frac{1}{x}\int_x^{\pi x} \frac{1}{1+y^2}\mathrm dy \right )\mathrm dx=\int_0^\infty \left (\frac{1}{1+y^2} \int_{\frac{y}{\pi}}^y \frac{1}{x}\mathrm dx \right )\mathrm dy$$
The second integral is exactly $I$. The rightmost integral evaluates to
$$\int_0^\infty \left (\frac{1}{1+y^2} \int_{\frac{y}{\pi}}^y \frac{1}{x}\mathrm dx \right )\mathrm dy=\int_0^{\infty}\frac{\log y-\log (\frac{y}{\pi})}{1+y^2}\mathrm dy=\log \pi \int \frac{1}{1+y^2}\mathrm dy=\color{red}{\frac{\pi}{2}\log\pi}$$
You could also notice that $I$ is a Frullani integral. Generally speaking,
if $f'$ is continuous and the integral converges,
$$\int_0^{\infty}\frac{f(bx)-f(ax)}{x}\mathrm dx=\left (f(0)-f(\infty)\right )\log \left(\frac{b}{a}\right )$$