\(x^3-6x^2-x+30\\=x^3+2x^2-8x^2-16x+15x+30\\=x^2(x+2)-8x(x+2)+15(x+2)\\=(x+2)(x^2-8x+15)\\=(x+2)(x^2-3x-5x+15)\\=(x+2)[x(x-3)-5(x-3)]\\=(x+2)(x-3)(x-5)\\Toru\)
\(x^3-6x^2-x+30\)
\(=x^3-3x^2-3x^2+9x-10x+30\)
\(=x^2\left(x-3\right)-3x\left(x-3\right)-10\left(x-3\right)\)
\(=\left(x^2-3x-10\right)\left(x-3\right)\)
\(=\left(x^2-5x+2x-10\right)\left(x-3\right)\)
\(=\left(x\left(x-5\right)+2\left(x-5\right)\right)\left(x-3\right)\)
\(=\left(x+2\right)\left(x-5\right)\left(x-3\right)\)