# Jacobi's formula

**Jacobi's formula** is a theorem of [matrix calculus](https://www.edgepedia.org/matrix-calculus) that expresses the differential of the determinant of a square matrix in terms of its adjugate: for a square matrix \( B \) with differential \( dB \),

\[ d\,\det(B) = \operatorname{tr}\big(\operatorname{adj}(B)\, dB\big), \]

where \( \operatorname{adj}(B) \) is the adjugate (classical adjoint), the transpose of the cofactor matrix.<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup> When \( B \) is invertible the formula takes the more widely used form \( d\,\det(A) = \det(A)\,\operatorname{tr}(A^{-1} dA) \), and it underlies the derivative of the log-determinant, a quantity that appears throughout statistics, machine learning, and physics.<sup>[2](https://choxos.github.io/Mathematics-of-ITC/appendices/B-matrix-calculus.html)</sup>

| Key fact | Detail |
|---|---|
| General form | \( d\,\det(B) = \operatorname{tr}(\operatorname{adj}(B)\, dB) \), valid for every square matrix, singular or not<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup> |
| Invertible form | \( d\,\det(A) = \det(A)\,\operatorname{tr}(A^{-1} dA) \); gradient \( \partial \det(X)/\partial X = \det(X)\,X^{-\top} \)<sup>[2](https://choxos.github.io/Mathematics-of-ITC/appendices/B-matrix-calculus.html)</sup> |
| Log-determinant | \( d(\log\det A) = \operatorname{tr}(A^{-1} dA) \), so \( \partial \log\lvert A\rvert/\partial\theta = \operatorname{tr}(A^{-1}\, \partial A/\partial\theta) \)<sup>[3](https://jejjohnson.github.io/research_notebook/differentiating-solve)</sup> |
| Component form | \( \partial \det(A)/\partial a_{ij} = \operatorname{adj}(A)_{ji} \), the cofactor of \( a_{ij} \)<sup>[4](https://maths-people.anu.edu.au/~steve/main_article-20130114.pdf)</sup> |
| Wronskian corollary | For \( dX/d\tau = L(\tau)X \), \( \det(X(\tau)) = \exp\big(\int_0^\tau \operatorname{tr} L(\theta)\, d\theta\big)\det(X(0)) \)<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup> |
| Named after | Carl Gustav Jacob Jacobi, who published three treatises on determinants in 1841<sup>[5](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)</sup> |

## Statement and proof

The adjugate of an \( n \times n \) matrix \( B = \{\beta_{ij}\} \) is the matrix \( \operatorname{adj}(B) = \{\alpha_{ij}\} \) with

\[ \alpha_{ij} = (-1)^{i-j} \det(B \text{ without its } j\text{th row and } i\text{th column}), \]

so that \( \alpha_{ij} \) is the cofactor of \( \beta_{ji} \), and \( B\,\operatorname{adj}(B) = \operatorname{adj}(B)\,B = \det(B) I \).<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup>

The standard proof uses Laplace's (cofactor) expansion. Expanding the determinant along any row, each entry \( a_{ij} \) appears linearly multiplied by its cofactor, and the cofactor does not depend on the entries of that row. Hence \( \partial \det(A)/\partial a_{ij} = \operatorname{adj}(A)_{ji} \). Applying the chain rule over all \( n^2 \) entries then gives

\[ d(\det A) = \sum_{i,j} \frac{\partial \det(A)}{\partial a_{ij}}\, da_{ij} = \sum_{i,j} \operatorname{adj}(A)_{ji}\, da_{ij} = \operatorname{tr}\big(\operatorname{adj}(A)\, dA\big). \]

<sup>[4](https://maths-people.anu.edu.au/~steve/main_article-20130114.pdf)</sup> Because the determinant is a polynomial in the entries, the derivative exists everywhere; the adjugate form is the one that remains meaningful at singular matrices.<sup>[6](https://sites.math.washington.edu/~burke/crs/516-21/matrix-calc-notes.pdf)</sup>

When \( A \) is invertible, \( \operatorname{adj}(A) = \det(A)\,A^{-1} \), and the scalar \( \det(A) \) factors out of the trace:<sup>[7](https://math-cs-compass.com/Mathematics/Calculus/det.html)</sup>

\[ d\,\det(A) = \det(A)\,\operatorname{tr}(A^{-1} dA), \qquad \frac{\partial \det(X)}{\partial X} = \det(X)\,X^{-\top}. \]

<sup>[2](https://choxos.github.io/Mathematics-of-ITC/appendices/B-matrix-calculus.html)</sup> Dividing by \( \det(A) \) gives the log-determinant rule \( d(\log\det A) = \operatorname{tr}(A^{-1} dA) \), which requires only one solve and one trace and never materializes the gradient as a dense matrix.<sup>[3](https://jejjohnson.github.io/research_notebook/differentiating-solve)</sup>

## Repeated differentiation

The invertible form differentiates repeatedly by the product rule. For a matrix \( A \) depending on a scalar parameter \( \alpha \), writing \( A_\alpha = \partial A/\partial\alpha \),

\[ \frac{\partial^2}{\partial \alpha^2} \det A = \det(A) \left[ \operatorname{tr}^2\big(A^{-1} A_\alpha\big) + \operatorname{tr}\big(A^{-1}_\alpha A_\alpha\big) + \operatorname{tr}\big(A^{-1} A_{\alpha^2}\big) \right]. \]

<sup>[8](https://math.stackexchange.com/questions/2325807/second-derivative-of-a-determinant)</sup>

## The Wronskian and linear differential equations

A classical application concerns square matrix solutions \( X(\tau) \) of a linear differential equation \( dX/d\tau = L(\tau)X \), where \( L(\tau) \) is piecewise continuous and need not commute with itself at different times, so \( \exp(\int L \, d\theta) \) need not be a solution. Jacobi's formula still yields a scalar equation for the [Wronskian](https://www.edgepedia.org/wronskian) \( \det(X(\tau)) \):<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup>

\[ \frac{d \det(X)}{d\tau} = \operatorname{tr}\big(\operatorname{adj}(X)\, L X\big) = \det(X)\,\operatorname{tr}(L), \]

which solves to

\[ \det(X(\tau)) = \exp\left( \int_0^\tau \operatorname{tr} L(\theta)\, d\theta \right) \det(X(0)). \]

<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup> Consequently \( \det(X(\tau)) \) is nonzero for all \( \tau \) if it is nonzero for any \( \tau \): a solution matrix invertible at one time is invertible at every time, and such a matrix is a fundamental solution, every vector solution having the form \( x = Xc \).<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup> The same identity for the Wronskian of \( n \) solutions of \( x' = A(t)x \), \( dW/dt = W \operatorname{tr} A(t) \), is the Liouville–Ostrogradski formula, obtained by Liouville and Jacobi in 1838 (the \( n = 2 \) case by Abel in 1827), and for that reason it is sometimes itself called the Jacobi formula.<sup>[9](https://encyclopediaofmath.org/wiki/Liouville-Ostrogradski_formula)</sup>

## Eigenvalues and the characteristic polynomial

For \( p(x) = \det(xI - A) \), the characteristic polynomial of a fixed matrix \( A \), Jacobi's formula with \( M(x) = xI - A \) and \( dM = (dx)I \) gives, for \( x \) not an eigenvalue of \( A \),<sup>[7](https://math-cs-compass.com/Mathematics/Calculus/det.html)</sup>

\[ p'(x) = p(x)\,\operatorname{tr}\big((xI - A)^{-1}\big). \]

Over the complex numbers \( p(x) = \prod_{k=1}^n (x - \lambda_k) \), so the logarithmic derivative \( p'(x)/p(x) = \sum_k 1/(x - \lambda_k) \) identifies the trace of the resolvent with the sum of reciprocal eigenvalue offsets.<sup>[7](https://math-cs-compass.com/Mathematics/Calculus/det.html)</sup> The inverse form breaks down at eigenvalues, where \( (xI - A)^{-1} \) does not exist although \( p'(x) \) is defined; the adjugate form \( p'(x) = \operatorname{tr}(\operatorname{adj}(xI - A)) \) is a polynomial in \( x \) that needs no inverse and holds for every \( x \), and some automatic differentiation libraries compute determinant derivatives in this inverse-free way so they stay defined at singular matrices.<sup>[7](https://math-cs-compass.com/Mathematics/Calculus/det.html)</sup>

## Behavior at singular matrices

The adjugate form is what makes the general formula useful where the inverse form fails. The matrices with \( \det(B) = 0 \) form a hypersurface of dimension \( n^2 - 1 \) in the \( n^2 \)-dimensional space of \( n \times n \) matrices; among singular matrices, almost all have rank \( n - 1 \), and for such a matrix \( \operatorname{adj}(B) = vu^{\top} \neq 0 \) has rank one, with \( v \) and \( u^{\top} \) eigenvectors of \( B \) for the eigenvalue 0. The exceptional matrices of rank below \( n - 1 \) have \( \operatorname{adj}(B) = 0 \).<sup>[1](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)</sup> This is also why the adjugate formula still differentiates the determinant at a singular matrix while the inverse form does not.<sup>[10](https://alphabetamath.cc/linear-algebra/matrix-differentiation-and-first-order-spectral-perturbation-examples)</sup>

## Applications

**Statistics and machine learning.** The log-determinant derivative contributes one term to Gaussian covariance-parameter gradients; the quadratic-form term also contributes, so it is not half of every Gaussian-likelihood gradient: in maximum-likelihood estimation of a covariance matrix, [Gaussian process regression](https://www.edgepedia.org/gaussian-process-regression), and variational inference with full-covariance posteriors, the gradient of the \( \log \det \Sigma \) term is \( (\Sigma^{-1})^{\top} \) via \( d(\log \det A) = \operatorname{tr}(A^{-1} dA) \).<sup>[7](https://math-cs-compass.com/Mathematics/Calculus/det.html)</sup><sup> • </sup><sup>[14](https://www.cs.cornell.edu/courses/cs6241/2025sp/lec/2025-03-06.html)</sup> In normalizing flows, the change-of-variables log-likelihood requires \( \log \lvert \det J_{f_\theta} \rvert \), and differentiating it with respect to the parameters is an instance of Jacobi's formula, although many flow architectures use triangular Jacobians so the log-determinant reduces to a sum of logarithms.<sup>[7](https://math-cs-compass.com/Mathematics/Calculus/det.html)</sup>

**Continuum mechanics and physics.** In transport theorems for a moving domain, differentiating \( \det x_s \) with Jacobi's formula gives \( d(\det x_s)/dt = \det(x_s) \operatorname{div} u \), so the rate of change of a volume or area form is proportional to the divergence of the velocity field.<sup>[4](https://maths-people.anu.edu.au/~steve/main_article-20130114.pdf)</sup> In general relativity, varying the determinant of the metric tensor \( g \) uses the identity \( \delta(\det g) = (\det g)\,\operatorname{tr}(g^{-1} \delta g) \), a direct instance of the invertible form.<sup>[11](https://www.youtube.com/watch?v=F_lCKx1X-_M)</sup>

## A distinct result with a similar name

"Jacobi's determinant identity" is a different theorem: for a block matrix \( A = \begin{bmatrix} B & D \\ E & C \end{bmatrix} \) with inverse \( \begin{bmatrix} W & X \\ Y & Z \end{bmatrix} \), where \( B \) and \( W \) are \( k \times k \), it states \( \det(Z)\det(A) = \det(B) \).<sup>[12](https://mathworld.wolfram.com/JacobisDeterminantIdentity.html)</sup> The two results share only their author's name.

## History

[Carl Gustav Jacob Jacobi](https://www.edgepedia.org/carl-gustav-jacob-jacobi) (1804–1851) published three treatises on determinants in 1841, which made the definition algorithmic and the entries unrestricted, applying equally to numbers or functions; these papers made the determinant widely known.<sup>[5](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)</sup> His memoir *De determinantibus functionalibus* (1841) was devoted to the functional determinant now called the Jacobian, a subject in which he was not the first: the functional determinant appears earlier in an 1815 paper of Cauchy.<sup>[13](https://mathshistory.st-andrews.ac.uk/Biographies/Jacobi/)</sup> The derivative formula bearing his name is a standard part of the determinant theory systematized in that period.<sup>[5](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)</sup>

## References

1. [W. Kahan, "Jacobi's Formula for the Derivative of a Determinant," Math. H110, UC Berkeley (1998)](https://people.eecs.berkeley.edu/~wkahan/MathH110/jacobi.pdf)
2. [Appendix B, Matrix Calculus, The Mathematics of Indirect Treatment Comparisons](https://choxos.github.io/Mathematics-of-ITC/appendices/B-matrix-calculus.html)
3. [Differentiating through solve: implicit gradients for Gaussian inference, Research Notebook](https://jejjohnson.github.io/research_notebook/differentiating-solve)
4. [Transport theorem notes, Mathematical Sciences Institute, ANU](https://maths-people.anu.edu.au/~steve/main_article-20130114.pdf)
5. [Matrices and determinants, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/)
6. [Matrix Calculus Notes, University of Washington (J. Burke)](https://sites.math.washington.edu/~burke/crs/516-21/matrix-calc-notes.pdf)
7. [Scalar Functions of a Matrix, MATH-CS COMPASS](https://math-cs-compass.com/Mathematics/Calculus/det.html)
8. [Second Derivative of a Determinant, Mathematics Stack Exchange](https://math.stackexchange.com/questions/2325807/second-derivative-of-a-determinant)
9. [Liouville–Ostrogradski formula, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Liouville-Ostrogradski_formula)
10. [Matrix Differentiation and First-order Spectral Perturbation, Alphabeta Math](https://alphabetamath.cc/linear-algebra/matrix-differentiation-and-first-order-spectral-perturbation-examples)
11. [Deriving Jacobi's formula, Beyond Equations with Emanuele (video description)](https://www.youtube.com/watch?v=F_lCKx1X-_M)
12. [Jacobi's Determinant Identity, Wolfram MathWorld](https://mathworld.wolfram.com/JacobisDeterminantIdentity.html)
13. [Carl Jacobi (1804–1851), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Biographies/Jacobi/)
14. [CS 6241: Numerics for Data Science](https://www.cs.cornell.edu/courses/cs6241/2025sp/lec/2025-03-06.html)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Numbers and algebra › Linear and multilinear algebra › Matrix theory › Matrix functions and matrix calculus*

*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
