Determinants: The Volume Factor of Linear Maps

Understand determinants as volume scaling factors, learn computation methods, and see how they reveal matrix invertibility.

Linear Algebra March 6, 2026 7 min read

Introduction

The determinant is a single number that encodes deep information about a square matrix: whether it is invertible, how it scales volumes, and the sign of the orientation change it produces. While you rarely compute determinants by hand in ML practice, understanding what they mean geometrically gives you strong intuition for concepts like Jacobians, change of variables in probability, and the behavior of linear transformations.

This article builds on systems of linear equations and prepares the ground for linear transformations.

Definition for 2x2 and 3x3

For a 2×22 \times 2 matrix:

det[abcd]=adbc\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc

For a 3×33 \times 3 matrix, expand along the first row (cofactor expansion):

det[abcdefghi]=a(eifh)b(difg)+c(dheg)\det\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} = a(ei - fh) - b(di - fg) + c(dh - eg)

The pattern alternates signs: +aM11bM12+cM13+a \cdot M_{11} - b \cdot M_{12} + c \cdot M_{13}, where MijM_{ij} is the minor — the determinant of the submatrix obtained by deleting row ii and column jj.

The Geometric Meaning

The determinant has a beautiful geometric interpretation:

Geometric interpretation: det(A)|\det(\mathbf{A})| is the factor by which A\mathbf{A} scales volumes. The sign indicates whether A\mathbf{A} preserves (++) or reverses (-) orientation.

Consider the columns of A\mathbf{A} as vectors. In 2D, det(A)|\det(\mathbf{A})| is the area of the parallelogram spanned by these vectors. In 3D, it is the volume of the parallelepiped.

det(A)\det(\mathbf{A})Geometric Meaning
det(A)>0\det(\mathbf{A}) > 0Preserves orientation, scales volume by det(A)\det(\mathbf{A})
det(A)<0\det(\mathbf{A}) < 0Reverses orientation, scales volume by $
det(A)=0\det(\mathbf{A}) = 0Collapses space to lower dimension (not invertible)
det(A)=1\det(\mathbf{A}) = 1Preserves volume exactly (e.g., rotations)

Example: A 2×22 \times 2 matrix with det=0\det = 0 maps all of R2\mathbb{R}^2 onto a line (or a point). The parallelogram collapses to zero area. This is why det=0\det = 0 means the matrix is singular — it loses information.

Properties of Determinants

These properties make determinants powerful tools for reasoning about matrices:

Multiplicativity

det(AB)=det(A)det(B)\det(\mathbf{A}\mathbf{B}) = \det(\mathbf{A}) \cdot \det(\mathbf{B})

This is the most important property. Composing two transformations multiplies their volume scaling factors.

Transpose

det(AT)=det(A)\det(\mathbf{A}^T) = \det(\mathbf{A})

Row operations and column operations affect the determinant identically.

Inverse

det(A1)=1det(A)\det(\mathbf{A}^{-1}) = \frac{1}{\det(\mathbf{A})}

This follows from det(AA1)=det(I)=1\det(\mathbf{A}\mathbf{A}^{-1}) = \det(\mathbf{I}) = 1.

Scalar Multiplication

det(cA)=cndet(A)\det(c\mathbf{A}) = c^n \det(\mathbf{A})

where nn is the size of the matrix. Each of the nn rows gets scaled by cc.

Row Operations

OperationEffect on det\det
Swap two rowsMultiplies det\det by 1-1
Multiply a row by ccMultiplies det\det by cc
Add a multiple of one row to anotherDoes not change det\det

This is why Gaussian elimination is an efficient way to compute determinants: reduce to triangular form (tracking sign flips from row swaps), then multiply the diagonal entries.

Triangular Matrices

For upper or lower triangular matrices, the determinant is the product of diagonal entries:

det(U)=u11u22unn\det(\mathbf{U}) = u_{11} \cdot u_{22} \cdot \ldots \cdot u_{nn}

This makes the identity matrix’s determinant obvious: det(I)=1\det(\mathbf{I}) = 1.

Computing Determinants

Cofactor Expansion

For an n×nn \times n matrix, expand along row ii:

det(A)=j=1n(1)i+jaijMij\det(\mathbf{A}) = \sum_{j=1}^{n} (-1)^{i+j} a_{ij} M_{ij}

where MijM_{ij} is the minor. The term (1)i+jMij(-1)^{i+j} M_{ij} is called the cofactor CijC_{ij}.

Cofactor expansion has complexity O(n!)O(n!), which is impractical for large matrices. It is primarily a theoretical tool.

LU Decomposition

The practical method: factor A=PLU\mathbf{A} = \mathbf{P}\mathbf{L}\mathbf{U} (with row permutation matrix P\mathbf{P}), then:

det(A)=det(P)det(L)det(U)=(1)s1i=1nuii\det(\mathbf{A}) = \det(\mathbf{P}) \cdot \det(\mathbf{L}) \cdot \det(\mathbf{U}) = (-1)^s \cdot 1 \cdot \prod_{i=1}^{n} u_{ii}

where ss is the number of row swaps. This costs O(n3)O(n^3).

import numpy as np

A = np.array([[2, 1, 3],
              [4, 5, 6],
              [7, 8, 9]])

det = np.linalg.det(A)
print(f"det(A) = {det:.4f}")  # det(A) = -3.0000

Cramer’s Rule

For a system Ax=b\mathbf{A}\mathbf{x} = \mathbf{b} with det(A)0\det(\mathbf{A}) \neq 0, each component of the solution is:

