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