I tried searching for how you derive the integral/primitive of $\arctan(x)$, but I can't find any question on S.E with an answer that clearly explains this. I feel that there should be one, since it is rather fundamental knowledge, and it does come up every now and then as part of S.E questions.
So the primitive can be looked up and it should be the following: $$ \int \arctan(x)~dx = x\arctan(x) - \frac{1}{2}\ln(1+x^2) + C $$ How do you get the result?