X^3-2X^2-4X+8
=(x^3+8)-(2x^2+4x)
=(x+2)(x^2-2x+4)-2x(x+2)
=(x+2)(x^2-2x-2x+4)
=(x+2)(x^2-4x+4)
=(x+2)(x-2)^2