x3-3x2-4x+12=(x3-3x2)-(4x-12)=x2(x-3)-4(x-3)=(x-3)(x2-4)=(x-3)(x-2)(x+2)
\(x^3-3x^2-4x+12=\left(x^3-3x^2\right)-\left(4x-12\right)\\ =x^2\left(x-3\right)-4\left(x-3\right)=\left(x-3\right)\left(x^2-4\right)\\ =\left(x-3\right)\left(x-2\right)\left(x+2\right)\)