<s>[INST] Factoring a polynomial with possibly repeated root I've been trying to factor $x^3 - 8x^2 + 17x - 4$. One of factors is $x - 4$ so I got $(x - 4)(x^2 -4x + 1)$, but I don't know how to factor the second part $x^2 -4x + 1$. 
I also have a similar problem with $x^3(x^3 - 3x + 2)$. I'm supposed to get $x^3(x - 1)^2 (x + 2)$, but I don't know how to get here. Is there a method to factor repeated roots? 
 [/INST] $$x^2-4x+1=x^2-4x+4-3=(x-2)^2-(\sqrt3)^2=(x-2-\sqrt3)(x-2+\sqrt3)$$
$$x^3-3x+2=x^3-2x^2+x+2x^2-4x+2=(x^2-2x+1)(x+2)=(x-1)^2(x+2)$$
</s>