\(x^2-x-6=x^2+2x-3x-6=x\left(x+2\right)-3\left(x+2\right)=\left(x-3\right)\left(x+2\right)\)
\(x^3-19x-30=x^3+6x-25x-30=x\left(x^2-25\right)+6x-30=x\left(x^2-25\right)+6\left(x-5\right)\)
\(=x\left(x-5\right)\left(x+5\right)+6\left(x-5\right)=\left(x-5\right)\left[\left(x\right)\left(x+5\right)+6\right]\)