I know this is a very newbie question, but what is the equivalent of
$\langle x,y,z \rangle$
in spherical coordinates? I'd think it would be
$\langle r, \theta, \phi \rangle$
but the divergences are very different. Is my vector incorrect, or is my calculation of divergence wrong?
As recommended by a comment, here are calculations for divergences:
$$\nabla \cdot \vec r = {\partial \over\partial x}x + {\partial \over\partial y}y + {\partial \over\partial z}z = 3$$ $$\nabla \cdot \vec r = {1\over r^2}{\partial\over\partial r}(r^2 r) + {1\over r\sin\theta}{\partial\over\partial\theta}(\theta\sin\theta) + {1\over r\sin\theta}{\partial \over\partial \phi}\phi = 3 + {\sin\theta + \theta\cos\theta\over r\sin\theta} + {\phi\over r\sin\theta} \neq 3 ??$$
The $\theta$ and $\phi$ components of the position vector $\vec r$ are $0$. That is to write that
$$\hat \theta \cdot \vec r=\hat \phi \cdot \vec r=0$$
Therefore, we have
$$\begin{align} \nabla \cdot \vec r&=\frac{1}{r^2}\frac{\partial r^2(\hat r\cdot \vec r)}{\partial r}\\\\ &+\frac{1}{r\sin \theta}\frac{\partial \sin \theta (\hat \theta \cdot \vec r)}{\partial}\\\\ &+\frac{1}{r\sin \theta}\frac{\partial (\hat \phi \cdot \vec r)}{\partial \phi}\\\\ &=3+0+0\\\\ &=3 \end{align}$$
as expected