\(=x^3 -3x^2 +3x-1 +x-1\\=(x-1)^3 +(x-1)\\=(x-1)[(x-1)^2 +1]\)
\(x^3-3x^2+4x-2=x^2\left(x-1\right)-2x\left(x-1\right)+2\left(x-1\right)=\left(x-1\right)\left(x^2-2x+2\right)\)
= x3 - x2 - 2x2 + 2x + 2x - 2
= x2(x - 1) - 2x(x - 1) + 2(x - 1)
= (x2 - 2x + 2)(x - 1)