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