I've recently come across the Voss-Weyl formula:

$$\operatorname{div}\boldsymbol u=\frac{1}{\sqrt{\left|\det\mathbf{g}\right|}}\partial_i\left(\sqrt{\left|\det\mathbf{g}\right|} ~~u^i\right)$$

For a vector $\boldsymbol{u}$ with components $u^i$ defined WRT the coordinate basis $\{\partial_i\}$. I was looking for a proof of this formula on the internet and came across a video by MathTheBeautiful on YouTube. While the video is pretty good, I have two main issues with it. For starters, the notation is bad and very confusing to follow. Also, the presenter goes about the proof by expanding the right hand side to show that it reduces to just the trace of the covariant derivative of $\boldsymbol u$. But this feels a little backward to me. I would much prefer if we derived it without already knowing it, so to speak. I'd like to see a derivation that *starts* from the definition of divergence as

$$\operatorname{div}\boldsymbol u=(\nabla \boldsymbol u)^i_i=\partial_iu^i+\Gamma^i_{ik}u^k$$

And somehow manipulates this into the desired result. I'd even be happy enough with the special case of a diagonal metric.

I've tried playing around with it myself, but I'm having trouble seeing the connection between the $\Gamma$s and the $\sqrt{|g|}$.

If anyone could give me a good reference, or provide a derivation as an answer, I'd be more than happy.

## Best Answer

So, the only difficult thing is in establishing the relationship between $\Gamma^i_{ik}$ and the metric determinants, but here I'm afraid it's just one of those things which one has to "notice". For now let's follow our nose. Say we're on a pseudo-Riemannian manifold $(M,g)$ and we consider the Levi-Civita connection. In terms of local coordinates $(x^1,\dots, x^n)$, we have \begin{align} \Gamma^{i}_{jk}&=\frac{1}{2}g^{ia}\left(\frac{\partial g_{aj}}{\partial x^k}+\frac{\partial g_{ka}}{\partial x^j}-\frac{\partial g_{jk}}{\partial x^a}\right) \end{align} If we replace $j$ with $i$ and take the sum, then I'm sure you can convince yourself that with a little index juggling, the last two terms will cancel out, and thus \begin{align} \Gamma^i_{ik}&=\frac{1}{2}g^{ia}\frac{\partial g_{ai}}{\partial x^k}\\ &=\frac{1}{2|g|}\frac{\partial |g|}{\partial x^k}=\frac{\partial}{\partial x^k}\log \sqrt{|g|}=\frac{1}{\sqrt{|g|}}\frac{\partial \sqrt{|g|}}{\partial x^k}\tag{$*$} \end{align} In the line $(*)$, I shall shortly justify the first equal sign. The second equal sign should be obvious based on basic properties of the logarithm (the $\frac{1}{2}$ disappears into the square root), and the third equal sign is just a simple chain rule application. Taking this for granted, we can proceed with the formula for the divergence: \begin{align} \text{div}(\mathbf{u})&=\frac{\partial u^i}{\partial x^i}+\Gamma^i_{ik}u^k\\ &=\frac{\partial u^i}{\partial x^i} + \frac{1}{\sqrt{|g|}}\frac{\partial \sqrt{|g|}}{\partial x^k}u^k\\ &=\frac{1}{\sqrt{|g|}}\bigg(\sqrt{|g|}\frac{\partial u^i}{\partial x^i}+ \frac{\partial \sqrt{|g|}}{\partial x^i}u^i\bigg)\\ &=\frac{1}{\sqrt{|g|}}\frac{\partial}{\partial x^i}\left(\sqrt{|g|}\,\,u^i\right), \end{align} which completes the proof of the Voss-Weyl fornmula.

