b)\(x^2\left(y-z\right)+y^2\left(z-x\right)+z^2\left(x-y\right)\)
=\(x^2y-x^2z+y^2z-y^2x+z^2\left(x+y\right)\)
\(=z^2\left(x-y\right)+\left(x^2y-y^2x\right)-\left(x^2z-y^2z\right)\)
=\(z^2\left(x-y\right)+xy\left(x-y\right)-z\left(x^2-y^2\right)\)
\(=z^2\left(x-y\right)+xy\left(x-y\right)-z\left(x-y\right)\left(x+y\right)\)
\(=\left(x-y\right)\left(z^2+xy-zy-zx\right)\)
\(=\left(x-y\right)\left[z\left(z-x\right)-y\left(z-x\right)\right]\)
\(=\left(x-y\right)\left(z-y\right)\left(z-x\right)\)