# Jacobi's formula

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Jacobi's_formula
> Markdown URL: https://mediated.wiki/source/Jacobi's_formula.md
> Source: https://en.wikipedia.org/wiki/Jacobi's_formula
> Source revision: 1356757708
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Formula for the derivative of a matrix determinant

In [matrix calculus](/source/Matrix_calculus), **Jacobi's formula** expresses the [derivative](/source/Derivative) of the [determinant](/source/Determinant) of a matrix *A* in terms of the [adjugate](/source/Adjugate) of *A* and the derivative of *A*.[1]

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

- d d t det A ( t ) = tr ⁡ ( adj ⁡ ( A ( t ) ) d A ( t ) d t ) = ( det A ( t ) ) ⋅ tr ⁡ ( A ( t ) − 1 ⋅ d A ( t ) d t ) {\displaystyle {\frac {d}{dt}}\det A(t)=\operatorname {tr} \left(\operatorname {adj} (A(t))\,{\frac {dA(t)}{dt}}\right)=\left(\det A(t)\right)\cdot \operatorname {tr} \left(A(t)^{-1}\cdot \,{\frac {dA(t)}{dt}}\right)}

where tr(*X*) is the [trace](/source/Trace_(linear_algebra)) of the matrix X and adj ⁡ ( X ) {\displaystyle \operatorname {adj} (X)} is its [adjugate matrix](/source/Adjugate_matrix). (The latter equality only holds if *A*(*t*) is [invertible](/source/Invertible_matrix).)

As a special case,

- ∂ det ( A ) ∂ A i j = adj ⁡ ( A ) j i = adj ⁡ ( A ) i j T . {\displaystyle {\partial \det(A) \over \partial A_{ij}}=\operatorname {adj} (A)_{ji}=\operatorname {adj} (A)_{ij}^{T}.}

Equivalently, if *dA* stands for the [differential](/source/Differential_(infinitesimal)) of A, the general formula is

- d det ( A ) = tr ⁡ ( adj ⁡ ( A ) d A ) = det ( A ) tr ⁡ ( A − 1 d A ) {\displaystyle d\det(A)=\operatorname {tr} (\operatorname {adj} (A)\,dA)=\det(A)\operatorname {tr} \left(A^{-1}dA\right)}

The formula is named after the mathematician [Carl Jacobi](/source/Carl_Gustav_Jacob_Jacobi).

## Derivation

### Via matrix computation

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

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

