2(x-y)2 -y(x-y)2 +xy2-x2y= 2(x-y)2-y(x-y)2+(xy^2-x^2y)=2(x-y)2-y(x-y)2+xy(x-y)=(x-y)\(\left[2\left(x-y\right)-y\left(x-y\right)+xy\right]\)=(x-y)(2x-2y-xy+y2+xy)=(x-y)(2x-2y+y2)
\(2\left(x-y\right)^2-y\left(x-y\right)^2+xy^2-x^2y\)
\(=\left(x-y\right)^2\left(2-y\right)+xy\left(y-x\right)\)
\(=\left(x-y\right)^2\cdot\left(2-y\right)-xy\left(x-y\right)\)
\(=\left(x-y\right)\left[\left(x-y\right)\left(2-y\right)-xy\right]\)