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