*Proof.* [Laplace's formula](/source/Laplace_expansion) for the determinant of a matrix *A* can be stated as

- det ( A ) = ∑ j A i j adj T ⁡ ( A ) i j . {\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*:

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

so that, by the [chain rule](/source/Chain_rule), its differential is

- d det ( A ) = ∑ i ∑ j ∂ F ∂ A i j d A i j . {\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*/∂*A**ij* 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 ∂ / ∂*A**ij*:

- ∂ det ( A ) ∂ A i j = ∂ ∑ k A i k adj T ⁡ ( A ) i k ∂ A i j = ∑ k ∂ ( A i k adj T ⁡ ( A ) i k ) ∂ A i j {\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](/source/Product_rule),

- ∂ det ( A ) ∂ A i j = ∑ k ∂ A i k ∂ A i j adj T ⁡ ( A ) i k + ∑ k A i k ∂ adj T ⁡ ( A ) i k ∂ A i j . {\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 *A**ij* and a [cofactor](/source/Minor_(linear_algebra)) adjT(*A*)*ik* of element *A**ik* lie on the same row (or column), then the cofactor will not be a function of *Aij*, because the cofactor of *A**ik* is expressed in terms of elements not in its own row (nor column). Thus,

- ∂ adj T ⁡ ( A ) i k ∂ A i j = 0 , {\displaystyle {\partial \operatorname {adj} ^{\rm {T}}(A)_{ik} \over \partial A_{ij}}=0,}

so

- ∂ det ( A ) ∂ A i j = ∑ k adj T ⁡ ( A ) i k ∂ A i k ∂ A i j . {\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.

- ∂ A i k ∂ A i j = δ j k , {\displaystyle {\partial A_{ik} \over \partial A_{ij}}=\delta _{jk},}

where *δ* is the [Kronecker delta](/source/Kronecker_delta), so

- ∂ det ( A ) ∂ A i j = ∑ k adj T ⁡ ( A ) i k δ j k = adj T ⁡ ( A ) i j . {\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,

- d ( det ( A ) ) = ∑ i ∑ j adj T ⁡ ( A ) i j d A i j = ∑ j ∑ i adj ⁡ ( A ) j i d A i j = ∑ j ( adj ⁡ ( A ) d A ) j j = tr ⁡ ( adj ⁡ ( A ) d A ) . ◻ {\displaystyle d(\det(A))=\sum _{i}\sum _{j}\operatorname {adj} ^{\rm {T}}(A)_{ij}\,dA_{ij}=\sum _{j}\sum _{i}\operatorname {adj} (A)_{ji}\,dA_{ij}=\sum _{j}(\operatorname {adj} (A)\,dA)_{jj}=\operatorname {tr} (\operatorname {adj} (A)\,dA).\ \square }

### Via chain rule

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

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

*Proof.* Using the definition of a [directional derivative](/source/Directional_derivative) together with one of its basic properties for differentiable functions, we have

- det ′ ( I ) ( T ) = ∇ T det ( I ) = lim ε → 0 det ( I + ε T ) − det I ε {\displaystyle \det '(I)(T)=\nabla _{T}\det(I)=\lim _{\varepsilon \to 0}{\frac {\det(I+\varepsilon T)-\det I}{\varepsilon }}}

det ( I + ε T ) {\displaystyle \det(I+\varepsilon T)} is a polynomial in ε {\displaystyle \varepsilon } of order *n*. It is closely related to the [characteristic polynomial](/source/Characteristic_polynomial) of T {\displaystyle T} . The [constant term](/source/Constant_term) in that polynomial (the term with ε = 0 {\displaystyle \varepsilon =0} ) is 1, while the linear term in ε {\displaystyle \varepsilon } is t r T {\displaystyle \mathrm {tr} \ T} . Therefore the limit equals t r T {\displaystyle \mathrm {tr} \ T} which is the claim.

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

*Proof.* Consider the following function of *X*:

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

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

- det ′ ( A ) ( T ) = det A det ′ ( I ) ( A − 1 T ) = det A t r ( A − 1 T ) {\displaystyle \det '(A)(T)=\det A\ \det '(I)(A^{-1}T)=\det A\ \mathrm {tr} (A^{-1}T)}

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

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

- d d t det A = det A t r ( A − 1 d A d t ) = t r ( a d j A d A d t ) {\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](/source/Adjugate) of A {\displaystyle A} to A − 1 {\displaystyle A^{-1}} . Now, the formula holds for all matrices, since the set of invertible linear matrices is dense in the space of matrices.

### Via diagonalization

Both sides of the Jacobi formula are polynomials in the matrix coefficients of A and A'. It is therefore sufficient to verify the polynomial identity on the dense subset where the eigenvalues of A are distinct and nonzero.

If A factors differentiably as A = B C {\displaystyle A=BC} , then

- t r ( A − 1 A ′ ) = t r ( ( B C ) − 1 ( B C ) ′ ) = t r ( B − 1 B ′ ) + t r ( C − 1 C ′ ) . {\displaystyle \mathrm {tr} (A^{-1}A')=\mathrm {tr} ((BC)^{-1}(BC)')=\mathrm {tr} (B^{-1}B')+\mathrm {tr} (C^{-1}C').}

In particular, if L is invertible, then I = L − 1 L {\displaystyle I=L^{-1}L} and

- 0 = t r ( I − 1 I ′ ) = t r ( L ( L − 1 ) ′ ) + t r ( L − 1 L ′ ) . {\displaystyle 0=\mathrm {tr} (I^{-1}I')=\mathrm {tr} (L(L^{-1})')+\mathrm {tr} (L^{-1}L').}

Since A has distinct eigenvalues, there exists a differentiable complex invertible matrix L such that A = L − 1 D L {\displaystyle A=L^{-1}DL} and D is diagonal. Then

- t r ( A − 1 A ′ ) = t r ( L ( L − 1 ) ′ ) + t r ( D − 1 D ′ ) + t r ( L − 1 L ′ ) = t r ( D − 1 D ′ ) . {\displaystyle \mathrm {tr} (A^{-1}A')=\mathrm {tr} (L(L^{-1})')+\mathrm {tr} (D^{-1}D')+\mathrm {tr} (L^{-1}L')=\mathrm {tr} (D^{-1}D').}

Let λ i {\displaystyle \lambda _{i}} , i = 1 , … , n {\displaystyle i=1,\ldots ,n} be the eigenvalues of A. Then

- ( ln ⁡ det A ) ′ = ( ∑ i = 1 n ln ⁡ λ i ) ′ = ∑ i = 1 n λ i ′ / λ i = t r ( D − 1 D ′ ) = t r ( A − 1 A ′ ) , {\displaystyle \left(\ln \det A\right)'=\left(\sum _{i=1}^{n}\ln \lambda _{i}\right)'=\sum _{i=1}^{n}\lambda _{i}'/\lambda _{i}=\mathrm {tr} (D^{-1}D')=\mathrm {tr} (A^{-1}A'),}

which is the Jacobi formula for matrices A with distinct nonzero eigenvalues.

## Corollary

The following is a useful relation connecting the [trace](/source/Trace_(linear_algebra)) to the determinant of the associated [matrix exponential](/source/Matrix_exponential):

det e B = e tr ⁡ ( B ) {\displaystyle \det e^{B}=e^{\operatorname {tr} \left(B\right)}}

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

For any [invertible matrix](/source/Invertible_matrix) A ( t ) {\displaystyle A(t)} , in the previous section ["Via Chain Rule"](#Via_Chain_Rule), we showed that

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

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

- d d t det e t B = tr ⁡ ( B ) det e t B {\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](/source/Ordinary_differential_equation).

## Applications

Several forms of the formula underlie the [Faddeev–LeVerrier algorithm](/source/Faddeev%E2%80%93LeVerrier_algorithm) for computing the [characteristic polynomial](/source/Characteristic_polynomial), and explicit applications of the [Cayley–Hamilton theorem](/source/Cayley%E2%80%93Hamilton_theorem). For example, starting from the following equation, which was proved above:

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

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

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

where adj denotes the [adjugate matrix](/source/Adjugate_matrix).

## Remarks

1. **[^](#cite_ref-1)** [Magnus & Neudecker (1999](#CITEREFMagnusNeudecker1999), pp. 149–150), Part Three, Section 8.3

## References

- Magnus, Jan R.; Neudecker, Heinz (1999). [*Matrix Differential Calculus with Applications in Statistics and Econometrics*](https://books.google.com/books?id=0CXXdKKiIpQC) (Revised ed.). Wiley. [ISBN](/source/ISBN_(identifier)) [0-471-98633-X](https://en.wikipedia.org/wiki/Special:BookSources/0-471-98633-X).

- Bellman, Richard (1997). [*Introduction to Matrix Analysis*](https://books.google.com/books?id=QVCflvTPYE8C). SIAM. [ISBN](/source/ISBN_(identifier)) [0-89871-399-4](https://en.wikipedia.org/wiki/Special:BookSources/0-89871-399-4).

---
Adapted from the Wikipedia article [Jacobi's formula](https://en.wikipedia.org/wiki/Jacobi's_formula) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Jacobi's_formula?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
