Integration of arctan(x) is itself?
You can't take the $x$ out of the first integral on the right side because $x$ is the integration variable and is not a constant. You would have to handle it differently like this: Let $u = 1+x^2$, and can you continue to the finish?
Just so this question can be answered:
You originally did the integration by parts incorrectly:
$u=x,\ \ \ \ \ dv=\frac{1}{1+x^2}dx$
$du=dx,\ \ \ \ \ v=\int\frac{1}{1+x^2}dx$
$$\int\frac{x}{1+x^2}dx=x\int\frac{1}{1+x^2}dx-\int\left(\int\frac{1}{1+x^2}dx \right)dx$$
we have $$\int \frac{x}{1+x^2}dx=\frac{1}{2}\int \frac{2x}{1+x^2}dx$$