I got different answer of $~\int \frac{1}{(x^2+1)^2}\mathrm{dx}$ $$\begin{align}
&\int {1 \over (x^2+1)^2 } \mathrm{dx} ~~ \leftarrow~~ \text{I assume}~~x\ne0 ~~ \text{since it is trivial as it is held}  \\
&=\int {x^2+1-x^2 \over (x^2+1)^2 } \mathrm{dx}\\
&=\int \left\{ {(x^2+1) \over (x^2+1)^2 }- {x^2 \over (x^2+1)^2 } \right\} \mathrm{dx}  \\&=
\int {1 \over (x^2+1) } \mathrm{dx}- \int {x^2 \over (x^2+1)^2 } \mathrm{dx}\\&=
\arctan(x)+\mathrm{const_1}-\int x^2 (x^2+1)^{-2}  \mathrm{dx} \\&=
\arctan(x)+ \mathrm{const_1}-\left\{ x^2\cdot {(-1)(x^2+1)^{-1} \over 2x } - \int (2x) \cdot {(-1)(x^2+1)^{-1} \over 2x } \mathrm{dx} \right\}\\&=\arctan(x)+ \mathrm{const_1} - \left\{ -{1 \over 2 }x {1 \over (x^2+1) }+\int {1 \over (x^2+1)   }  \mathrm{dx} \right\} \\&=\arctan(x)+ \mathrm{const_1}+ {x \over 2 (x^2+1) }-\int {1 \over x^2+1 } \mathrm{dx}\\&=
\arctan(x)+ \mathrm{const_1}+ {x \over 2(x^2+1) }- \left(\arctan(x)+ \mathrm{const_2} \right) \\&={x \over 2(x^2+1) }+ \underbrace{\mathrm{const_3} }_{ \mathrm{const_1}-\mathrm{const2} }  \end{align}$$
But the answer in the book(A First Course in Calculus by Serge Lang) says the correct form is
$$ \int {1 \over (x^2+1)^2 } \mathrm{dx}=  \underbrace{\color{fuchsia}{{x \over 2(x^2+1) } + {1 \over 2 }\arctan(x)}}_{\text{I assume  arbitrary const ommited} }    $$
Where I've made mistake(s)?
ADD
I am currently in outside so I will to be late to respond.

When you applied by-parts on $x^2(x^2+1)^{-2}$, you (wrongly) wrote the antiderivative of $(x^2+1)^{-2}$ as $\dfrac{(-1)(x^2+1)^{-1}}{2x}$ which is wrong. The correct one is, well, what you want to find in the first place.

You may want to (and should) try this with a different way. I'm putting a hint here if you're stuck:

 which substitution does $1+x^2$ remind you of

Hope this helps. :)
