Calculate the finite integral $\int_0^3 [\tan^{-1}(\pi x )-\tan^{-1}( x )] \, dx$ I have to calculate the integral 
$$\int_0^3[\tan^{-1}(\pi x )-\tan^{-1}( x )] \, dx.$$
I dont know why, but I have no idea how to start.
Thanks a lot.
 A: \begin{align}
\int \arctan x \, dx & = \overbrace{\int u\,dx = xu - \int x\,du}^\text{integration by parts} \\[10pt]
& \phantom{{} = \int u\,dx} = x\arctan x - \int x\left( \frac{dx}{1+x^2} \right) \\[10pt]
& \phantom{{}= \int u\,dx} = x\arctan x - \int \frac 1 {1+x^2} \Big( x\,dx\Big) \\[10pt]
&  \phantom{{}= \int u\,dx} = x\arctan x - \int \frac 1 w \Big( \frac 1 2 \, dw\Big) \qquad \text{etc.}
\end{align}
For $\displaystyle\int \arctan(\pi x) \, dx$ just let $v=\pi x$ and go on from there.
A: This is likely overkill, but I will give a solution involving iterated integrals, as the OP does not specify the method. 
First, note the following:
$$\int_{1}^{\pi}\frac{y}{1+(xy)^2}dx=\arctan{y}x\Big]_1^{\pi}=\arctan \pi y-\arctan y$$
Thus, write $$\int_0^3\arctan(\pi x )-\arctan( x ) dx=\int_0^3\int_1^{\pi} \frac{y}{1+(xy)^2}dxdy.$$
To make this integral more tractable, rewrite with variable order $dydx$:
$$\int_0^3\int_1^{\pi} \frac{y}{1+(xy)^2}dxdy=\int_1^{\pi}\int_0^{3} \frac{y}{1+(xy)^2}dydx$$
Use the substitution $u=1+(xy)^2$ for the first integral, giving $$\int_1^{\pi} \frac{\ln(9x^2+1)}{2x^2}dx$$
You will now need integration by parts with $u=\ln(9x^2+1)$ and $dv=\frac{1}{2x^2}$. Use the formula $\int udv= uv-\int vdu$.
I know that this is a more complicated method of solving the problem, and direct application of IBP is more efficient. I sought only to present and alternate solution.
A: 
I'll solve:
$$\int_a^b\arctan(nx)\space\text{d}x$$
Using integration by parts:
$$\int f\space\text{d}g=fg-\int g\space\text{d}f$$


Set $f(x)=\arctan(nx)$ and $\text{d}g=\text{d}x$ and $\text{d}f=\frac{n}{n^2x^+}$ and $g=x$:
$$\int_a^b\arctan(nx)\space\text{d}x=\left[x\arctan(nx)\right]_a^b-\int_a^b\frac{nx}{n^2x^2+1}\space\text{d}x=$$
$$\left[x\arctan(nx)\right]_a^b-n\int_a^b\frac{x}{n^2x^2+1}\space\text{d}x=$$

Substitute $u=n^2x^2+1$ and $\text{d}u=2n^2x\space\text{d}x$.
This gives a new lower bound $u=n^2a^2+1$ and upper bound $u=n^2b^2+1$:

$$\left[x\arctan(nx)\right]_a^b-\frac{1}{2n}\int_{n^2a^2+1}^{n^2b^2+1}\frac{1}{u}\space\text{d}u=$$
$$\left[x\arctan(nx)\right]_a^b-\frac{1}{2n}\left[\ln|u|\right]_{n^2a^2+1}^{n^2b^2+1}=$$
$$\left(b\arctan(nb)-a\arctan(na)\right)-\frac{\ln|n^2b^2+1|-\ln|n^2a^2+1|}{2n}$$
