# Jacobi's formula

In matrix calculus, Jacobi's formula expresses the derivative of the determinant of a matrix A in terms of the adjugate of A and the derivative of A.[1]

If A is a differentiable map from the real numbers to n × n matrices,

${\displaystyle {\frac {d}{dt}}\det A(t)=\operatorname {tr} \left(\operatorname {adj} (A(t))\,{\frac {dA(t)}{dt}}\right)~}$

where tr(X) is the trace of the matrix X.

As a special case,

${\displaystyle {\partial \det(A) \over \partial A_{ij}}=\operatorname {adj} ^{\rm {T}}(A)_{ij}.}$

Equivalently, if dA stands for the differential of A, the general formula is

${\displaystyle d\det(A)=\operatorname {tr} (\operatorname {adj} (A)\,dA).}$

It is named after the mathematician Carl Gustav Jacob Jacobi.

## Derivation

### Via Matrix Computation

We first prove a preliminary lemma:

Lemma. Let A and B be a pair of square matrices of the same dimension n. Then

${\displaystyle \sum _{i}\sum _{j}A_{ij}B_{ij}=\operatorname {tr} (A^{\rm {T}}B).}$

Proof. The product AB of the pair of matrices has components

${\displaystyle (AB)_{jk}=\sum _{i}A_{ji}B_{ik}.}$

Replacing the matrix A by its transpose AT is equivalent to permuting the indices of its components:

${\displaystyle (A^{\rm {T}}B)_{jk}=\sum _{i}A_{ij}B_{ik}.}$

The result follows by taking the trace of both sides:

${\displaystyle \operatorname {tr} (A^{\rm {T}}B)=\sum _{j}(A^{\rm {T}}B)_{jj}=\sum _{j}\sum _{i}A_{ij}B_{ij}=\sum _{i}\sum _{j}A_{ij}B_{ij}.\ \square }$

