Riemannian divergence theorem (source code)

= Riemannian divergence theorem
{c}
{title2=$\int_M\operatorname{div}X\,\omega_g=\int_{\partial M}g(X,N)\,\omega_{\widetilde g}$}

On an oriented <Riemannian manifold> with boundary, the <divergence of a Riemannian vector field> obeys the displayed integral identity for smooth <compactly supported> <vector fields> $X$, or for arbitrary smooth $X$ if the manifold is compact. Here $N$ is the outward unit <normal vector> and the boundary has the <outward-normal-first boundary orientation>. Its induced <Riemannian volume form> is $j^*\iota_N\omega_g$. Splitting $X$ into its normal and tangential components gives $j^*\iota_X\omega_g=g(X,N)\omega_{\widetilde g}$, since a top form vanishes on $n$ boundary-tangent arguments. Apply the <Stokes theorem> to $d\iota_X\omega_g=(\operatorname{div}X)\omega_g$.

Without a support or decay condition, flux at infinity can invalidate the result even if the integrals converge. On $[0,\infty)$ with <Riemannian metric> $dx^2$, $X=(\arctan x)\partial_x$ has boundary flux zero but integral of divergence $\pi/2$.