Ta có: x2 - 1 = (x - 1)(x + 1)
Để f(x) \(⋮\) g(x) thì \(f\left(x\right)⋮\left\{{}\begin{matrix}\left(x-1\right)\left(1\right)\\\left(x+1\right)\left(2\right)\end{matrix}\right.\)
Từ (1) => \(f\left(1\right)=0\Rightarrow-2+a+2b=0\) (*)
Từ (2) => \(f\left(-1\right)=0\Rightarrow4+2b-a=0\) (**)
Trừ (*) cho (**) được:
\(-2+a+2b-4-2b+a=0\)
\(\Rightarrow2a-6=0\)
\(\Rightarrow a=3\)
Khi đó b = \(\dfrac{-1}{2}\).