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