xj=det(Aj)det(A)x_j = \frac{\det(\mathbf{A}_j)}{\det(\mathbf{A})}

where Aj\mathbf{A}_j is A\mathbf{A} with column jj replaced by b\mathbf{b}.

Warning: Cramer’s rule is elegant but computationally expensive (O(nn!)O(n \cdot n!) with cofactor expansion). It is useful for theoretical analysis and for very small systems, but never for practical computation. Use LU decomposition or iterative methods instead.

Worked Example

Compute det(A)\det(\mathbf{A}) where:

A=[132041265]\mathbf{A} = \begin{bmatrix} 1 & 3 & 2 \\ 0 & 4 & 1 \\ 2 & 6 & 5 \end{bmatrix}

Method 1: Cofactor expansion along column 1 (chosen because it has a zero):

det(A)=1det[4165]0det[3265]+2det[3241]=1(206)0+2(38)=1410=4\begin{aligned} \det(\mathbf{A}) &= 1 \cdot \det\begin{bmatrix} 4 & 1 \\ 6 & 5 \end{bmatrix} - 0 \cdot \det\begin{bmatrix} 3 & 2 \\ 6 & 5 \end{bmatrix} + 2 \cdot \det\begin{bmatrix} 3 & 2 \\ 4 & 1 \end{bmatrix} \\[6pt] &= 1 \cdot (20 - 6) - 0 + 2 \cdot (3 - 8) \\[6pt] &= 14 - 10 = 4 \end{aligned}

Method 2: Row reduction

[132041265]R32R1[132041001]\begin{bmatrix} 1 & 3 & 2 \\ 0 & 4 & 1 \\ 2 & 6 & 5 \end{bmatrix} \xrightarrow{R_3 - 2R_1} \begin{bmatrix} 1 & 3 & 2 \\ 0 & 4 & 1 \\ 0 & 0 & 1 \end{bmatrix}

No row swaps, so det(A)=141=4\det(\mathbf{A}) = 1 \cdot 4 \cdot 1 = 4. Same answer.

The Adjugate and Matrix Inverse

The adjugate (or classical adjoint) of A\mathbf{A} is the transpose of the cofactor matrix:

adj(A)=CT\text{adj}(\mathbf{A}) = \mathbf{C}^T

The inverse can be expressed as:

A1=1det(A)adj(A)\mathbf{A}^{-1} = \frac{1}{\det(\mathbf{A})} \text{adj}(\mathbf{A})

This formula is mainly theoretical. For a 2×22 \times 2 matrix, it gives a compact formula:

[abcd]1=1adbc[dbca]\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

Determinants and Eigenvalues

A deep connection we will explore in the eigenvalues article:

det(A)=i=1nλi\det(\mathbf{A}) = \prod_{i=1}^{n} \lambda_i

The determinant equals the product of all eigenvalues. Combined with the trace being the sum of eigenvalues, these two scalar quantities capture the most essential spectral information about a matrix.

Why This Matters for ML

While you rarely compute determinants directly in ML code, the concept appears in several important contexts:

  • Invertibility check: det(A)=0\det(\mathbf{A}) = 0 means the matrix is singular — the system Ax=b\mathbf{A}\mathbf{x} = \mathbf{b} has no unique solution. This signals multicollinearity in features.
  • Jacobian determinant: In normalizing flows (a class of generative models), the change-of-variables formula involves det(J)|\det(\mathbf{J})|, where J\mathbf{J} is the Jacobian of the transformation.
  • Gaussian distribution: The multivariate Gaussian PDF includes det(Σ)\det(\boldsymbol{\Sigma}):
f(x)=1(2π)n/2det(Σ)1/2exp(12(xμ)TΣ1(xμ))f(\mathbf{x}) = \frac{1}{(2\pi)^{n/2} |\det(\boldsymbol{\Sigma})|^{1/2}} \exp\left(-\frac{1}{2}(\mathbf{x} - \boldsymbol{\mu})^T \boldsymbol{\Sigma}^{-1} (\mathbf{x} - \boldsymbol{\mu})\right)
  • Volume interpretation: The determinant of the covariance matrix measures the “spread” of the distribution — larger determinant means more spread.
  • Log-determinant: In optimization (e.g., maximum likelihood for Gaussians), we work with logdet(Σ)\log\det(\boldsymbol{\Sigma}) for numerical stability.

Summary

  • The determinant is a scalar that encodes volume scaling, orientation, and invertibility.
  • det(A)|\det(\mathbf{A})| gives the factor by which A\mathbf{A} scales volumes; the sign indicates orientation.
  • det(A)=0\det(\mathbf{A}) = 0 means A\mathbf{A} is singular — it collapses space and is not invertible.
  • det(AB)=det(A)det(B)\det(\mathbf{A}\mathbf{B}) = \det(\mathbf{A}) \cdot \det(\mathbf{B}) — composition multiplies volume factors.
  • The determinant equals the product of eigenvalues and can be computed efficiently via LU decomposition.
  • In ML, determinants appear in the multivariate Gaussian, normalizing flows, and invertibility checks.
  • Next, we explore how matrices act as functions in linear transformations.

References

Keyboard Shortcuts

Navigation
j
Next heading
k
Previous heading
n
Next article in series
p
Previous article in series
t
Scroll to top
Actions
r
Toggle reading mode
Ctrl K
Search articles
?
Toggle this help
Esc
Close overlay