\(\left(x^2-5x\right)^2-3x^2+15x-18\)
\(=\left(x^2-5x\right)^2-3\left(x^2-5x\right)-18\)
\(=\left(x^2-5x-6\right)\left(x^2-5x+3\right)\)
\(=\left(x^2-5x+3\right)\left(x-6\right)\left(x+1\right)\)
\(=\left(x^2-5x\right)^2-3\left(x^2-5x\right)-18\\ =\left(x^2-5x\right)^2-6\left(x^2-5x\right)+3\left(x^2-5x\right)-18\\ =\left(x^2-5x\right)\left(x^2-5x-6\right)+3\left(x^2-5x-6\right)\\ =\left(x^2-5x+3\right)\left(x^2-5x-6\right)\\ =\left(x-6\right)\left(x+1\right)\left(x^2-5x+3\right)\)
\(=x^4-10x^3+25x^2-3x^2+15x-18=x^4-10x^3+22x^2+15x-18=x^4+x^3-11x^3-11x^2+33x^2+33x-18x-18=x^3\left(x+1\right)-11x^2\left(x+1\right)+33x\left(x+1\right)-18\left(x+1\right)=\left(x+1\right)\left(x^3-11x^2+33x-18\right)=\left(x+1\right)\left(x^3-6x^2-5x^2+30x+3x-18\right)=\left(x+1\right)\left[x^2\left(x-6\right)-5x\left(x-6\right)+3\left(x-6\right)\right]=\left(x+1\right)\left(x-6\right)\left(x^2-5x\right)=\left(x+1\right)\left(x-6\right)x\left(x-5\right)\)