a, \(\left(x-3\right)\left(x^2+3x+9\right)-x\left(x-3\right)\left(x+3\right)\)
\(=x^3-27-x\left(x^2-9\right)=x^3-27-x^3+9x\)
\(=9x-27=9\left(x-3\right)\)
b, \(\left(x+5\right)\left(x^2-5x+25\right)-\left(x+3\right)^3+\left(x-2\right)\left(x^2+2x+4\right)-\left(x-1\right)^3\)
\(=x^3+125-\left(x^3+9x^2+27x+27\right)+x^3-8-\left(x^3-3x^2+3x-1\right)\)
\(=2x^3+117-x^3-9x^2-27x-27-x^3+3x^2-3x+1\)
\(=-6x^2-30x+91\)
Chúc bạn học tốt!!!