Áp dụng định lý Bezout:
\(P\left(-2\right)=-1\Rightarrow4a-2b+3=-1\Rightarrow4a-2b=-4\)
\(P\left(1\right)=8\Rightarrow a+b+3=8\Rightarrow a+b=5\)
\(\Rightarrow\left\{{}\begin{matrix}4a-2b=-4\\a+b=5\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}a=1\\b=4\end{matrix}\right.\)