(If P(x) is linear, then you can't divide by [MATH](x-1)(x+2)[/MATH] and get a remainder, so we'll assume they meant to say that P(x) is at least quadratic).
[MATH]P(x)=(x-1)(x+2)Q(x)+R(x) \quad[/MATH] (1)
where R(x) is [MATH]ax+b[/MATH](Note you are dividing by a quadratic, so the remainder may be linear).
Now substitute [MATH]x=1[/MATH] and [MATH] x=-2[/MATH] into equation (1) and use the facts that you know: [MATH]P(1)=1[/MATH] and [MATH] P(-2)=-8[/MATH], to find [MATH]a[/MATH] and [MATH]b[/MATH].