\(P\left(x\right)=x^5+x^4-4x^3+x^2-x-2\)
\(=x^5-x^4-x^3+2x^4-2x^3-2x^2-x^3+x^2+x+2x^2-2x-2\)
\(=\left(x^2-x-1\right)\left(x^3+2x^2-x+2\right)\)
\(P\left(x\right)=0\Leftrightarrow\left(x^2-x-1\right)\left(x^3+2x^2-x+2\right)=0\)
\(\Leftrightarrow\orbr{\begin{cases}x^2-x-1=0\left(1\right)\\x^3+2x^2-x+2=0\end{cases}}\)
Giải \(\left(1\right)\): \(x^2-x-1=0\Leftrightarrow x^2-x+\frac{1}{4}=\frac{5}{4}\Leftrightarrow\left(x-\frac{1}{2}\right)^2=\frac{5}{4}\)
\(\Leftrightarrow\orbr{\begin{cases}x_1=\frac{1+\sqrt{5}}{2}\\x_2=\frac{1-\sqrt{5}}{2}\end{cases}}\)
Ta thấy \(x_1+x_2=1\)do đó đây là hai nghiệm \(a,b\)thỏa mãn.
\(ab=x_1x_2=\frac{\left(1+\sqrt{5}\right)\left(1-\sqrt{5}\right)}{2.2}=-1\).