Solution (source code)

= Solution

Contract the <Christoffel symbol> formula for the <Levi-Civita connection>. The first and third derivative terms cancel after relabelling their summed indices:
$$
\Gamma^\rho{}_{\rho\mu}=\frac12g^{\rho\sigma}\partial_\mu g_{\rho\sigma}.
$$
The <Jacobi determinant derivative formula> gives $\partial_\mu g=g\,g^{\rho\sigma}\partial_\mu g_{\rho\sigma}$. In a Lorentzian chart $g<0$, and hence $\partial_\mu\sqrt{-g}=\tfrac12\sqrt{-g}\,g^{\rho\sigma}\partial_\mu g_{\rho\sigma}$. Thus \b[the trace is the logarithmic derivative of the volume density]:
$$
\boxed{\Gamma^\rho{}_{\rho\mu}=\frac1{\sqrt{-g}}\partial_\mu\sqrt{-g}.}
$$
In particular, the <covariant divergence formula> for a <vector field> is $\nabla_\mu A^\mu=(-g)^{-1/2}\partial_\mu(\sqrt{-g}A^\mu)$.