\(x^4+5x^3-12x^2+5x+1\)
\(=x^4-x^3+6x^3-6x^2+5x-5x^2+1-x^2\)\(=x^3\left(x-1\right)\)\(+6x^2\left(x-1\right)+5x\left(1-x\right)\)\(+\left(1-x\right)\left(1+x\right)\)
\(=\)\(\left(x-1\right)\left(x^3+6x^2-6x-1\right)\)
=\(\left(x-1\right)[\left(x-1\right)\left(x^2+x+1\right)+6x\left(x-1\right)]\)=\(\left(x-1\right)^2\)\(\left(x^2+7x+1\right)\)