Search

Search papers and lessons

Determinant

Level 2 · 10 min read

The determinant is one number computed from a square matrix that says how much it scales area or volume and whether it can be undone.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Sign in to see your progress

TL;DR

The determinant of a square matrix is a single number that summarises it. It tells you by what factor the matrix scales areas or volumes, whether it flips orientation (a mirror image), and whether the matrix can be undone at all. A determinant of zero means the matrix squashes space onto something flatter, and information is lost.

Where you'll see it: in checking whether a system of linear equations has exactly one solution, in finding eigenvalues, and in the normalising constant of a multivariate Gaussian.

Intuition

Area under a transformation

Take the unit square, the square with corners at (0,0)(0,0), (1,0)(1,0), (0,1)(0,1) and (1,1)(1,1). A Matrix with columns (3,0)(3,0) and (1,2)(1,2) carries each point of that square to a new point. The square becomes a parallelogram. Its area is 66, and that is exactly the absolute value of the determinant of the matrix. The determinant is the area scaling factor of the transformation.

Why do we need such a number? Because many questions are really questions about how a map changes size. Does a system of equations have a unique answer? Does a change of coordinates stretch an integral's area element? Those questions depend only on the scaling factor, not on the details of the matrix, so one number is enough to answer them.

The sign carries information too. A positive determinant means the transformation keeps the orientation of the plane: a shape you draw counter-clockwise stays counter-clockwise. A negative determinant means the shape has been flipped, like a reflection in a mirror. A determinant of zero means the parallelogram has collapsed onto a line or a point, so its area is zero.

The plot below shows this collapse for the matrix with rows (1,x)(1, x) and (x,1)(x, 1). Its determinant is 1−x21 - x^2. The two columns become parallel exactly when x=±1x = \pm 1.

−1.5−1−0.500.511.5−1−0.500.511.5xdeterminant
  • det of the matrix with rows (1, x) and (x, 1)
The determinant is 1 at x = 0 (the identity matrix) and 0 at x = ±1, where the two columns point in the same direction and the parallelogram has no area.

The math

Definition

Definition: Determinant

The determinant of an n×nn \times n matrix AA with entries aija_{ij} (row ii, column jj) is

det⁡A=∑σsgn⁡(σ)∏i=1nai,σ(i).\det A = \sum_{\sigma} \operatorname{sgn}(\sigma) \prod_{i=1}^{n} a_{i,\sigma(i)}.

The sum runs over all permutations σ\sigma of the numbers 1,…,n1, \dots, n, that is, over all n!n! ways of reordering them. The sign sgn⁡(σ)\operatorname{sgn}(\sigma) is +1+1 if σ\sigma can be reached from the identity order by an even number of swaps of two entries, and −1-1 if it takes an odd number.

Read the formula as a recipe. Pick one entry from each row, making sure no two picks share a column. Multiply the picks together. Add up all such products, each with a plus or minus sign depending on the permutation.

For n=2n = 2 there are two permutations: the identity, with sign +1+1, which picks a11a22a_{11} a_{22}, and the swap, with sign −1-1, which picks a12a21a_{12} a_{21}. So for a 2×22 \times 2 matrix

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

For n=3n = 3 there are six terms. Nobody computes large determinants this way, but the definition is the one that makes all the properties below follow.

Cofactor expansion

Let MijM_{ij} be the minor of AA: the (n−1)×(n−1)(n-1) \times (n-1) matrix left after deleting row ii and column jj. Then for any fixed row ii,

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

This reduces an n×nn \times n determinant to nn determinants of size n−1n-1. It is the hand method for small matrices.

How row operations change the determinant

These three facts drive almost every calculation.

  • Swapping two rows multiplies the determinant by −1-1.
  • Multiplying one row by a number cc multiplies the determinant by cc.
  • Adding a multiple of one row to another row leaves the determinant unchanged.

Use the third rule to clear entries below the diagonal. The matrix becomes upper triangular, and the determinant of a triangular matrix is simply the product of its diagonal entries.

Products, transposes and inverses

For n×nn \times n matrices AA and BB, and a number cc:

