a)\(x^2+2xy-6y-9=x^2-9+2y.\left(x-3\right)=\left(x-3\right)\left(x+3\right)+2y.\left(x-3\right)\)
\(=\left(x-3\right).\left(x+3+2y\right)\)
b) \(x^3+x^2-6x=x^3-6x+9+x^2-9\)
\(=x^3+3x^2-3x^2-9x+3x+9+\left(x-3\right)\left(x+3\right)\)
\(=x^2.\left(x+3\right)-3x.\left(x+3\right)+3.\left(x+3\right)+\left(x-3\right).\left(x+3\right)\)
\(=\left(x+3\right).\left(x^2-3x+3+x-3\right)\)
\(=\left(x+3\right).\left(x^2-2x\right)=x.\left(x+3\right).\left(x-2\right)\)
a, \(x^2+2xy-6y-9\)
\(=\left(x^2+2xy+y^2\right)-\left(y^2+6y+9\right)\)
\(=\left(x+y\right)^2-\left(y-3\right)^2\)
\(=\left(x+2y-3\right)\left(x+3\right)\)
b, \(x^3+x^2-6x\)\(=x\left(x^2+3x-2x-6\right)\)
\(=x\left(x+3\right)\left(x-2\right)\)