Đặt \(P\left(x\right)=ax^3+bx^2+cx+d\)
\(\left\{{}\begin{matrix}P\left(0\right)=10\\P\left(1\right)=12\\P\left(2\right)=4\\P\left(3\right)=1\end{matrix}\right.\)\(\Rightarrow\left\{{}\begin{matrix}d=10\\a+b+c+d=12\\8a+4b+2c+d=4\\27a+9b+3c+d=1\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}d=10\\a+b+c=2\\8a+4b+2c=-6\\27a+9b+3c=-9\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}a+b+c=2\\9a+5b+3c=-4\\27a+9b+3c=-9\\d=10\end{matrix}\right.\)
( \(a+b+c+8a+4b+2c=9a+5b+3c=2-6=-4\))
\(\Rightarrow\left\{{}\begin{matrix}3a+3b+3c=6\\9a+5b+3c=-4\\18a+4b=-5\\d=10\end{matrix}\right.\)
\(\left(27a+9b+3c-9a-5b-3c=18a+4b=-9+4=-5\right)\)
\(\Rightarrow\left\{{}\begin{matrix}a+b+c=2\left(1\right)\\6a+2b=-10\left(2\right)\\18a+4b=-5\left(3\right)\\d=10\end{matrix}\right.\)
Từ (1), (2) và (3) \(\Rightarrow\left\{{}\begin{matrix}a+b+c=2\\12a+4b=-20\\18a+6b=-30\\18a+4b=-5\end{matrix}\right.\)
\(\Rightarrow\left\{{}\begin{matrix}a+b+c=2\\6a=15\\2b=-25\end{matrix}\right.\Rightarrow\left\{{}\begin{matrix}a=\frac{5}{2}\\b=-\frac{25}{2}\\c=12\end{matrix}\right.\)
Vậy đa thức P(x) cần tìm là \(\frac{5}{2}x^3-\frac{25}{2}x^2+12x+10\)