det⁡(AB)=det⁡A⋅det⁡B,det⁡(A⊤)=det⁡A,det⁡(cA)=cndet⁡A.\det(AB) = \det A \cdot \det B, \qquad \det(A^\top) = \det A, \qquad \det(cA) = c^n \det A.

If AA is invertible, then det⁡(A−1)=1/det⁡A\det(A^{-1}) = 1/\det A. The product rule is the reason the determinant behaves like a size: applying two maps in turn multiplies their scaling factors.

Invertibility test

AA is invertible exactly when det⁡A≠0\det A \ne 0. Equivalent statements: the columns of AA are linearly independent (none is a combination of the others), and the system Ax=bA\mathbf{x} = \mathbf{b} has exactly one solution for every b\mathbf{b}. When the determinant is nonzero, Cramer's rule gives that solution explicitly: xi=det⁡Ai/det⁡Ax_i = \det A_i / \det A, where AiA_i is AA with column ii replaced by b\mathbf{b}.

Eigenvalues

A number λ\lambda is an eigenvalue of AA exactly when A−λIA - \lambda I is not invertible, which means

det⁡(A−λI)=0.\det(A - \lambda I) = 0.

Expanding this gives a polynomial in λ\lambda whose roots are the eigenvalues. This is how eigenvalues are found by hand. See Eigenvalues and Eigenvectors.

Volume and change of variables

∣det⁡A∣|\det A| is the factor by which AA multiplies volume in any dimension. For a nonlinear change of coordinates, the same role is played by the determinant of the Jacobian matrix, evaluated locally. Example 3 below uses this.

Worked examples

Example
A 2 by 2 matrix

Let A=(3142)A = \begin{pmatrix} 3 & 1 \\ 4 & 2 \end{pmatrix}.

  1. Identify a=3a = 3, b=1b = 1, c=4c = 4, d=2d = 2.
  2. Compute ad−bc=3⋅2−1⋅4ad - bc = 3 \cdot 2 - 1 \cdot 4.
  3. Simplify: 6−4=26 - 4 = 2.

So det⁡A=2\det A = 2. The matrix doubles areas and keeps orientation, because the sign is positive. It is invertible, because the determinant is not zero.

Example
A 3 by 3 matrix by cofactor expansion

Let B=(120013201)B = \begin{pmatrix} 1 & 2 & 0 \\ 0 & 1 & 3 \\ 2 & 0 & 1 \end{pmatrix}. Expand along the first row.

  1. The first row is (1,2,0)(1, 2, 0), so det⁡B=1⋅det⁡M11−2⋅det⁡M12+0⋅det⁡M13\det B = 1 \cdot \det M_{11} - 2 \cdot \det M_{12} + 0 \cdot \det M_{13}.
  2. Delete row 1 and column 1 to get M11=(1301)M_{11} = \begin{pmatrix} 1 & 3 \\ 0 & 1 \end{pmatrix}, with determinant 1⋅1−3⋅0=11 \cdot 1 - 3 \cdot 0 = 1.
  3. Delete row 1 and column 2 to get M12=(0321)M_{12} = \begin{pmatrix} 0 & 3 \\ 2 & 1 \end{pmatrix}, with determinant 0⋅1−3⋅2=−60 \cdot 1 - 3 \cdot 2 = -6.
  4. The third term is multiplied by 00, so it vanishes.
  5. Combine: det⁡B=1⋅1−2⋅(−6)+0=1+12=13\det B = 1 \cdot 1 - 2 \cdot (-6) + 0 = 1 + 12 = 13.

So BB scales volume by 1313, keeps orientation, and is invertible.

Example
Polar coordinates as a change of variables

Write a point in the plane as x=rcos⁡θx = r\cos\theta, y=rsin⁡θy = r\sin\theta. The Jacobian matrix of this map is

J=(cos⁡θ−rsin⁡θsin⁡θrcos⁡θ).J = \begin{pmatrix} \cos\theta & -r\sin\theta \\ \sin\theta & r\cos\theta \end{pmatrix}.
  1. Compute det⁡J=cos⁡θ⋅rcos⁡θ−(−rsin⁡θ)⋅sin⁡θ\det J = \cos\theta \cdot r\cos\theta - (-r\sin\theta) \cdot \sin\theta.
  2. Simplify: det⁡J=rcos⁡2θ+rsin⁡2θ\det J = r\cos^2\theta + r\sin^2\theta.
  3. Use cos⁡2θ+sin⁡2θ=1\cos^2\theta + \sin^2\theta = 1: det⁡J=r\det J = r.

