Ok im studying for a maths exam and there is one equation i cant do..

If a factor of P(x)=-7+ax+5x^2+15x^3+bx^4 is (x^2-1) find the values of a and b?

here is the answer i cant work out how to do it any help is appreciated thanks

answer: a= -15 b= 2

thanks Tarik