Answer
$\frac{5}{x^2+1}+\frac{2x-5}{ x^2+x+2}$
Work Step by Step
Step 1. As the denominator can not be further factorized, assume the end results as: $\frac{Ax+B}{x^2+1}+\frac{Cx+D}{ x^2+x+2}$
Step 2. Combine the above functions as:
$\frac{(Ax+B)(x^2+x+2)+(Cx+D)(x^2+1)}{(x^2+1)(x^2+x+2)}=\frac{(A+C)x^3+(A+B+D)x^2+(2A+B+C)x+(2B+D)}{(x^2+1)(x^2+x+2)}$
Step 3. Compare the above result with the original expression to set up the following system of equations:
\begin{cases} A+C=2 \\ A+B+D=0\\2A+B+C=7\\2B+D=5 \end{cases}
Step 4. Use substitution $C=2-A, D=5-2B$ to get:
\begin{cases} A-B+5=0\\A+B=5 \end{cases}
Step 5. Solve the above equations to get $A=0,B=5,C=2,D=-5,$ and write the final results as:
$\frac{5}{x^2+1}+\frac{2x-5}{ x^2+x+2}$