The polynomial remainder theorem says that dividing a polynomial [tex]p(x)[/tex] by [tex]x-c[/tex] leaves a remainder of [tex]p(c)=0[/tex] if [tex]x-c[/tex] is a factor of [tex]p(x)[/tex]. In this case, check [tex]c=-1[/tex] and [tex]c=1[/tex].
[tex]a(-1)^3+(-1)^2-2(-1)+b=-a+b+3=0[/tex]
[tex]a(1)^3+(1)^2-2(1)+b=a+b-1=0[/tex]
From the first equation,
[tex]-a+b+3=0\implies a=b+3[/tex]
and substituting into the second gives
[tex](b+3)+b-1=0\implies2b+2=0\implies b=-1\implies a=2[/tex]