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