Consider the vector $$ \vec{a}=f(r)\hat{r}+r\hat{\theta}+r\hat{\phi} $$ Where $\vec{a}$ is a vector in spherical coordinates and $f(r)$ is a function of $r$.
Let's calculate $\nabla\cdot(\vec{a}\times\vec{r})$, where $\vec{r}$ is the position vector.
$$ \nabla\cdot(\vec{a}\times\vec{r})=\vec{r}\cdot(\nabla\times\vec{a})-\vec{a}\cdot(\nabla\times\vec{r}) $$ $\nabla\times\vec{r}=0$. Thus, by using divergence formula in spherical coordinates, I concluded that $$ \nabla\cdot(\vec{a}\times\vec{r})=r\cot(\theta) $$ But, the same calculation in cartesian coordinates lead to $$ \nabla\cdot(\vec{a}\times\vec{r})=0 $$ Why is this quantity different in these coordinates?

  • $\begingroup$ In your first equation $\vec{a}=f(r)\hat{r}+r\hat{\theta}+r\hat{\phi}$ what is $\hat{r},\hat{\theta},\hat{\phi}$? $\endgroup$
    – Somos
    Aug 28, 2023 at 21:09
  • $\begingroup$ @Somos This page is an excellent refresher or starting reference if you are seeing this notation for the first time. $\endgroup$ Aug 28, 2023 at 21:12
  • $\begingroup$ Your product rule formula is incorrect since there should be a minus sign, but it may not have affected your answer since that term with the sign change vanished. It is hard to tell where you went wrong if you don't post your full calculation in both coordinate systems. $\endgroup$ Aug 28, 2023 at 21:21
  • $\begingroup$ Thanks for telling me, the sign was incorrect. I checked my results with mathematica, they're completely correct. $\endgroup$
    – Ali Rayat
    Aug 28, 2023 at 22:33

1 Answer 1


I think you are using the wrong identity .

$\nabla \cdot (\vec{a} \times \vec{r}) = \frac{\partial }{\partial x_i}(\epsilon_{ijk}a_jr_k)=\epsilon_{ijk}(\partial a_j/\partial x_i)r_k + \epsilon_{ijk} ( \partial r_k/ \partial x_i)a_j= \vec{r}\cdot (\nabla \times \vec{a} )-\vec{a} \cdot (\nabla \times \vec{r}) $

$\nabla \cdot (\vec{a} \times \vec{r}) = \vec{r}\cdot (\nabla \times \vec{a} )-\vec{a} \cdot (\nabla \times \vec{r})$

$\vec{a}=f(r)\hat{r} + r \hat{\theta}+r \hat{\phi}$


$\vec{a}\times \vec{r}= -r^2\hat{\phi}+r^2\hat{\theta}$

$\nabla \cdot \vec{E} = \frac{1}{r^2}\frac{\partial }{\partial r}(r^2 E_r)+ \frac{1}{r \sin \phi }\frac{\partial E_\theta}{\partial \theta}+\frac{1}{r \sin \phi}\frac{\partial }{\partial \phi}(\sin \phi E\phi)$

Since the $r$ component is $0$ and the other components only have radial dependence, the divergence is $0$.

Further $\nabla (r^2/2)=\vec{r}$ and for any scalar $f$, $\nabla \times \nabla f=0$ in any coordinate system.

It follows that $\nabla \times \vec{r}=0. $

$\nabla \times \vec{E} = \frac{1}{r \sin \phi}(\frac{\partial }{\partial \phi }(A_\theta \sin \phi)-\frac{\partial A_\phi}{\partial \theta })\hat{r}+ \frac{1}{r}(\frac{1}{\sin \phi} \frac{\partial A_r}{\partial \theta}-\frac{\partial }{\partial r}(rA_\theta))\hat{\theta}+\frac{1}{r}(\frac{\partial }{\partial r}(rA_\phi)-\frac{A_r}{\partial \phi})\hat{\phi}$

Since the components of $\vec{a}$ are only dependent on $r$, the derivatives for the r-component of the curl are 0, so the r coordinate of the curl is 0.

$\nabla \times \vec{a}= 0 \hat{r} -2\hat{\theta}+2\hat{\phi}$

So $\vec{r} \cdot (\nabla \times \vec{a}) = 0. $

Combining this we have $\nabla \cdot (\vec{a} \times \vec{r})=0$

  • $\begingroup$ I'm completely sure that you're using the wrong formula for divergence in spherical coordinates. please check en.wikipedia.org/wiki/… $\endgroup$
    – Ali Rayat
    Aug 28, 2023 at 22:29
  • $\begingroup$ I first learned about these with $\theta$ and $\phi$ switched, which I think makes more sense intuitively. Keeping that in mind, does my equation otherwise hold? $\endgroup$ Aug 28, 2023 at 23:00
  • $\begingroup$ I guess you omitted the partial derivative of sine function with respect to phi when you were computing the divergence. $\endgroup$
    – Ali Rayat
    Aug 28, 2023 at 23:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .