\(=\left(x-y\right)^2-\left(x-y\right)z^3-\left(x-y\right)z^3+z^6\)
\(=\left(x-y\right)\left(x-y-z^3\right)-z^3\left(x-y-z^3\right)\)
\(=\left(x-y-z^3\right)\left(x-y-z^3\right)\)
\(\left(x-y\right)^2-2\left(x-y\right)\cdot z^3+z^6\)
\(=\left(x-y\right)^2-2\left(x-y\right)\cdot z^3+\left(z^3\right)^2\)
\(=\left(x-y+z^3\right)^2\)