I want to find the gradient of this potential function \begin{align*} \phi(\mathbf{r}) = \frac{1}{|\mathbf{r} - \mathbf{r_0}|^2}. \end{align*}
First, I wrote it as \begin{align*} \phi(x,y,z) = \frac{1}{(x-x_0) + (y-y_0) + (z-z_0)} , \end{align*} since the square root dissapears because of the square. If I take the partial with respect to $x$, and apply the quotient rule, I get \begin{align*} \frac{-1(x-x_0)'}{[(x-x_0) + (y-y_0) + (z - z_0)]^2}. \end{align*}
But I got a feeling this is not correct. Any help please?
You have $$\phi(x,y,z) = ((x-x_0)^2 + (y - y_0)^2 + (z - z_0)^2)^{-1/2}.$$ Now differentiate. For instance as long as $(x,y,z) \not= (x_0,y_0,z_0)$ then $$ \frac{\partial \phi}{\partial x}(x,y,z) = -\frac 12 ((x-x_0)^2 + (y - y_0)^2 + (z - z_0)^2)^{-3/2} \cdot 2(x - x_0).$$