\(x^3+2x^2y+xy^2-9x\)
\(=x\left(x^2+2xy+y^2-9\right)\)
\(=x\left[\left(x+y\right)^2-3^2\right]\)
\(=x\left(x+y-3\right)\left(x+y+3\right)\)
\(x^3+2x^2y+xy^2-9x=x\left(x^2+2xy+y^2-9\right)\)
\(=x\left[\left(x+y\right)^2-3^2\right]\)
\(=x\left(x+y+3\right)\left(x+y-3\right)\)