Theorem. (Jacobi's formula) For any differentiable map A from the real numbers to n × n matrices,

${\displaystyle d\det(A)=\operatorname {tr} (\operatorname {adj} (A)\,dA).}$

Proof. Laplace's formula for the determinant of a matrix A can be stated as

${\displaystyle \det(A)=\sum _{j}A_{ij}\operatorname {adj} ^{\rm {T}}(A)_{ij}.}$

Notice that the summation is performed over some arbitrary row i of the matrix.

The determinant of A can be considered to be a function of the elements of A:

${\displaystyle \det(A)=F\,(A_{11},A_{12},\ldots ,A_{21},A_{22},\ldots ,A_{nn})}$

so that, by the chain rule, its differential is

${\displaystyle d\det(A)=\sum _{i}\sum _{j}{\partial F \over \partial A_{ij}}\,dA_{ij}.}$

This summation is performed over all n×n elements of the matrix.

To find ∂F/∂Aij consider that on the right hand side of Laplace's formula, the index i can be chosen at will. (In order to optimize calculations: Any other choice would eventually yield the same result, but it could be much harder). In particular, it can be chosen to match the first index of ∂ / ∂Aij:

${\displaystyle {\partial \det(A) \over \partial A_{ij}}={\partial \sum _{k}A_{ik}\operatorname {adj} ^{\rm {T}}(A)_{ik} \over \partial A_{ij}}=\sum _{k}{\partial (A_{ik}\operatorname {adj} ^{\rm {T}}(A)_{ik}) \over \partial A_{ij}}}$

Thus, by the product rule,

${\displaystyle {\partial \det(A) \over \partial A_{ij}}=\sum _{k}{\partial A_{ik} \over \partial A_{ij}}\operatorname {adj} ^{\rm {T}}(A)_{ik}+\sum _{k}A_{ik}{\partial \operatorname {adj} ^{\rm {T}}(A)_{ik} \over \partial A_{ij}}.}$

Now, if an element of a matrix Aij and a cofactor adjT(A)ik of element Aik lie on the same row (or column), then the cofactor will not be a function of Aij, because the cofactor of Aik is expressed in terms of elements not in its own row (nor column). Thus,

${\displaystyle {\partial \operatorname {adj} ^{\rm {T}}(A)_{ik} \over \partial A_{ij}}=0,}$

so

${\displaystyle {\partial \det(A) \over \partial A_{ij}}=\sum _{k}\operatorname {adj} ^{\rm {T}}(A)_{ik}{\partial A_{ik} \over \partial A_{ij}}.}$

All the elements of A are independent of each other, i.e.

${\displaystyle {\partial A_{ik} \over \partial A_{ij}}=\delta _{jk},}$

where δ is the Kronecker delta, so

${\displaystyle {\partial \det(A) \over \partial A_{ij}}=\sum _{k}\operatorname {adj} ^{\rm {T}}(A)_{ik}\delta _{jk}=\operatorname {adj} ^{\rm {T}}(A)_{ij}.}$

Therefore,

${\displaystyle d(\det(A))=\sum _{i}\sum _{j}\operatorname {adj} ^{\rm {T}}(A)_{ij}\,dA_{ij},}$

and applying the Lemma yields

${\displaystyle d(\det(A))=\operatorname {tr} (\operatorname {adj} (A)\,dA).\ \square }$

### Via Chain Rule

Lemma 1. ${\displaystyle \det '(I)=\mathrm {tr} }$, where ${\displaystyle \det '}$ is the differential of ${\displaystyle \det }$.

This equation means that the differential of ${\displaystyle \det }$, evaluated at the identity matrix, is equal to the trace. The differential ${\displaystyle \det '(I)}$ is a linear operator that maps an n × n matrix to a real number.

Proof. Using the definition of a directional derivative together with one of its basic properties for differentiable functions, we have

${\displaystyle \det '(I)(T)=\nabla _{T}\det(I)=\lim _{\varepsilon \to 0}{\frac {\det(I+\varepsilon T)-\det I}{\varepsilon }}}$

${\displaystyle \det(I+\varepsilon T)}$ is a polynomial in ${\displaystyle \varepsilon }$ of order n. It is closely related to the characteristic polynomial of ${\displaystyle T}$. The constant term (${\displaystyle \varepsilon =0}$) is 1, while the linear term in ${\displaystyle \varepsilon }$ is ${\displaystyle \mathrm {tr} \ T}$.

Lemma 2. For an invertible matrix A, we have: ${\displaystyle \det '(A)(T)=\det A\;\mathrm {tr} (A^{-1}T)}$.

Proof. Consider the following function of X:

${\displaystyle \det X=\det(AA^{-1}X)=(\det A)\ \det(A^{-1}X)}$

We calculate the differential of ${\displaystyle \det X}$ and evaluate it at ${\displaystyle X=A}$ using Lemma 1, the equation above, and the chain rule:

${\displaystyle \det '(A)(T)=\det A\ \det '(I)(A^{-1}T)=\det A\ \mathrm {tr} (A^{-1}T)}$

Theorem. (Jacobi's formula) ${\displaystyle {\frac {d}{dt}}\det A=\mathrm {tr} \left(\mathrm {adj} \ A{\frac {dA}{dt}}\right)}$

Proof. If ${\displaystyle A}$ is invertible, by Lemma 2, with ${\displaystyle T=dA/dt}$

${\displaystyle {\frac {d}{dt}}\det A=\det A\;\mathrm {tr} \left(A^{-1}{\frac {dA}{dt}}\right)=\mathrm {tr} \left(\mathrm {adj} \ A\;{\frac {dA}{dt}}\right)}$

using the equation relating the adjugate of ${\displaystyle A}$ to ${\displaystyle A^{-1}}$. Now, the formula holds for all matrices, since the set of invertible linear matrices is dense in the space of matrices.

## Corollary

The following is a useful relation connecting the trace to the determinant of the associated matrix exponential:

${\displaystyle \det e^{tB}=e^{\operatorname {tr} \left(tB\right)}}$

This statement is clear for diagonal matrices, and a proof of the general claim follows.

For any invertible matrix ${\displaystyle A(t)}$, in the previous section "Via Chain Rule", we showed that

${\displaystyle {\frac {d}{dt}}\det A(t)=\det A(t)\;\operatorname {tr} \left(A(t)^{-1}\,{\frac {d}{dt}}A(t)\right)}$

Considering ${\displaystyle A(t)=\exp(tB)}$ in this equation yields:

${\displaystyle {\frac {d}{dt}}\det e^{tB}=\operatorname {tr} (B)\det e^{tB}}$

The desired result follows as the solution to this ordinary differential equation.

## Applications

Several forms of the formula underlie the Faddeev–LeVerrier algorithm for computing the characteristic polynomial, and explicit applications of the Cayley–Hamilton theorem. For example, starting from the following equation, which was proved above:

${\displaystyle {\frac {d}{dt}}\det A(t)=\det A(t)\ \operatorname {tr} \left(A(t)^{-1}\,{\frac {d}{dt}}A(t)\right)}$

and using ${\displaystyle A(t)=tI-B}$, we get:

${\displaystyle {\frac {d}{dt}}\det(tI-B)=\det(tI-B)\operatorname {tr} [(tI-B)^{-1}]=\operatorname {tr} [\operatorname {adj} (tI-B)]}$