\(P\left(x\right)\) chia \(x-1\) dư 1 \(\Rightarrow P\left(1\right)=1\)
\(P\left(x\right)\) chia \(x^3+1\) dư \(x^2+x+1\Rightarrow P\left(-1\right)=1\)
Do \(\left(x-1\right)\left(x^3+1\right)\) bậc 4 nên phần dư cao nhất sẽ có bậc 3
\(\Rightarrow P\left(x\right)=\left(x-1\right)\left(x^3+1\right)Q\left(x\right)+ax^3+bx^2+cx+d\) (1)
\(\Rightarrow P\left(x\right)=\left(x-1\right)\left(x^3+1\right)Q\left(x\right)+a\left(x^3+1\right)+bx^2+cx+d-a\)
\(\Rightarrow P\left(x\right)=\left(x^3+1\right)\left[\left(x-1\right)Q\left(x\right)+a\right]+bx^2+cx+d-a\)
Do \(P\left(x\right)\) chia \(x^3+1\) dư \(x^2+x+1\)
\(\Rightarrow\left\{{}\begin{matrix}b=1\\c=1\\d-a=1\end{matrix}\right.\)
Từ (1) ta cũng có:
\(P\left(1\right)=a+b+c+d=1\Rightarrow a+d=1-\left(b+c\right)=-1\)
\(\Rightarrow\left\{{}\begin{matrix}d-a=1\\d+a=-1\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}d=0\\a=-1\end{matrix}\right.\)
Vậy phần dư là \(-x^3+x^2+x\)