Solution (source code)

= Solution

The vector $m$ is constant, so $\nabla(m\cdot r)=m$. Also $\nabla(r^{-3})=-3r/r^5$, by the same <chain rule>. The <product rule> therefore yields
$$
\boxed{\nabla\left(\frac{m\cdot r}{r^3}\right)=\frac m{r^3}-\frac{3(m\cdot r)r}{r^5},\qquad r>0.}
$$
The three components follow by differentiating $(\alpha x+\beta y+\gamma z)(x^2+y^2+z^2)^{-3/2}$.