<s>[INST] 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. 
 [/INST] 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
</s>