Hi there!
Solved it:
P(x) = (x-2)2(x+5)
We have a cubic poly. Since it is deg 3.
Using Trebla's explanation, we get the following:
When x = 1,
(a - b)(-1)2 = 6 => (a - b) = 6 --------------------------(Equation 1)
When x = 3,
(3a - b) = 8 ----------------------------(Equation 2)
Now, you have 2 equations, simply solve simultaneously using Eqn (1) and (2).
a = 1, b = -5,