Answer
$x^2+\frac{2x^2+7x+5}{(x^2+1)(x-2)}=x^2+\frac{-x-1}{x^2+1}+\frac{3}{x-2}$
Work Step by Step
$\frac{x^5-2x^4+x^3+x+5}{x^3-2x^2+x-2}$, since the degree of the numerator is larger than the degree of the denominator:
$\begin{array}{lllllll}
& & x^{2} & \\
& -- & -- & -- & -- & -- & \\
x^3-2x^2+x-2\ ) & x^5&-2x^{4} & +x^{3} & +x & +5 & \\
& -x^5 & +2x^4 & -x^{3} & +2x^{2} & & & & \\
& -- & -- & & & & \\
& & 2x^{2} & +x+5 & & & \\
\end{array}$
thus, $x^2+\frac{2x^2+7x+5}{x^3-2x^2+x-2}$, factorising the denominator, $x^3-2x^2+x-2=x^2(x-2)+1(x-2)=(x^2+1)(x-2)$,
$x^2+\frac{2x^2+7x+5}{(x^2+1)(x-2)}=\frac{Ax+B}{x^2+1}+\frac{C}{x-2}$,
$(Ax+B)(x-2)+C(x^2+1)$,
$Ax^2-2Ax+Bx-2B+Cx^2+C$,
$(A+C)x^2+(-2A+B)x+(-2B+C)=2x^2+x+5$,
$\begin{cases}
A+C=2\\
-2A+B=1\\
-2B+C=5
\end{cases}$
Multiplying Equation 1 by 2 and adding it to Equation 2.
$\begin{cases}
2A+2C=4\\
-2A+B=1\\
-- -- -- --\\
0A + B + 2C=5
\end{cases}$
Multiplying the addition result of Equation 1&2 by 2 and adding it to Equation 3.
$\begin{cases}
2B+4C=10\\
-2B+C=5\\
-- -- -- --\\
0B + 5C=15
\end{cases}$
thus, $C=3$, substituting back into the equation, $A+3=2, A=-1$.
substituting back into the equation $-2B+3=5, B=-1$
Therefore,
$x^2+\frac{2x^2+7x+5}{(x^2+1)(x-2)}=x^2+\frac{-x-1}{x^2+1}+\frac{3}{x-2}$