Divergence of radial vector field in spherical coordinates I know that the formula for the divergence of a vector field in spherical coordinates is
$$
\operatorname{div}\,\vec{F} = \frac 1 {r^2} \frac \partial {\partial r} (r^2 F_r) + \frac 1 {r \sin \theta} \frac{\partial}{\partial \theta} ( F_\theta \sin \theta) + \frac 1{r \sin \theta } \frac {\partial F_\varphi}{\partial \varphi}
$$
I wanted to verify that the divergence of the radial, inverse quadratic field is indeed zero outside the origin. Let
$$
\vec{F}(r,\theta,\varphi)=(F_r,F_\theta,F_\varphi)=(r^{-2},\theta,\varphi)
$$
If I put this into the above formula, I get
$$
\operatorname{div}\,\vec{F} = 0+\frac 1 {r \sin \theta}(\sin\theta-\theta\cos\theta)+\frac 1 {r \sin \theta}=\frac 1 {r \sin \theta}(1+\sin\theta-\theta\cos\theta)
$$
How is this supposed to be zero? What am I doing wrong?
Thanks for your answers.
EDIT: Apparently, as Nick Pavlov commented, I have to use coordinates relative to the basis angles at the respective point for the angles of the vector field.
But I am still puzzled how these relative coordinates would be defined, especially in which directions their angles "turn" for non-radial fields. If these turning directions of the relative angles change with the local basis I suspect the whole coordinate mapping will have non-continuos points.
I am leaving the question open for anybody to clarify on this.
 A: The mapping is still continuous (at least in the spherical to Cartesian direction). You can find these in pretty much any reference on polar coordinates, and I am sure you are aware of them:
$$\tag1
\begin{align}
x &= r \sin\theta\cos\varphi \\
y &= r \sin\theta\sin\varphi \\
z &= r \cos\theta
\end{align}
$$
(The back-transformations are indeed not continuous, but not for the reason you seem to be thinking of - it is simply the topological matter of having to "cut" a circle.)
But yes, the directions of the basis vectors for the polar coordinates are not the same at each point. That's just as it should be - otherwise the coordinate system would not be polar at all. By definition, each basis vector points in the direction such that the corresponding coordinate increases, while the other two are (locally) constant, i.e. stationary. In other words, if I imagine the position vector $\vec r$ itself as a field, then its partial derivatives with respect to each coordinate give me the directions of the basis vectors:
$$
\begin{align}
\hat r &= \partial {\vec r}/\partial r \\
(r)\hat \theta &= \partial {\vec r}/\partial \theta \\
(r\sin\theta)\hat \varphi &= \partial {\vec r}/\partial \varphi
\end{align}
$$
(The extra factors in the latter two are to normalize them.)
If you would like to see what those look like in the (original) Cartesian system, use $\vec r = (x, y, z)$ with the expressions from (1) to get, for example,
$$ \hat r = \frac{\partial}{\partial r}(r \sin\theta\cos\varphi,r \sin\theta\sin\varphi,r \cos\theta) = \left({x\over r}, {y\over r}, {z\over r}\right) = {\vec r\over r}. $$
This clearly points in a different direction for points with different $\theta, \varphi$: in fact, it points always radially out. If you do the same for the other two, you should see that $\hat\theta$ and $\hat \varphi$ point along a meridian and along a parallel, respectively (if you think of the angles as latitude and longitude).
