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