Prove that the gradient of a unit vector equals 2/magnitude of the vector Let $\vec r=(x,y,z)$
Firstly find $\vec \nabla (\frac 1 r)$ where r is the magnitude of $\vec r$.
I think I've done this correctly to get $-x(x^2+y^2+z^2)^{-\frac32} \hat i-y(x^2+y^2+z^2)^{-\frac32} \hat j-z(x^2+y^2+z^2)^{-\frac32} \hat k$
Secondly prove that $\vec \nabla. \frac{\vec r}{r}=\frac2r$
I've really got no idea for the second part.

I'm unsure of the context to this problem for you, but it first came up in my E+M physics class, but I'll try to create a more rigorous proof than I was initially shown.
First we have
$$
\vec{r} = (x,y,z) \implies r = \|r\| = \sqrt{x^2+y^2+z^2} \\
\implies \frac{\vec{r}}{r} = 
\left(\frac{x}{\sqrt{x^2+y^2+z^2}}, \frac{y}{\sqrt{x^2+y^2+z^2}}, \frac{z}{\sqrt{x^2+y^2+z^2}} \right)
$$
Now as you know in cartesian coordinates the divergence is the sum of the partial derivatives of the components with respect to the respective basis vector:
$$
\begin{eqnarray*}
\frac{\partial \frac{\vec{r}}{r}_x}{\partial x} & = & (x^2+y^2+z^2)^{-1 / 2}+x(-1 / 2)(x^2 + y^2 + z^2)^{-3/2}(2x) \\
& = & \frac{1}{\sqrt{x^2+y^2+z^2}} - \frac{x^2}{(x^2+y^2+z^2)^{3/2}} \\
& = & \frac{x^2 + y^2 + z^2}{(x^2+y^2+z^2)^{3/2}} - \frac{x^2}{(x^2+y^2+z^2)^{3/2}} \\
& = & \frac{y^2 + z^2}{r^3}
\end{eqnarray*}
$$
Now when we do the same thing above for $y$ (resp. $z$) we're going to get the same denominator but the numerator will consist of the sum of the components squared except the coordinate we're taking the derivative with respect to since the second term will always get said component squared and thus you'll get cancelation with the first term, so we get*:
$$
\frac{\partial \frac{\vec{r}}{r}_y}{\partial y} = \frac{x^2 + z^2}{r^3} \\
\frac{\partial \frac{\vec{r}}{r}_z}{\partial y} = \frac{x^2 + y^2}{r^3}
$$
thus we get
$$
\begin{eqnarray*}
\vec{\nabla} \cdot \frac{\vec{r}}{r} & = & \frac{y^2 + z^2}{r^3} + \frac{x^2+z^2}{r^3} + \frac{x^2 + y^2}{r^3} \\
& = & \frac{2 \left(x^2 + y^2 + z^2 \right)}{r^3} \\
& = & \frac{2 r^2}{r^3} \\
& = & \frac{2}{r}
\end{eqnarray*}
$$
Let me know if you want me to clarify (*). Note I can put this in some sort of summation notation if that would be easier to understand.
