AI Knowledge Tree

Determinants and volume

Define the determinant as a signed volume scaling, derive its key properties, and tie det=0 to singularity.

⏱ 30 minPrerequisites:Linear maps and matrices

A linear map distorts space: it might expand, contract, or collapse it. The determinant is the number that measures that distortion. It is a single scalar that encodes whether a matrix is invertible and by how much it scales volumes.

Definition via volume

For a square matrix A∈Rn×nA \in \mathbb{R}^{n \times n}, the determinant det⁡A\det A (also written ∣A∣|A|) is the signed volume of the parallelepiped spanned by the column vectors of AA, relative to the unit cube's volume of 11[1].

Two properties characterize the determinant completely (up to normalization):

  1. Multilinearity in each column. Scaling one column by cc scales the determinant by cc. Splitting a column into a sum of two columns splits the determinant into a sum of two determinants.
  2. Alternating. Swapping any two columns changes the sign of the determinant.

The normalization det⁡I=1\det I = 1 (the identity does not distort volume) pins it down. From these three requirements, one can derive the cofactor-expansion formula and every other property.

Key properties

Product rule:[2]

det⁡(AB)=det⁡(A) det⁡(B).\det(AB) = \det(A)\,\det(B).

Derivation. Both sides depend multilinearly on the columns of AA and BB. The cleanest proof uses the fact that any matrix is a product of elementary matrices (row operations), whose determinants multiply; here we state it as the fundamental multiplicativity law.

Transpose:

det⁡(A⊤)=det⁡(A).\det(A^\top) = \det(A).

So everything that holds for columns holds for rows: swapping rows changes sign, scaling a row scales the determinant, and a zero row gives det⁡=0\det = 0.

Triangular matrices: det⁡A=a11a22⋯ann\det A = a_{11} a_{22} \cdots a_{nn} (the product of diagonal entries). Follows from multilinearity and alternating: off-diagonal entries in a triangular matrix contribute zero.

Block diagonal: det⁡(A00B)=det⁡(A)det⁡(B)\det\begin{pmatrix} A & 0 \\ 0 & B \end{pmatrix} = \det(A)\det(B).

Determinant = 0 means singular

det⁡A=0\det A = 0 if and only if the columns of AA are linearly dependent, i.e. the map x↦Axx \mapsto Ax collapses Rn\mathbb{R}^n into a lower-dimensional subspace. The collapsed image has zero nn-dimensional volume, so the determinant (a volume scale factor) is zero. A matrix with nonzero determinant is invertible (or nonsingular), and

det⁡(A−1)=1det⁡(A).\det(A^{-1}) = \frac{1}{\det(A)}.

The sign and magnitude read off directly from what the map does to area in 2×22\times 2:

  • (2002)\begin{pmatrix} 2 & 0 \\ 0 & 2\end{pmatrix} doubles each axis, so it scales area by det⁡=4\det = 4: the unit square maps to a 2×22\times 2 square.
  • A shear (1301)\begin{pmatrix} 1 & 3 \\ 0 & 1\end{pmatrix} slants the square into a parallelogram of the same base and height, so det⁡=1\det = 1: area is untouched even though the shape is not.
  • (0.5001)\begin{pmatrix} 0.5 & 0 \\ 0 & 1\end{pmatrix} squeezes one axis to half, so det⁡=0.5\det = 0.5: area halved.
  • A reflection (100−1)\begin{pmatrix} 1 & 0 \\ 0 & -1\end{pmatrix} preserves area but flips orientation, so det⁡=−1\det = -1: the negative sign is the orientation reversal, not a smaller area. A rotation, which neither stretches nor flips, has det⁡=1\det = 1 at every angle.
  • The singular (1224)\begin{pmatrix} 1 & 2 \\ 2 & 4\end{pmatrix} sends both columns onto the same line, collapsing the square to a segment of zero area: det⁡=0\det = 0.

Computing the determinant

For 2×22 \times 2:

det⁡(abcd)=ad−bc.\det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc.

For n×nn \times n, the cofactor expansion along column jj gives a recursion:

det⁡A=∑i=1n(−1)i+j aij Mij,\det A = \sum_{i=1}^n (-1)^{i+j}\, a_{ij}\, M_{ij},

where MijM_{ij} is the determinant of the (n−1)×(n−1)(n-1)\times(n-1) matrix obtained by deleting row ii and column jj. This is O(n!)O(n!) naively, but the LU factorization computes the determinant in O(n3)O(n^3) as the product of the LU diagonal entries (with sign from the row-swap parity).

The determinant is the signed area-scaling factor: A maps the unit square to a parallelogram of area |det A|.
The determinant is the signed area-scaling factor: A maps the unit square to a parallelogram of area |det A|.

Check it on arrays

python · numpy
import numpy as np

