Defining Properties#
The determinant of a square matrix , written or , is a single number that packages invertibility, orientation, and volume scaling into one scalar. You do not need a formula first: three rules completely determine on every matrix, and every other property (including the cofactor formula and the product of pivots) follows from them.
Rule 1 — Identity. The determinant of the identity is one:
The standard basis has unit volume and the standard orientation, so the number assigned to is .
Rule 2 — Row exchange. Swapping any two rows of multiplies the determinant by :
A single swap flips orientation; an even number of swaps leaves the sign unchanged, and an odd number flips it.
Rule 3 — Linearity in each row. If you fix every row except row , the map that sends that row to is linear. Explicitly: if row is a sum , then is the sum of the two determinants obtained by putting or in row (other rows fixed). Scaling row by a scalar multiplies by .
These three rules are the whole axiomatic definition. From them you can derive further facts without a closed formula:
- If two rows are equal, (swap them and Rule 2 says the determinant equals its own negative).
- Adding a multiple of one row to another leaves unchanged (linearity plus the equal-row fact).
- A zero row forces (scale that row by ).
- if and only if is singular (not invertible) — elimination will produce a zero pivot, which we connect next.
The same three rules can be stated for columns instead of rows: the determinant is multilinear and alternating in the columns, and . In practice we use whichever view is convenient.
Determinant from Pivots#
Week 3 turned into an upper triangular matrix by elimination. Each elementary step either leaves the determinant unchanged or multiplies it by a known factor, so you can read off the pivots.
Recall the operations and their effect on :
| Elimination step | Effect on | | --- | --- | | Subtract a multiple of one row from another | No change | | Swap two rows | Multiply by | | Scale a row by | Multiply by (we rarely scale rows during plain elimination) |
After elimination without scaling, is upper triangular with the pivots on the diagonal. For a triangular matrix the determinant is the product of the diagonal entries (expand along the first column, or use multilinearity on the standard basis). Therefore
where the sign is raised to the number of row exchanges performed during elimination. Equivalently, if with a permutation matrix, then
since for unit lower triangular , and according as is an even or odd permutation.
Worked . For , elimination subtracts times row 1 from row 2 (no swap) and produces pivots and . So
The classical formula gives , matching.
Zero pivot means zero determinant. If elimination cannot produce a full set of nonzero pivots (even after all useful row exchanges), some diagonal entry of is zero, the product of pivots is zero, and . That is the algebraic test for singularity: is invertible if and only if .
The pivot product is the fastest way to compute a determinant by hand for small dense systems you already eliminate. The next section gives a recursive formula that does not require running elimination first.
Cofactor Expansion#
The cofactor expansion (Laplace expansion) expresses as a weighted sum of determinants of smaller matrices. Fix the first row for concreteness. For an matrix ,
where the cofactor of entry is
and the minor is the determinant of the matrix obtained by deleting row and column of . The sign pattern is the checkerboard of and starting with in the top-left corner.
You may expand along any row or column :
Choose a row or column with many zeros to shorten the arithmetic.
Full example. Expand
along the first row:
The third term is zero because . The remaining cofactors are
So
(Equivalently, writing the expansion with the minors visible: .)
Check via pivots. Eliminate without row swaps: subtract times row 1 from row 2 to get ; then add times the new row 2 to row 3. The pivots are , , and , and , matching the cofactor result.
Cofactor expansion is if applied naively to large ; for computation prefer elimination (product of pivots). For theory and small hand calculations — and for the characteristic polynomial in Week 9 — expansion is the right tool.
Compute det([[1,2,0],[3,1,1],[0,2,1]]) by cofactor expansion along the first row.
Cramer's Rule#
Cramer's rule solves a square system when is invertible, by writing each unknown as a ratio of two determinants. For each index , form the matrix by replacing column of with the right-hand side . Then
The formula is a direct consequence of multilinearity in the columns: the solution identity says is the linear combination of the columns of ; expanding and using alternating multilinear properties isolates .
Worked . Solve
We already have . Replace column 1 with :
so . Replace column 2 with :
so . Check: .
When to use it. Cramer's rule is excellent for systems and for theoretical arguments that need an explicit formula for . For it is usually slower than elimination: you compute determinants instead of one factorization. If , the rule does not apply — the system has either no solution or infinitely many, which Week 5 will classify by rank.
Determinant as Volume#
There is a geometric meaning that makes the algebraic rules intuitive. If the columns of an matrix are vectors in , they span a parallelepiped (a parallelogram when ). The absolute value of the determinant is the volume of that solid:
(The same statement holds with rows instead of columns.) The sign of encodes orientation: positive means the ordered basis has the same orientation as the standard basis; negative means it is mirrored (an odd number of reflections or row/column swaps).
Unit cube. The columns of are the standard unit vectors, which span the unit cube of volume , matching .
Axis-aligned box. If
the columns are edge vectors of lengths , , and along the coordinate axes. The box volume is , and .
Linear maps scale volume. Applying to any region multiplies -dimensional volume by . In particular, if , the image of the unit cube is flattened into a lower-dimensional set of volume zero — the columns are linearly dependent, and is singular. That is the geometric reason a zero determinant means “no inverse”: you cannot reverse a map that has crushed volume to zero.
This volume picture returns in change-of-variables formulas (Jacobians) and in continuous densities on configuration spaces. Algebraically, the same scalar will appear in Week 9 as the constant term structure of the characteristic polynomial .
Knowledge check#
Swapping two rows of a matrix does what to its determinant?
Browser lab#
Compute a determinant, verify the row-swap sign flip, and use it as a volume.
import numpy as np
A = np.array([[1., 2., 0.],
[3., 1., 1.],
[0., 2., 1.]])
print("det(A) =", np.linalg.det(A))
A_swapped = A.copy()
A_swapped[[0, 1]] = A_swapped[[1, 0]]
print("det after row swap =", np.linalg.det(A_swapped))
edges = np.array([[1., 0., 0.],
[0., 2., 0.],
[0., 0., 3.]])
print("box volume via det =", abs(np.linalg.det(edges)))