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