\(x^3-x^{22}-xy^2+y^2\)
\(=x^2\left(x-1\right)-y^2\left(x-1\right)\)
\(=\left(x^2-y^2\right)\left(x-1\right)\)
\(=\left(x-y\right)\left(x+y\right)\left(x-1\right)\)
\(x^3-x^2y-xy^2+y^3\)
\(=\left(x^3-x^2y\right)-\left(xy^2-y^3\right)\)
\(=x^2\left(x-y\right)-y^2\left(x-y\right)\)
\(=\left(x^2-y^2\right)\left(x-y\right)\)
\(=\left(x-y\right)\left(x+y\right)\left(x-y\right)\)
\(=\left(x-y\right)^2.\left(x+y\right)\)