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