Gradient of distance vector length Suppose that there is a surface described by:
$\phi(x,y,z)=c$
And suppose that there is a fixed point A:
$\vec{r_A}=(x_A,y_A,z_A)$
Let $\vec r$ be position vector of any point on the surface so that:
$R=|\vec r-\vec r_A|$ 
Show that $\nabla R$ is a unit vector whose direction is along $\vec r-\vec r_A$
I tried to write $z=f(x,y)$ and then calculate what is $\nabla R$ but I got that it has no $z$ component which leads to a contradiction...

By denoting $\vec r = (x,y,z)$ you can write $R = \sqrt{(x-x_A)^2+(y-y_A)^2+(z-z_A)^2}$. Then as $\nabla = (\frac{d}{dx},\frac{d}{dy},\frac{d}{dz})$ I will just do the calculation for the $x$-coordinate, as it is completely analogous for $y,z$: 
$\frac{dR}{dx} = (\frac{1}{2}) R^{-1} 2 (x-x_A) = \frac{x-x_A}{R}$
And by putting all coordinates together that gives you:
$\nabla R = \frac{1}{R} (\vec r - \vec r_a) $ which is just $\vec r - \vec r_a$ divided by its norm and has therefore unit length. 
