Evaluating $\int_0^2(\tan^{-1}(\pi x)-\tan^{-1} x)\,\mathrm{d}x$ Hint given: Write the integrand as an integral.
I'm supposed to do this as double integration.
My attempt: 
$$\int_0^2 [\tan^{-1}y]^{\pi x}_{x}$$
$$= \int_0^2 \int_x^{\pi x} \frac { \mathrm{d}y  \mathrm{d}x} {y^2+1}$$
$$= \int_2^{2\pi} \int_{\frac{y}{\pi}}^2 \frac { \mathrm{d}x  \mathrm{d}y} {y^2+1}$$
$$= \int_2^{2\pi} \frac { [x]^2_{\frac{y}{\pi}}  \mathrm{d}y } { y^2+1}$$
$$= \int_2^{2\pi} \frac { 2- {\frac{y}{\pi}}  \mathrm{d}y } { y^2+1}$$
Carrying out this integration, I got, $$2[\tan^{-1} 2 \pi - \tan^{-1} 2] - \frac {1}{2 \pi} [\ln \frac {1+4 {\pi}^2} {5}]$$
But I'm supposed to get $$2[\tan^{-1} 2 \pi - \tan^{-1} 2] - \frac {1}{2 \pi} [\ln \frac {1+4 {\pi}^2} {5}]+ [\frac {\pi-1}{2 \pi}] \ln 5$$
Can someone please explain where I'm wrong? I've failed to pinpoint my mistake. Thank you. 
 A: Use the change of variables $y = xt.$
$$I = \int_0^2 \int_x^{\pi x} \frac { \mathrm{d}y \, \mathrm{d}x} {y^2+1}\\=\int_0^2 \int_1^{\pi } \frac { x} {x^2t^2+1}\mathrm{d}t \, \mathrm{d}x\\=\int_1^{\pi} \int_0^{2 } \frac { x} {x^2t^2+1}\mathrm{d}x \, \mathrm{d}t\\=\int_1^{\pi}  \frac{\ln(1+4t^2)}{2t^2}  \mathrm{d}t$$
Now use integration by parts.
$$I = -\left.\frac{\ln(1+4t^2)}{2t}\right|_1^{\pi}+4\int_1^{\pi}\frac1{1+4t^2} \, dt$$
A: A more straight forward approach uses integration by parts.
Define:
\begin{align}
& I(c)=\int_{a}^{b}dx(1 \times \arctan{c x})=\int_{ac}^{bc}\frac{dy}{c} (1 \times\arctan{ y})=\\&\frac{1}{c}y \arctan(y)|_{ac}^{bc}-\frac{1}{2c}\int_{ac}^{bc}\frac{y}{1+y^2}
\end{align} 
using partial fraction this reads:
\begin{align}
I(c)=\frac{1}{c}y \arctan(y)|_{ac}^{bc}-\frac{1}{2c}\log(1+y^2)|_{ac}^{bc}
\end{align} 
taking $I(\pi)-I(0)$ with $a=0$ and $b=2$ we are done
A: For the sake of an alternative approach, recall the formula for the integral of an inverse function
$$\int f^{-1}(x)\mathrm{d}x=xf^{-1}(x)-F\circ f^{-1}(x)$$
Where $F'(x)=f(x)$. Plugging in $f(x)=\tan(x)$,
$$I=\int\arctan(x)\mathrm{d}x=x\arctan(x)-\int_0^{\arctan(x)}\tan(t)\mathrm{d}t$$
Then recall that $$(-\log|\cos(x)|)'=\tan(x)$$
So we have
$$I=x\arctan(x)+\log|\cos(\arctan(x))|$$
then using trig,
$$I=x\arctan(x)-\frac12\log(x^2+1)$$
So 
$$I_1=\int_0^2\arctan(x)\mathrm{d}x=2\arctan2-\frac12\log5$$
And 
$$
\begin{align}
I_2=&\int_0^2\arctan(\pi x)\mathrm{d}x\\
=&\frac1\pi\int_0^{2\pi}\arctan(x)\mathrm{d}x\\
=&\frac1\pi\bigg(2\pi\arctan2\pi-\frac12\log(4\pi^2+1)\bigg)\\
=&2\arctan2\pi-\frac1{2\pi}\log(4\pi^2+1)\\
\end{align}
$$
So 
$$
\begin{align}
\int_0^2(\arctan\pi x-\arctan x)\mathrm{d}x=&I_2-I_1\\
=&2\arctan2\pi-\frac1{2\pi}\log(4\pi^2+1)-2\arctan2+\frac12\log5\\
=&2\arctan2\pi-\frac1{2}\log\sqrt[\pi]{4\pi^2+1}-2\arctan2+\frac12\log5\\
=&2(\arctan2\pi-\arctan2)+\frac12\log\frac{5}{\sqrt[\pi]{4\pi^2+1}}\\
\end{align}
$$
