Solution:
We use integration by parts:
∫f(x)g(x)dx=f(x)∫g(x)dx−∫[f′(x)∫g(x)dx]dx
Take tan−1x as the first function and the constant function 1 as the second function.
∫tan−1xdx=tan−1x⋅x−∫1+x21⋅xdx
=xtan−1x−∫1+x2xdx
Put 1+x2=t, so that 2xdx=dt.
∫1+x2xdx=21∫tdt=21log∣t∣=21log(1+x2)
Therefore,
∫tan−1xdx=xtan−1x−21log(1+x2)+C