Code:
................. x^2 + x - 2
.................-----------------------------
x^2 - x + 3 | x^4 + 0x^3 + 0x^2 + 5x + a
............ x^4 - x^3 + 3x^2
..............-----------------------------
....................x^3 - 3x^2 + 5x + a
....................x^3 - x^2 + 3x
....................---------------------
........................- 2x^2 + 2x + a
........................- 2x^2 + 2x - 6
........................----------------
......................................a+6
remainder, a+6 = 0
a = -6