[Math] Divergence in spherical coordinates problem

differential-geometry

I have this formula for the divergence of a vector field:
$$\nabla_m V^m = \frac{1}{\sqrt{|g|}} \frac{\partial (V^m\sqrt{|g|})}{\partial x^m}$$
The metric tensor in spherical coordinates:
$$ g=\begin{pmatrix}
1 & 0 & 0\\
0 & r^2\sin^2(\theta) & 0\\
0 & 0 & r^2
\end{pmatrix} $$
$$\sqrt{|g|}=r^2\sin(\theta)$$
So the divergence in spherical coordinates should be:
$$\nabla_m V^m =\frac{1}{r^2\sin(\theta)}\frac{\partial}{\partial r}(r^2\sin(\theta)V^r)+\frac{1}{r^2\sin(\theta)}\frac{\partial}{\partial \phi}(r^2\sin(\theta)V^\phi)+\frac{1}{r^2\sin(\theta)}\frac{\partial}{\partial \theta}(r^2\sin(\theta)V^\theta)$$
Some things simplify:
$$\nabla_m V^m =\frac{1}{r^2}\frac{\partial}{\partial r}(r^2V^r)+\frac{\partial V^\phi}{\partial \phi}+\frac{1}{\sin(\theta)}\frac{\partial}{\partial \theta}(\sin(\theta)V^\theta)$$

What am I doing wrong??

Best Answer

Let $\pmb{e}_{\mu}$ be an arbitrary basis for three-dimensional Euclidean space. The metric tensor is then $\pmb{e}_{\mu}\cdot\pmb{e}_{\nu}=g_{\mu\nu}$ and if $\pmb V$ is a vector then $\pmb V=V^{\mu}\pmb{e}_{\mu}$ where $V^{\mu}$ are the contravariant components of the vector $\pmb V$.

Let's choose the basis such that $$ \pmb{e}_{\mu}\cdot\pmb{e}_{\nu}=g_{\mu\nu}=\begin{pmatrix} 1 & 0 & 0\\ 0 & r^2\sin^2\theta & 0\\ 0 & 0 & r^2 \end{pmatrix}=\begin{pmatrix} g_{rr} & 0 & 0\\ 0 & g_{\phi\phi} & 0\\ 0 & 0 & g_{\theta\theta} \end{pmatrix} $$ with determinant $g=r^4\sin^2\theta$. This leads to the spherical coordinates system $$ x^{\mu}=(r,\phi \,r\sin\theta,\theta \,r)=\sqrt{g_{\mu\mu}}\hat{x}^{\mu} $$ where $\hat{x}^{\mu}=(r,\phi,\theta)$.

So the divergence of a vector field $\pmb V=V^{\mu}\pmb{e}_{\mu}$ is $$ \nabla\cdot\pmb V=\frac{1}{\sqrt g}\frac{\partial}{\partial x^{\mu}}\left(\sqrt{g} V^{\mu}\right)=\frac{1}{\sqrt g}\frac{\partial}{\partial \hat x^{\mu}}\left(\sqrt{g} \frac{V^{\mu}}{\sqrt{g_{\mu\mu}}}\right) $$ that is $$ \begin{align} \nabla\cdot\pmb V&=\frac{1}{r^2\sin\theta}\left[\frac{\partial}{\partial r}\left(r^2\sin\theta\, V^{r}\right)+\frac{\partial}{\partial (\phi\,r\sin\theta)}\left(r^2\sin\theta\, V^{\phi}\right)+\frac{\partial}{\partial (\theta\,r)}\left(r^2\sin\theta\, V^{\theta}\right)\right]\\ &=\frac{1}{r^2\sin\theta}\left[\frac{\partial}{\partial r}\left(r^2\sin\theta\, \frac{V^{r}}{1}\right)+\frac{\partial}{\partial \phi}\left(r^2\sin\theta\, \frac{V^{\phi}}{r\sin\theta}\right)+\frac{\partial}{\partial \theta}\left(r^2\sin\theta\, \frac{V^{\theta}}{r}\right)\right]\\ &=\frac{1}{r^2}\frac{\partial \left(r^2 V^{r}\right)}{\partial r}+\frac{1}{r\sin\theta}\frac{\partial V^{\phi}}{\partial \phi}+\frac{1}{r\sin\theta}\frac{\partial \left(V^{\theta}\sin\theta \right)}{\partial \theta} \end{align} $$ Note that the divergence of a contravariant vector $V^\mu$ is given by $$ \nabla\cdot\pmb V=\nabla_\mu V^\mu $$ where $\nabla_\mu$ is the covariant derivative.

Related Question