$$\dfrac{x^4-1+2x}{(x^2+1)^3}=\dfrac{x^2-1}{(x^2+1)^2}+\dfrac{2x}{(x^2+1)^3}$$
For the second integral choose $x^2+1=y$
$$\dfrac{x^2-1}{(x^2+1)^2}=\dfrac{1-\dfrac1{x^2}}{\left(x+\dfrac1x\right)^2}$$
$\displaystyle\int\left(1-\dfrac1{x^2}\right)dx=?$
A rational function $P(x)/Q(x)$ can be rewritten using Partial Fraction Decomposition:
$$
\frac{P(x)}{Q(x)} = \frac{A_1}{a\,x + b} + \dots + \frac{A_2\,x + B_2}{a\,x^2 + b\,x + c} + \dots
$$
where for each factor of $Q(x)$ of the form $(a\,x + b)^m$ introduce terms:
$$
\frac{A_1}{a\,x + b} + \frac{A_2}{(a\,x + b)^2} + \dots + \frac{A_m}{(a\,x + b)^m}
$$
and for each factor of $Q(x)$ of the form $\left(a\,x^2 + b\,x + c\right)^m$ introduce terms:
$$
\frac{A_1\,x + B_1}{a\,x^2 + b\,x + c} + \frac{A_2\,x + B_2}{\left(a\,x^2 + b\,x + c\right)^2} + \dots + \frac{A_m\,x + B_m}{\left(a\,x^2 + b\,x + c\right)^m}\,.
$$
In light of all this, you have:
$$
\frac{1}{x^3\left(x^2+1\right)} = \frac{A_1}{x} + \frac{A_2}{x^2} + \frac{A_3}{x^3} + \frac{A_4\,x + B_4}{x^2 + 1}
$$
i.e.
$$
\frac{1}{x^3\left(x^2+1\right)} = \frac{\left(A_1 + A_4\right)x^4 + \left(A_2 + B_4\right)x^3 + \left(A_1 + A_3\right)x^2 + A_2\,x + A_3}{x^3\left(x^2+1\right)}
$$
which turns out to be an identity if and only if:
$$
\begin{cases}
A_1 + A_4 = 0 \\
A_2 + B_4 = 0 \\
A_1 + A_3 = 0 \\
A_2 = 0 \\
A_3 = 1
\end{cases}
\; \; \; \; \; \;
\Leftrightarrow
\; \; \; \; \; \;
\begin{cases}
A_1 = -1 \\
A_2 = 0 \\
A_3 = 1 \\
A_4 = 1 \\
B_4 = 0
\end{cases}
$$
from which what you want:
$$
\frac{1}{x^3\left(x^2+1\right)} = -\frac{1}{x} + \frac{1}{x^3} + \frac{x}{x^2+1}\,.
$$
Best Answer
Actually, since the degree of the numerator is not smaller than the degree of the denominator, your first step should be to write $x^5$ as$$(x+2)\times\bigl((x-1)^2(x^2-1)\bigr)+4x^3-2x^2-3x+2.$$So$$\frac{x^5}{(x-1)^2(x^2-1)}=x+2+\frac{4x^3-2x^2-3 x+2}{(x-1)^2(x^2-1)}.$$On the other hand,$$x^2-1=(x-1)(x+1)\implies(x-1)^2(x^2-1)=(x-1)^3(x+1)$$and therefore you should try to get $A$, $B$, $C$ and $D$ such that$$\frac{4x^3-2x^2-3 x+2}{(x-1)^2(x^2-1)}=\frac A{x-1}+\frac B{(x-1)^2}+\frac C{(x-1)^3}+\frac D{x+1}.$$