Solving of an integral $$\int \left(\frac{x^2 + \arctan(x)}{1 + x^2}\right) dx$$
Could anyone help me calculate this integral? Thanks in advance.
 A: Here's another way:
$$\int \left(\frac{x^2 + \arctan(x)}{1 + x^2}\right) dx=\int \left(x^2 + \arctan(x)\right) d(\arctan x)=\\
\left(x^2 + \arctan(x)\right)\arctan x-\int \arctan xd(x^2 + \arctan(x))=\\
\left(x^2 + \arctan(x)\right)\arctan x-\int \arctan xd(x^2)-\int \arctan xd(\arctan(x))=\\
\left(x^2 + \arctan(x)\right)\arctan x-\dfrac{(\arctan x)^2}{2}-\int \arctan xd(x^2)$$
$$\text{Now, }\int \arctan xd(x^2)=x^2\arctan x-\int \dfrac{x^2}{x^2+1}dx$$
$$\text{This gives }\dfrac{(\arctan x)^2}{2}+\int \dfrac{x^2+1-1}{x^2+1}dx=\dfrac{(\arctan x)^2}{2}+x-\arctan x+C\\
\implies \int \left(\frac{x^2 + \arctan(x)}{1 + x^2}\right) dx=\dfrac{(\arctan x)^2}{2}+x-\arctan x+C$$
A: Break the integral in two : 
$$ \int \frac{ x^2 }{x^2 + 1} dx + \int  \frac{ \arctan x }{1 + x^2} dx $$
To solve the second one : Notice $d( \arctan x ) = \frac{ dx}{1 + x^2} $ So
$$ \int \frac{ \arctan x }{1 + x^2} dx = \int \arctan x\, d(\arctan x ) = (\arctan x)^2/2 + K$$
As for the first integral, notice
$$ \int \frac{ x^2}{1 + x^2} = \int \frac{ x^2 + 1 - 1 }{1+x^2} dx = \int dx - \int \frac{ 1}{1 + x^2 } dx = x - \arctan x  $$
