x³-11x²+31x-21
=x³-x²-(10x²-10x)+(21x-21)
=x²(x-1)-10x(x-1)+21(x-1)
=(x-1)(x²-10x+21)
=(x-1)(x-3)(x-7)