Divergence of a Riemannian vector field (source code)

= Divergence of a Riemannian vector field
{title2=$\operatorname{div}_gX=\nabla_iX^i$}

For the <Levi-Civita connection> of a <Riemannian metric>, the divergence of $X$ is $\operatorname{div}_gX=\operatorname{tr}(Y\mapsto\nabla_YX)$. In coordinates it equals $(\det g)^{-1/2}\partial_i((\det g)^{1/2}X^i)$. On an oriented manifold it satisfies $\mathcal L_X\omega_g=(\operatorname{div}_gX)\omega_g$. The <codifferential> on a <one-form> satisfies $\delta\theta=-\operatorname{div}_g(\theta^\sharp)$, where $\sharp$ is the <musical isomorphism>; this follows by <integration by parts> or the <Hodge star> formula.