Solution
= Solution
Away from the origin, differentiate $r^2=x_jx_j$ using <Einstein notation>:
$$
2r\,\partial_i r=2x_i.
$$
Hence
$$
\boxed{\partial_i r=x_i/r,\qquad \nabla r=\mathbf x/r.}
$$
This <gradient> is the radial unit <vector>. Division by $r$ is legitimate on the punctured domain; the distance <function> is not differentiable at the origin.