If you do the long division , you will find that A has to be -3 and B =1 for there to be no remainder.....
x^2 -1 | x^4 + A x^3 +3x - B Give it a try....see if you get the same answer as I did !
x^2 + ax + 1
x^2 - 1 [ x^4 + ax^3 + 0x^2 + 3x - b ]
x^4 - x^2
____________________________________________
ax^3 + x^2 + 3x
ax^3 - ax
__________________________________
x^2 + (3+ a) x
x^2 -1
____________________________
(3 + a)x + ( 1 - b) = 0
If a = -3 and b = 1 we should have no remainder......as EP found !!!