Justifying $(*)$.Let $G$ be the $n\times n$ matrix $\begin{pmatrix}g_{11}&\cdots & g_{1n}\\ \vdots & \ddots & \vdots\\ g_{n1}& \cdots & g_{nn}\end{pmatrix}$. The first thing we note is that \begin{align} g^{ia}\frac{\partial g_{ai}}{\partial x^k}&=\text{trace}(G^{-1}\cdot \frac{\partial G}{\partial x^k}), \end{align} where the $\cdot$ refers to matrix multiplication. At this point, one just has to know that the directional derivative of the determinant is related to the trace of a matrix. Without knowing this, it is next to impossible to continue. Take a look at the second half of this answer of mine for the precise statement and proof (which is mostly a linear algebra fact).

Explicitly, note that if we fix a point $p\in \Bbb{R}^n$ (strictly speaking we should be fixing a point in the image of the chart map $x$) and let $s\in\Bbb{R}$ be small enough, then \begin{align} \det [G(p+se_k)]&=\det\left(G(p)+s\frac{\partial G}{\partial x^k}(p) + \mathcal{O}(s^2)\right)\\ &=\det [G(p)]\cdot\det \left(I + s G(p)^{-1}\cdot \frac{\partial G}{\partial x^k}(p)+ \mathcal{O}(s^2)\right)\\ &= \det[G(p)]\cdot \left(1+ s\cdot \text{trace}\left(G(p)^{-1}\cdot \frac{\partial G}{\partial x^k}(p)\right) + \mathcal{O}(s^2)\right) \end{align} By taking the derivative with respect to $s$, and evaluating at $s=0$ on both sides, we obtain the formula \begin{align} \frac{\partial (\det G)}{\partial x^k}(p)&=\det[G(p)]\cdot \text{trace}\left(G(p)^{-1}\cdot\frac{\partial G}{\partial x^k}(p)\right). \end{align} We can divide both sides by the determinant to obtain \begin{align} \text{trace}\left(G(p)^{-1}\cdot\frac{\partial G}{\partial x^k}(p)\right)&= \frac{1}{\det G(p)}\frac{\partial (\det G)}{\partial x^k}(p)= \frac{1}{|\det G(p)|} \frac{\partial |\det G|}{\partial x^k}(p), \end{align} where in the last equal sign, I was able to insert the absolute values everywhere, because smoothness (hence continuity) of the matrix function $G$ means that in a sufficiently small neighborhood of the point $p$, $\det G$ maintains a constant sign $\sigma\in \{-1,1\}$. Therefore, we are free to multiply and divide by $\sigma$, and also move it inside the derivative (because it is a constant function), thereby giving us the absolute value signs. Since the point $p$ was arbitrary, we have established (up to small notational differences) the claimed formula \begin{align} g^{ia}\frac{\partial g_{ai}}{\partial x^k}=\frac{1}{|g|}\frac{\partial |g|}{\partial x^k}. \end{align}

Extra Ramblings.Btw, if you think closely about what we've just done, you'll also realize the geometric interpretation of the trace. One is often taught that determinants yield the volume spanned by parallelepipeds; so now the trace being a derivative of the determinant, can be regarded as the rate of change of volume of parallelepipeds. In $\Bbb{R}^n$, the divergence at a point $p$ of a vector field $F:U\subset \Bbb{R}^n\to\Bbb{R}^n$ is nothing but the trace of its derivative $DF_p$; i.e $(\text{div}F)(p)=\frac{\partial F^i}{\partial x^i}(p)=\text{trace}(DF_p)$. In this answer, I prove one of the classic formulas for the rate of change of volume of a subset in $\Bbb{R}^n$, under the influence of the flow of a vector field; there you'll see that the divergence pops up (this is one possible "geometric" justification for the term "divergence"). Anyway, my point here is that determinants of the metric, trace, and changes in volumes are all very closely related concepts, which is why one shouldn't be too surprised to see terms such as $\sqrt{|g|}$ appearing in the Voss-Weyl formula for the divergence (in fact, when I first learnt the material, I only saw the Voss-Weyl formula much later than when I learnt about the above relationship between volumes, determinants and trace).