Evaluate the integral $\int_{0}^{+\infty}\frac{\arctan \pi x-\arctan x}{x}dx$ Compute improper integral : $\displaystyle I=\int\limits_{0}^{+\infty}\dfrac{\arctan \pi x-\arctan x}{x}dx$.
 A: We have
$$\int_a^b \dfrac{\arctan \pi x-\arctan x}{x}dx=\int_{\pi a}^{\pi b}\dfrac{\arctan x}{x}dx-\int_{ a}^{ b}\dfrac{\arctan x}{x}dx\\=\int_{ b}^{\pi b}\dfrac{\arctan x}{x}dx-\int_{ a}^{ \pi a}\dfrac{\arctan x}{x}dx$$
and since the function $\arctan$ is increasing so
$$\arctan( b)\log\pi=\arctan( b)\int_b^{\pi b}\frac{dx}{x}\leq\int_{ b}^{\pi b}\dfrac{\arctan x}{x}dx\\ \leq\arctan(\pi b)\int_b^{\pi b}\frac{dx}{x}=\arctan(\pi b)\log\pi$$
so if $b\to\infty$ we have
$$\int_{ b}^{\pi b}\dfrac{\arctan x}{x}dx\to\frac{1}{2}\pi\log\pi$$
and by a similar method we prove that
$$\int_{ a}^{ \pi a}\dfrac{\arctan x}{x}dx\to 0,\quad a\to0$$
hence we conclude
$$\displaystyle I=\int\limits_{0}^{+\infty}\dfrac{\arctan \pi x-\arctan x}{x}dx=\frac{1}{2}\pi\log\pi$$
A: With
\begin{eqnarray*}
\lim_{x \to \infty}\left\lbrack\arctan\left(\pi x\right) - \arctan\left(x\right)\right\rbrack
\ln\left(x\right)
& = &
\lim_{x \to \infty}
\left\lbrack\arctan\left(1 \over x\right) - \arctan\left(1 \over \pi x\right)\right\rbrack
\ln\left(x\right)
\\
& = &
\left(1 - {1 \over \pi}\right)\lim_{x \to \infty}{\ln\left(x\right) \over x}
\\
& = &
\left(1 - {1 \over \pi}\right)\lim_{x \to \infty}{1/x \over 1} = 0
\end{eqnarray*}
and
\begin{eqnarray*}
\lim_{x \to 0}\left\lbrack\arctan\left(\pi x\right) - \arctan\left(x\right)\right\rbrack
\ln\left(x\right)
& = &
\left(\pi - 1\right)\lim_{x \to 0}
\left\lbrack x\ln\left(x\right)\right\rbrack
\\
& = &
\left(\pi - 1\right)\lim_{x \to 0}{\ln\left(x\right) \over 1/x}
\\
& = &
\left(\pi - 1\right)\lim_{x \to 0}{1/x \over -1/x^{2}} = 0
\end{eqnarray*}
we have
\begin{eqnarray*}\color{#66f}{\large\int_{0}^{\infty}%
{\arctan\left(\pi x\right) - \arctan\left(x\right) \over x}\,{\rm d}x}
& = &
-\int_{0}^{\infty}\ln\left(x\right)\left\lbrack
{\pi \over \left(\pi x\right)^{2} + 1}
-
{1 \over x^{2} + 1}
\right\rbrack\,{\rm d}x
\\
& = &
-\int_{0}^{\infty}\left\lbrack\ln\left(x \over \pi\right) - \ln\left(x\right)\right\rbrack
{1 \over x^{2} + 1}\,{\rm d}x
\\
& = &
\ln\left(\pi\right)
\underbrace{\quad\int_{0}^{\infty}
{1 \over x^{2} + 1}\,{\rm d}x\quad}_{=\ \pi/2}
=
\color{#66f}{\large{\pi \over 2}\,\ln\left(\pi\right)} \approx {\tt 1.7981}
\end{eqnarray*}
A: 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 )$$
A: $$I(a)=\int\limits_{0}^{+\infty}\dfrac{\arctan (a x)-\arctan x}{x}dx$$
$$I'(a) = \int^{\infty}_0 \frac{1}{1+a^2x^2}\, dx$$
$$I'(a) =\frac{\pi}{2 a}\, $$
Hence by integrating
$$I(a) =\frac{\pi}{2} \log(a) +C $$ 
by $a=1$ we have $C=0$
$$I(a) = \frac{\pi}{2} \log(a)  $$
$$I(\pi)=\int\limits_{0}^{+\infty}\dfrac{\arctan (\pi x)-\arctan x}{x}dx = \frac{\pi}{2} \log(\pi) $$
A: You can write
$$I=\int_0^\infty dx\int_1^\pi dy\ \frac{1}{1+x^2y^2}.$$
Change the order of integration:
$$I=\int_1^\pi dy\int_0^\infty dx\ \frac{1}{1+x^2y^2}=\int_1^\pi dy\ \frac{\pi}{2y}=\frac{\pi}{2}\ln\pi.$$
If memory serves, this is an old Putnam problem.
Addendum:
Eric Auld correctly points out that the change in the order of integration should be justified. By thm. 6.3 of these notes, we can change the order of integration if
$$\int_0^\infty dx\ \frac{1}{1+x^2y^2}$$
converges uniformly for $y\in[1,\pi]$. That is, we want to show that for any $\epsilon>0$ there exists $x_0\in[0,\infty)$ with
$$\epsilon>\left|\int_0^\infty dx\ \frac{1}{1+x^2y^2}-\int_0^\xi dx\ \frac{1}{1+x^2y^2}\right|=\left|\int_\xi^\infty dx\ \frac{1}{1+x^2y^2}\right|$$
("convergence") for all $\xi\ge x_0$ and $y\in[1,\pi]$ ("uniform"). In other words, the unbounded region of the integral can be made arbitrarily small for all values of $y$ simultaneously.
In this case,
$$\int_\xi^\infty dx\ \frac{1}{1+x^2y^2}\le\int_\xi^\infty dx\ \frac{1}{1+x^2}=\frac{\pi}{2}-\tan^{-1}\xi$$
so if we choose
$$x_0>\tan\left(\frac{\pi}{2}-\epsilon\right)$$
then we are done.