So a small patch of area dr dθdr\,d\theta in polar coordinates corresponds to area r dr dθr\,dr\,d\theta in the plane. This is why integrals in polar coordinates carry an extra factor of rr.

Tradeoffs and failure modes

Use the determinant to answer yes or no questions about invertibility and scaling. For computing with large matrices, reach for other tools.

SituationWhat goes wrongBetter choice
Computing det⁡\det of a matrix bigger than about 4×44 \times 4 with the definition or cofactorsThe work grows like n!n!, which is hopeless quicklyLU decomposition: row reduce, then multiply the pivots, about n3/3n^3/3 operations
Solving Ax=bA\mathbf{x} = \mathbf{b} by Cramer's rule for n>3n > 3Needs n+1n+1 determinants and is numerically unstableLU or QR factorisation, then back-substitution
Judging a matrix as nearly singular by a tiny determinantScale matters: det⁡(cA)=cndet⁡A\det(cA) = c^n \det A, so 0.1 I0.1\,I with II the 100×100100 \times 100 identity has determinant 10−10010^{-100} even though it is perfectly invertibleCondition number, or the smallest singular value
Multiplying many entries to get a large determinantThe product overflows or underflows in floating pointWork with the log of the absolute value, summing logs of the pivots, and track the sign separately
Testing whether a measured matrix is exactly singularMeasured numbers almost never give exactly zeroNumerical rank with a tolerance, from the SVD

History

Determinants appeared before matrices did. Seki Takakazu in Japan developed them for solving systems of equations around the 1680s, and Gottfried Leibniz in Europe worked on the same idea in the 1690s. Gabriel Cramer published his rule for solving linear systems in 1750. In 1812 Augustin-Louis Cauchy gave the word "determinant" its modern meaning and proved the product rule det⁡(AB)=det⁡A⋅det⁡B\det(AB) = \det A \cdot \det B. Matrices became objects in their own right later, in the 1850s, when Cayley and Sylvester developed their theory.

The determinant caught on because it packed a yes or no question about solvability into one formula, and because it tied algebra to geometry. Once calculus moved to several variables, the determinant of the Jacobian became the rule for changing coordinates, and it has stayed in use ever since.

Check yourself

QuestionWhat is the determinant of the 2 by 2 matrix with rows (a, b) and (c, d)?Show answer

ad−bcad - bc. Multiply the main diagonal entries and subtract the product of the off-diagonal entries.

QuestionCompute the determinant of the matrix with rows (4, 7) and (2, 6).Show answer

det⁡=4⋅6−7⋅2=24−14=10\det = 4 \cdot 6 - 7 \cdot 2 = 24 - 14 = 10. The matrix scales area by 10 and keeps orientation.

QuestionWhy does swapping two rows change the sign of the determinant, but adding a multiple of one row to another does not?Show answer

Swapping rows reorders the permutations in the definition, and each swap of two positions flips the sign of a permutation. For a 2×22 \times 2 matrix you can see it directly: swapping the rows of (abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix} gives bc−ad=−(ad−bc)bc - ad = -(ad - bc). Adding a multiple of one row to another leaves the area of the parallelogram unchanged, because the parallelogram is sheared (slid sideways) with the same base and height, so the determinant is unchanged.

QuestionA 3 by 3 matrix A has determinant 0. What does this tell you about the system A x = b, and why?Show answer

AA is not invertible, so its columns are linearly dependent. Then there is a nonzero vector x\mathbf{x} with Ax=0A\mathbf{x} = \mathbf{0}, so if Ax=bA\mathbf{x} = \mathbf{b} has one solution it has infinitely many. For other choices of b\mathbf{b} there is no solution at all. In either case the system does not have exactly one solution.

QuestionA 3 by 3 matrix A has determinant 4. What is the determinant of 2A?Show answer

det⁡(2A)=23det⁡A=8⋅4=32\det(2A) = 2^3 \det A = 8 \cdot 4 = 32. Each of the three rows is doubled, and each doubling multiplies the determinant by 2.

Sources