X^2-2X-1=0
X^4+X^3-5X^2-7X+5
=X^2(X^2-2X-1)+3X^3-4X^2-7X+5
=3X^3-4X^2-7X+5
=3X(X^2-2X-1)+2X^2-4X+5
=-2X^2-4X+5
=2(X^2-2X-1)+7
=7
X^2-2X-1=0
X^4+X^3-5X^2-7X+5
=X^2(X^2-2X-1)+3X^3-4X^2-7X+5
=3X^3-4X^2-7X+5
=3X(X^2-2X-1)+2X^2-4X+5
=-2X^2-4X+5
=2(X^2-2X-1)+7
=7