\(M=\dfrac{x\left(yz-x^2\right)+y\left(zx-y^2\right)+z\left(xy-z^2\right)}{\left(x-y\right)^2+\left(y-z\right)^2+\left(z-x\right)^2}\)
\(=\dfrac{xyz-x^3+xyz-y^3+xyz-z^3}{x^2-2xy+y^2+y^2-2yz+z^2+z^2-2zx+x^2}\)
\(=\dfrac{-\left(x^3+y^3+z^3-3xyz\right)}{2x^2+2y^2+2z^2-2xy-2yz-2zx}\)
\(=\dfrac{-\left(x^3+3x^2y+3xy^2+y^3+z^3-3x^2y-3xy^2-3xyz\right)}{2\left(x^2+y^2+z^2-xy-yz-zx\right)}\)
\(=\dfrac{-\left[\left(x+y\right)^3+z^3-3xy\left(x+y+z\right)\right]}{2\left(x^2+y^2+z^2-xy-yz-zx\right)}\)
\(=\dfrac{-\left\{\left(x+y+z\right)\left[\left(x+y\right)^2-\left(x+y\right)z+z^2\right]-3xy\left(x+y+z\right)\right\}}{2\left(x^2+y^2+z^2-xy-yz-zx\right)}\)
\(=\dfrac{-\left(x+y+z\right)\left(x^2+2xy+y^2-xz-yz+z^2-3xy\right)}{2\left(x^2+y^2+z^2-xy-yz-zx\right)}\)
\(=\dfrac{-\left(x+y+z\right)\left(x^2+y^2+z^2-xy-yz-zx\right)}{2\left(x^2+y^2+z^2-xy-yz-zx\right)}=\dfrac{-x-y-z}{2}\)