\(a,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(yx+y-z\right)\)
\(b,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)\)