The determinant compresses an entire square matrix into a single number that answers two questions at once: is this matrix invertible? and by how much does it scale volume? It is less central to computation than students often think (we rarely compute large determinants), but its geometric meaning illuminates invertibility, eigenvalues, and change of variables.

The geometric definition

The determinant \(\det(\mA)\) of a square matrix \(\mA\in\R^{n\times n}\) is the signed volume of the parallelepiped spanned by its columns. In \(\R^2\) it is the signed area of the parallelogram formed by the two columns; in \(\R^3\), the signed volume of the parallelepiped formed by the three columns.

A matrix transforms the unit square (or cube) into a parallelogram (or parallelepiped); the determinant is the factor by which area/volume changes. So \(\det(\mA)=0\) means the transformation collapses space into a lower dimension — the columns are linearly dependent and the matrix is not invertible. A negative determinant means the transformation flips orientation (like a mirror).

Computing determinants

For small matrices: \[\det\begin{bmatrix}a&b\\c&d\end{bmatrix}=ad-bc,\qquad \det\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}=a(ei-fh)-b(di-fg)+c(dh-eg).\] In general, cofactor (Laplace) expansion along any row or column reduces an \(n\times n\) determinant to a signed sum of \((n-1)\times(n-1)\) determinants: \[\det(\mA)=\sum_{j=1}^n (-1)^{i+j}\,a_{ij}\,M_{ij},\] where \(M_{ij}\) is the minor (determinant of \(\mA\) with row \(i\), column \(j\) deleted). This is exponential in cost, so it is for theory and small cases only.

\(\det\begin{bmatrix}1&2&0\\3&-1&2\\0&4&1\end{bmatrix} =1\big((-1)(1)-(2)(4)\big)-2\big((3)(1)-(2)(0)\big)+0 =1(-9)-2(3)= -15.\)

Properties that make determinants useful

For square matrices \(\mA,\mB\) of the same size:

  1. \(\det(\mI)=1\).

  2. Swapping two rows flips the sign; a repeated row gives \(\det=0\).

  3. Scaling one row by \(c\) scales the determinant by \(c\); hence \(\det(c\mA)=c^n\det(\mA)\).

  4. Adding a multiple of one row to another leaves the determinant unchanged.

  5. \(\det(\mA\mB)=\det(\mA)\det(\mB)\) and \(\det(\mA\tp)=\det(\mA)\).

  6. For triangular matrices, \(\det\) is the product of the diagonal entries.

Properties (4) and (6) give the practical algorithm: run Gaussian elimination (which does not change the determinant except for sign-flips on row swaps), then multiply the pivots. This is how determinants are actually computed — \(O(n^3)\), not the exponential cofactor sum. The product-of-pivots fact also reveals: a matrix is invertible iff its determinant is nonzero iff it has a full set of nonzero pivots.

Determinant, invertibility, and volume

\(\mA\) is invertible \(\iff \det(\mA)\neq 0\). When invertible, \(\det(\mA\inv)=1/\det(\mA)\).

The volume interpretation also drives the change-of-variables formula in multivariable calculus: integrating under a transformation \(\vx\mapsto \mA\vx\) multiplies volumes by \(|\det\mA|\). The local version, with the Jacobian determinant, is what lets probability densities transform correctly — the foundation of normalizing flows in generative modeling.

Cramer’s rule (and why we avoid it)

Cramer’s rule expresses each unknown as a ratio of determinants, \(x_i=\det(\mA_i)/\det(\mA)\) where \(\mA_i\) replaces column \(i\) with \(\vb\). It is elegant and useful in proofs, but catastrophically slow and numerically poor for \(n>3\); elimination wins in practice.

Determinants are rarely the right computational tool for large matrices. To test (near-)singularity, the determinant is unreliable — it can underflow or overflow wildly (e.g. a \(100\times100\) matrix with entries \(\sim2\) has determinant \(\sim2^{100}\)). Use the condition number or the smallest singular value (Chapters [ch:svd][ch:numerical]) instead. For likelihoods one works with the log-determinant, often via a Cholesky factor.

The determinant appears in the multivariate Gaussian density through \(\det(\mSig)\) (the normalizing constant), and its logarithm shows up in Gaussian-process marginal likelihoods — computed stably as twice the sum of logs of a Cholesky diagonal. The Jacobian determinant is central to normalizing flows, which build flexible probability distributions by tracking how an invertible neural map rescales volume. And \(\det=0\) is the algebraic signature of the redundancy (collinearity) that forces regularization.

import numpy as np
A = np.array([[1.,2,0],[3,-1,2],[0,4,1]])
print(np.linalg.det(A))                 # -15.0
sign, logabsdet = np.linalg.slogdet(A)  # stable: sign and log|det|
print(sign, logabsdet)

Chapter summary

  • \(\det(\mA)\) is the signed volume-scaling factor of the transformation \(\mA\).

  • \(\det(\mA)=0 \iff\) columns are dependent \(\iff \mA\) is singular (not invertible).

  • Key rules: \(\det(\mA\mB)=\det(\mA)\det(\mB)\), triangular \(\det=\) product of diagonal, elimination \(+\) pivots is the practical method.

  • Avoid determinants for large-scale numerical work; use condition numbers / log-determinants instead.