A = np.array([[2.0, 1.0, 0.0],
              [1.0, 3.0, 1.0],
              [0.0, 1.0, 2.0]])

d = np.linalg.det(A)
print(f"det(A) = {d:.6f}")   # should be 2*5-1*2 = 8 (cofactor along row 1)

# Product rule: det(AB) = det(A)*det(B)
B = np.array([[1.0, 2.0, 0.0],
              [0.0, 1.0, 3.0],
              [2.0, 0.0, 1.0]])
print(f"det(A)*det(B) = {d * np.linalg.det(B):.6f}")
print(f"det(A@B)      = {np.linalg.det(A @ B):.6f}")   # same

# Singular matrix: det = 0
C = np.array([[1.0, 2.0, 3.0],
              [2.0, 4.0, 6.0],
              [1.0, 0.0, 1.0]])
print(f"det(C) = {np.linalg.det(C):.2e}")   # ~0 (row 2 = 2*row 1)

# Triangular: det = product of diagonal
T = np.array([[3.0, 1.0, 5.0],
              [0.0, 2.0, 7.0],
              [0.0, 0.0, 4.0]])
print(f"det(T) = {np.linalg.det(T):.4f}")  # 3*2*4 = 24
print(f"diagonal product = {3*2*4}")

The product rule holds to floating-point precision; the singular matrix gives a determinant near zero; the triangular matrix matches its diagonal product.

Exercises

Exercise 1. Compute by hand the determinant of A=(210131012)A = \begin{pmatrix} 2 & 1 & 0 \\ 1 & 3 & 1 \\ 0 & 1 & 2 \end{pmatrix} using cofactor expansion along the first row.

Solution

Step 1. Cofactor expansion along row 11: det⁡A=a11M11−a12M12+a13M13\det A = a_{11} M_{11} - a_{12} M_{12} + a_{13} M_{13}, where each M1jM_{1j} is the 2×22\times 2 minor obtained by deleting row 11 and column jj.

Step 2. The minors: M11=det⁡(3112)=6−1=5M_{11} = \det\begin{pmatrix} 3 & 1 \\ 1 & 2 \end{pmatrix} = 6 - 1 = 5, M12=det⁡(1102)=2−0=2M_{12} = \det\begin{pmatrix} 1 & 1 \\ 0 & 2 \end{pmatrix} = 2 - 0 = 2, and the a13=0a_{13} = 0 term drops out.

Step 3. Combine: det⁡A=2⋅5−1⋅2+0=10−2=8\det A = 2 \cdot 5 - 1 \cdot 2 + 0 = 10 - 2 = 8.

Exercise 2. Using only multilinearity, the alternating property, and det⁡I=1\det I = 1, prove that a matrix with two equal columns has determinant 00.

Solution

Step 1. Suppose columns jj and kk are equal, j≠kj \neq k. The alternating property says swapping two columns flips the sign of the determinant. Swap columns jj and kk.

Step 2. Because the two columns are identical, the matrix after the swap is the same matrix, so its determinant is unchanged. The swap therefore gives both det⁡A=−det⁡A\det A = -\det A (from alternating) and det⁡A=det⁡A\det A = \det A (the matrix is unchanged).

Step 3. From det⁡A=−det⁡A\det A = -\det A we get 2det⁡A=02 \det A = 0, hence det⁡A=0\det A = 0. This is why a matrix with linearly dependent columns, of which equal columns are the simplest case, has determinant zero.

Exercise 3 (code). A determinant is multiplied by cnc^n when the whole n×nn\times n matrix is scaled by cc (each of the nn columns contributes one factor of cc by multilinearity). Verify this for a random 4×44\times 4 matrix and c=3c = 3, and confirm the orientation-reversal fact that swapping two columns flips the sign of the determinant.

Solution
python · numpy
import numpy as np

rng = np.random.default_rng(0)
A = rng.normal(size=(4, 4))
n, c = 4, 3.0

# Scaling the whole matrix by c multiplies det by c**n.
assert np.isclose(np.linalg.det(c * A), c**n * np.linalg.det(A))

# Swapping two columns flips the sign of the determinant.
A_swapped = A[:, [1, 0, 2, 3]]
assert np.isclose(np.linalg.det(A_swapped), -np.linalg.det(A))

print("c**n factor:", c**n)            # 81
print("det(A):", round(np.linalg.det(A), 6))

The determinant of cAcA equals c4=81c^4 = 81 times det⁡A\det A, one factor of cc per column, and the single column swap negates the determinant exactly as the alternating property requires.

With the determinant linking to singularity, the next lesson asks: which vectors does AA only scale, without rotating?


References

  1. [1]Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. The determinant as a signed volume and its role in invertibility.↩
  2. [2]Axler, S. (2015). Linear Algebra Done Right (3rd ed.), ch. 10. Springer. The multilinear-alternating characterization and the product rule (doi:10.1007/978-3-319-11080-6).↩