Let p(x) = x3 + ax2 -bx+10
x+1 is a factor of p(x), so p(-1) = 0
-1 + a + b + 10 = 0 or a + b + 9 = 0 ... (1)
x+2 is a factor of p(x), so p(-2) = 0
-8 + 4a + 2b + 10 = 0 or 2a + b + 1 = 0 ... (2)
Solve equations (1) and (2) to get the required values of a and b.