\(x^2-x-12=x^2-x+\frac{1}{4}-\frac{1}{4}-12=\left(x-\frac{1}{2}\right)^2-\frac{49}{4}=\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)\)
x^2-x-12
=x^2-x-16+4
=x^2-16-x+4
=(x-4)(x+4)-(x-4)
=(x-4)(x+3)