a: \(=\left(x-y+y-z\right)^3-3\left(x-y\right)\left(y-z\right)\left(x-y+y-z\right)+\left(z-x\right)^3\)
\(=-3\left(x-y\right)\left(y-z\right)\left(x-z\right)\)
b: \(=a^2b-a^2c+b^2c-b^2a+c^2\left(a-b\right)\)
\(=ab\left(a-b\right)-c\left(a-b\right)\left(a+b\right)+c^2\left(a-b\right)\)
\(=\left(a-b\right)\left(ab-ca-cb+c^2\right)\)
\(=\left(a-b\right)\left[a\left(b-c\right)-c\left(b-c\right)\right]\)
\(=\left(a-b\right)\left(b-c\right)\left(a-c\right)\)