The Derivative of a Determinant
When discussing integration in curvilinear coordinate systems, a determinant almost always shows up, serving as the factor for the "volume element". In general relativity, the action of the Einstein field equations involves the determinant of the metric, and naturally, when varying it, one runs into the problem of differentiating a determinant. I looked into this by consulting Landau's Classical Theory of Fields as well as Foundations of Mathematical Physics — An Introduction to the Linear Advanced Mathematics Needed in Physics, and having learned the relevant results, I record them here.
Derivation
Let
\begin{equation}\boldsymbol{A}(t)=\left(a_{ij}(t)\right)_{n\times n}\end{equation}
be an n-th order matrix, each of whose entries is a function of t. Its determinant is $|\boldsymbol{A}|$, and naturally we consider
\begin{equation}\frac{d}{dt}|\boldsymbol{A}|\end{equation}more
By the basic properties of determinants, we have
\begin{equation}|\boldsymbol{A}(a_{ij}+\varepsilon)|-|\boldsymbol{A}|=\varepsilon A_{ij}\end{equation}
where $|\boldsymbol{A}(a_{ij}+\varepsilon)|$ is the value of the determinant obtained by replacing $a_{ij}$ in the matrix $\boldsymbol{A}$ with $a_{ij}+\varepsilon$, and $A_{ij}$ is the cofactor of the determinant $|\boldsymbol{A}|$ with respect to $a_{ij}$. The above gives
\begin{equation}\frac{\partial |\boldsymbol{A}|}{\partial a_{ij}}= A_{ij}\end{equation}
That is to say, the cofactor can be expressed as the partial derivative of the determinant.
Then
\begin{equation}\frac{d}{dt}|\boldsymbol{A}|=\sum_{i}\sum_{j}\frac{\partial |\boldsymbol{A}|}{\partial a_{ij}}\frac{d a_{ij}}{dt}=\sum_{i}\sum_{j} A_{ij}\frac{d a_{ij}}{dt}\end{equation}
(To arrive at the first equality, it suffices to add an infinitesimal increment to every entry of the matrix $\boldsymbol{A}$, then expand the determinant of the incremented matrix, keeping only first-order infinitesimal terms.)
Hence
\begin{equation}\frac{d}{dt}|\boldsymbol{A}|=|\boldsymbol{A}|\sum_{i}\sum_{j} \frac{A_{ij}}{|\boldsymbol{A}|}\frac{d a_{ij}}{dt}\end{equation}
It might help to rewrite this so the process becomes clearer
\begin{equation}\frac{d}{dt}|\boldsymbol{A}|=|\boldsymbol{A}|\sum_{j=k}\sum_{i} \frac{A_{ij}}{|\boldsymbol{A}|}\frac{d a_{ik}}{dt}\end{equation}
where
\begin{equation}\frac{A_{ji}}{|\boldsymbol{A}|}\end{equation}
is exactly the $(i,j)$-th entry $(\boldsymbol{A}^{-1})_{ij}$ of the inverse matrix $\boldsymbol{A}^{-1}$ of $\boldsymbol{A}$, and $\frac{d a_{ij}}{dt}$ is an entry of the matrix $\frac{d \boldsymbol{A}}{dt}$. The first summation is simply the product of the two matrices, giving
\begin{equation}\left(\boldsymbol{A}^{-1}\frac{d \boldsymbol{A}}{dt}\right)_{jk}=\sum_{i} (\boldsymbol{A}^{-1})_{ji}\left(\frac{d\boldsymbol{A}}{dt}\right)_{ik}=\sum_{i} \frac{A_{ij}}{|\boldsymbol{A}|}\frac{d a_{ik}}{dt}\end{equation}
while the second summation amounts to taking the trace of the matrix, so
\begin{equation}\frac{d}{dt}|\boldsymbol{A}|=|\boldsymbol{A}| \text{Tr}\left(\boldsymbol{A}^{-1}\frac{d \boldsymbol{A}}{dt}\right)\end{equation}
In the notation of tensor analysis, this becomes even simpler: writing $g=\det(g_{\mu\nu}),g_{\mu s} g^{s\nu}=\delta_{\mu}^{\nu}$, we have
\begin{equation}dg=g g^{\mu\nu} dg_{\mu\nu}\end{equation}
Example
As a simple application, let's compute
\begin{equation}\frac{d}{dt}|\boldsymbol{I}+t\boldsymbol{A}|\end{equation}
where $\boldsymbol{I}$ is the identity matrix, and $\boldsymbol{A}$ is a square matrix of the same size. Substituting into the formula gives
\begin{equation}\frac{d}{dt}|\boldsymbol{I}+t\boldsymbol{A}|=|\boldsymbol{I}+t\boldsymbol{A}|\text{Tr}\big[(\boldsymbol{I}+t\boldsymbol{A})^{-1}\boldsymbol{A}\big]\end{equation}
Then
\begin{equation}\left(\frac{d}{dt}|\boldsymbol{I}+t\boldsymbol{A}|\right)_{t=0}=\text{Tr}\,\boldsymbol{A}\end{equation}
So according to the Taylor expansion, when $|t|$ is sufficiently small, we have the approximation
\begin{equation}|\boldsymbol{I}+t\boldsymbol{A}|\approx 1 + t\times\text{Tr}\,\boldsymbol{A}\end{equation}
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.