-Đặt \(t=\left(x^2-x+1\right)\)
\(\left(x^2-x+1\right)^2-5x\left(x^2-x+1\right)+4x^2\)
\(=t^2-5xt+4x^2\)
\(=t^2-4xt-xt+4x^2\)
\(=t\left(t-4x\right)-x\left(t-4x\right)\)
\(=\left(t-4x\right)\left(t-x\right)\)
\(=\left(x^2-x+1-4x\right)\left(x^2-x+1-x\right)\)
\(=\left(x^2-5x+1\right)\left(x^2-2x +1\right)\)
\(=\left(x^2-5x+1\right)\left(x-1\right)^2\)