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