we can use IBP
#int x arctan(x) \ dx = int \ d/dx(x^2/2) arctan x \ dx#
#= (x^2/2) arctan x - int \ x^2/2 d/dx( arctan x) \ dx#
#= (x^2/2) arctan x - int \ x^2/2 * 1/(x^2 +1) \ dx#
#= (x^2/2) arctan x - 1/2 int \ x^2/(x^2 + 1) \ dx#
#= (x^2/2) arctan x - 1/2 int \ (x^2+1-1)/(x^2 + 1) \ dx#
#= (x^2/2) arctan x - 1/2 int \ 1 -1/(x^2 + 1) \ dx#
#= (x^2/2) arctan x - 1/2 (x - arctan(x)) + C#
#= (arctan x)/2 ( x^2 + 1) - x/2 + C#