2x^2+7x-1/x^3+x^2-x-1

step 1:

decompose denominator into factors
(x³_x²-x-1)
=x²(x+1)-1(x+1)
=(x²-1)(x+1)
=(x+1)²(x-1)

Now decompose expression into partial fractions:
(Ax+B)/(x+1)² + C/(x-1) = (2x²+7x-1)/(x+1)²(x-1) .....(1)

Now match coefficients of powers of x, namely, x², x and 1.
(Ax+B)(x-1)+C(x+1)²=(2x²+7x-1)
(A+C)x² + (B+2C-A)x + (C-B) = 2x² + 7x-1
=>
A+C=2
B+2C-A=7
C-B=-1
C=2,A=0,B=3
Substitute A, B and C into (1) to get the final solution.
Check that the answer is correct by expanding.