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