divergence in polar coordinates For a vector field $X$, the divergence in coordinates is given by $\nabla\cdot X=\sum_n\frac{X^i}{\partial x^i}$. In polar coordinates, the metric is $\begin{bmatrix}1 & 0\\ 0 & r^2\end{bmatrix}$, and so $\frac{1}{\sqrt{g(\frac{\partial}{\partial r},\frac{\partial}{\partial r})}}\frac{\partial}{\partial r}=\frac{\partial}{\partial r}$ and $\frac{1}{\sqrt{g(\frac{\partial}{\partial\theta},\frac{\partial}{\partial\theta})}}\frac{\partial}{\partial\theta}=\frac{1}{r}\frac{\partial}{\partial\theta}$ are unit vectors. Then for $X=X_{r}\frac{\partial}{\partial r}+X_{\theta}\frac{\partial}{r\partial\theta}$,  $\nabla\cdot X=\frac{\partial X_r}{\partial r}+\frac{\partial}{\partial\theta}\frac{X_{\theta}}{r}=\frac{\partial X_r}{\partial r}+\frac{1}{r}\frac{\partial X_{\theta}}{\partial\theta}$. But this disagrees with the usual formula given in vector calculus books. Does anyone see the error?
 A: $\DeclareMathOperator\div{div}$The formula for $\nabla\cdot X$ is incorrect. The notation with the 'usual' dot product is misleading. Properly it is:
$$\div F = \frac 1\rho\frac{\partial(\rho F^i)}{\partial x^i}$$
where $\rho=\sqrt{\det g}$ is the coefficient of the differential volume element $dV=\rho\, dx^1\wedge\ldots \wedge dx^n$, meaning $\rho$ is also the Jacobian determinant, and where $F^i$ are the components of $F$ with respect to an unnormalized basis.
In polar coordinates we have $\rho=\sqrt{\det g}=r$, and:
$$\div X = \frac 1r \frac{\partial(r X^r)}{\partial r} 
+ \frac 1r\frac{\partial(r X^\theta)}{\partial \theta}$$
In the usual normalized coordinates $X=\hat X^{r}\frac{\partial}{\partial r} + \hat X^{\theta}\frac 1r\frac{\partial}{\partial\theta}$ this becomes:
$$\div X = \frac 1r \frac{\partial(r \hat X^{r})}{\partial r} 
+ \frac 1r\frac{\partial \hat X^{\theta}}{\partial \theta}$$
which agrees with the usual formula given in calculus books.
A: If you look at equation (114) here https://mathworld.wolfram.com/CylindricalCoordinates.html
you can see that you said is essentially right but you also need to add on the "connection" terms with the Christoffel symbols. Then you simplify and you get the usual formula.
