# Not sure how to take gradient operator in spherical coordinates

The orginal problem statement

The electric potential from an elementary electric dipole located at the origin is given by the expression

$\phi$($\vec r$) = $\vec p$ $\cdot$ $\vec r$/4$\pi$$\epsilon_0$$r^3$

where $\vec p$ is the electric dipole moment vector. Show that the corresponding electric field is given by the expression

$\vec E$ = -\nabla$$\phi = \frac{3 (\vec p \cdot \hat r) \hat r - \vec p }{4 \pi \epsilon_0 r^3} where \hat r is the unit vector in the direction of the vector \vec r. I'm not too sure if I wrote the electric field expression correctly so I uploaded a snippet of the question which is on the attachment. So the way I thought to solve it was by replacing \vec r with r \hat r so \vec E = -\frac{\partial \phi}{\partial r}\hat r = -\frac{\partial}{\partial r}(\vec p \cdot \vec r/4\pi$$\epsilon_0$$r^3)\hat r = -\frac{\partial}{\partial r}(\vec p \cdot r \hat r/4\pi$$\epsilon_0r^3)\hat r = \frac{\vec p \cdot \hat r }{2\pi \epsilon_0 r^3}\hat r not sure what I'm doing wrong. I thought maybe since the dot product involves the angle between the two vectors one of the other components of the spherical gradient survive but I'm not sure. ## 1 Answer Let us use the convention \vec{r} = x_1\hat x_1 + x_2\hat x_2+x_3\hat x_3 and r= |\vec{r}|. Consider \begin{align} \psi(\vec{r}) = \vec{p}\cdot\frac{\vec{r}}{r^3} \end{align} then \begin{align} \frac{\partial}{\partial x_i} \psi(\vec{r}) = \sum_{j}p_j\cdot \frac{\partial}{\partial x_i}\left(\frac{x_j}{r^3} \right) = \sum_j p_j\cdot \frac{\delta_{ij}r^2-3x_ix_j}{r^5} = \frac{p_i}{r^3}-3\frac{x_i}{r^4}\sum_jp_j\cdot \frac{x_j}{r}. \end{align} Hence it follows \begin{align} -\nabla\psi(\vec{r}) = \frac{3(\vec{p}\cdot \hat r)}{r^3}\hat r-\frac{1}{r^3}\vec{p}. \end{align} Note: We have use the fact that \begin{align} \frac{\partial}{\partial x_i} r = \frac{\partial}{\partial x_i}\sqrt{x_1^2+x_2^2+x_3^2}= \frac{x_i}{\sqrt{x_1^2+x_2^2+x_3^2}}=\frac{x_i}{r}. \end{align} Also, \delta_{ij} is the Kronecker delta, i.e. \begin{align} \delta_{ij} = \begin{cases} 1 & \text{ if } i = j\\ 0 & \text{ otherwise} \end{cases}. \end{align} • I'm not really familiar with your notation, I'm assuming that \partial_i is a shorthand for \frac{\partial}{\partial_i}. Also, I don't understand that the expression that results from \partial_i\frac{r_j}{r^3}, what is the $\delta_(ij)$ ? – Elvis Feb 3 '17 at 6:46
• Thank you! It seems much clearer to me now. I haven't done vector calculus in a long time so I appreciate the patience. I'm going to try to reproduce what you have done on my own and I'll post again if I get stuck. – Elvis Feb 3 '17 at 6:58
• Ok so I've been able to follow everything, symbolically at least, up until the final result. I understand how the $p_i$ and $x_i$ got into the expression but I don't understand how you turn them into the corresponding vectors at the end. – Elvis Feb 3 '17 at 8:31
• Never mind, I figured it out. Thanks again for the help! – Elvis Feb 3 '17 at 8:59