Computing a determinant
A square array of numbers holds a whole matrix. Is there one number that says whether its columns point in genuinely different directions, and how much room they span?
Where you are 12 in Matrices
When you reach for it
Every square matrix carries one number, its determinant. You compute it when you need to know whether the columns of the matrix point in genuinely different directions or collapse onto one line (for a 3 \times 3 matrix, onto one plane). That question decides whether a system with that coefficient matrix has exactly one solution, which you have met through row reduction; whether the matrix can be undone by an inverse; and whether Cramer’s rule applies. The determinant also measures something you can see: the area of the parallelogram the columns span.
The words come from Rows, columns and dimensions: rows, columns, entries a_{ij}, square matrices and I_2. Unlike adding matrices, which returns a matrix, a determinant returns a single number, and only a square matrix has one.
The procedure
The 2 by 2 determinant
For A = \begin{bmatrix} a & b \\ c & d \end{bmatrix},
Multiply the entries on the main diagonal, multiply the entries on the other diagonal, and subtract the second product from the first. Straight bars around the entries mean the determinant. Some books write |A|; those bars are not an absolute value, since a determinant can be negative.
Why this combination of the four entries? Read the columns of A as two arrows from the origin, (a, c) and (b, d).
What the number measures
Take a, b, c, d positive, placed as in the figure. The parallelogram with corners (0, 0), (a, c), (a + b, c + d) and (b, d) sits inside a rectangle a + b wide and c + d tall. The space between them splits into two triangles with legs a and c, two with legs b and d, and two rectangles b by c. So
That argument proves the formula only for the drawn case: all four entries positive, with (a, c) below (b, d) as in the figure. Other placements need different cuts, and each comes out to either ad - bc or its negative. We state the general result here without proving every case (a full proof comes with What the determinant means): the parallelogram spanned by the columns of A has area \lvert \det A \rvert, the absolute value of the determinant.
The sign records direction, again stated rather than proved here. Turn the first column toward the second through the angle less than 180^\circ: if that turn is counterclockwise, \det A > 0; if clockwise, \det A < 0. Swapping the columns gives bc - ad, the same size with the opposite sign.
That makes the determinant a signed area scale factor. The columns of I_2 are (1, 0) and (0, 1); they span the unit square, of area 1, and \det I_2 = 1 \cdot 1 - 0 \cdot 0 = 1. A matrix A puts its own columns in place of those two unit arrows, so the unit square becomes the parallelogram of the figure: area multiplied by \lvert \det A \rvert, and the picture flipped over when \det A < 0. Once matrices act on points through multiplication, What the determinant means follows this through.
A zero determinant
\det A = 0 exactly when the two columns are parallel: one is a multiple of the other. The parallelogram is then flat, with area 0.
If (b, d) = k(a, c), then ad - bc = a(kc) - (ka)c = 0. The other way, suppose ad - bc = 0. If a \neq 0, then \displaystyle d = \frac{bc}{a}, so \displaystyle (b, d) = \frac{b}{a}(a, c). If a = 0, then bc = 0: either c = 0, and the first column is the zero arrow, which is 0 times any arrow, or b = 0, and both columns lie on the vertical axis. Either way the columns are parallel. Because ad - bc does not change when b and c trade places (the transpose), a zero determinant also means the two rows are parallel.
The 3 by 3 determinant by cofactor expansion
The minor M_{ij} of an entry is the determinant of the 2 \times 2 matrix left when row i and column j are crossed out. Each position also carries a sign, (-1)^{i + j}, which makes a checkerboard:
To expand along a row, multiply each entry of that row by its minor, attach the checkerboard sign of its position, and add. Along row 1:
Any row gives the same number, so choose the row with the most zeros.
Why it works: the 3 \times 3 determinant is the sum of six products, each taking one entry from every row and every column,
Collect the terms holding each entry of row 1 and factor it out (the distributive property). The a_{11} terms give a_{11}(a_{22}a_{33} - a_{23}a_{32}) = a_{11}M_{11}. The a_{12} terms give -a_{12}(a_{21}a_{33} - a_{23}a_{31}) = -a_{12}M_{12}. The a_{13} terms give a_{13}(a_{21}a_{32} - a_{22}a_{31}) = a_{13}M_{13}. Grouping by row 2 or row 3 instead sorts the same six terms differently, and the checkerboard sign is exactly the sign each group needs.
As in two dimensions, \lvert \det A \rvert is the volume of the slanted box the three columns span, and \det A = 0 exactly when the three columns lie in one plane through the origin.
The diagonal shortcut, for 3 by 3 only
Copy the first two columns to the right of the matrix:
The three diagonals running down to the right are the three products added in the six-term formula; the three running up to the right are the three subtracted. The shortcut is that formula read off a picture, and it works for 3 \times 3 matrices only.
Worked examples
Three 2 by 2 determinants
Find each determinant.
Main diagonal product minus other diagonal product, keeping every sign inside its factor.
Subtracting a negative product adds, which is why the first two come out larger than either diagonal product alone.
The area of a parallelogram
Ifedayo plots P(1, 1), Q(6, 3), R(8, 8) and S(3, 6). Show PQRS is a parallelogram and find its area, and the area of triangle PQS.
SolutionThe sides from P are Q - P = (5, 2) and S - P = (2, 5). Also R - S = (5, 2) and R - Q = (2, 5), so opposite sides match and PQRS is a parallelogram. Sliding it so that P sits at the origin does not change its area, and then its sides are the arrows (5, 2) and (2, 5). Put them in as columns:
The area is 21. The diagonal QS cuts the parallelogram into two congruent triangles, so triangle PQS has area \displaystyle \frac{21}{2}.
The determinant is positive because turning from (5, 2) to (2, 5) is counterclockwise. Taking the columns in the other order gives 4 - 25 = -21: same area, opposite turn.
When the columns line up
For which values of k is \begin{vmatrix} k & 6 \\ 3 & k - 7 \end{vmatrix} = 0?
SolutionThe product is zero when k = 9 or k = -2. Check. At k = 9 the columns are (9, 3) and (6, 2), and \displaystyle (6, 2) = \frac{2}{3}(9, 3). At k = -2 they are (-2, 3) and (6, -9), and (6, -9) = -3(-2, 3). Both pairs are parallel, as a zero determinant requires.
Expanding a 3 by 3 along row 1
Find \det A for
Cross out row 1 and each column in turn to get the minors.
Row 1 carries the signs +, -, +:
The checkerboard minus on a_{12} and the entry’s own minus are separate signs, and both count.
Choosing the row with zeros
Find the determinant of
Row 2 has two zeros, and any row gives the determinant, so expand along it. Its signs are -, +, -. The zero entries contribute 0 whatever their minors are, which leaves only the entry 2 in position (2, 2), sign +. Crossing out row 2 and column 2:
One 2 \times 2 determinant instead of three.
The diagonal shortcut
Kayode finds the determinant of C = \begin{bmatrix} 1 & 3 & -2 \\ 4 & -1 & 0 \\ 2 & 5 & 3 \end{bmatrix} with the diagonal shortcut. Carry it out and check it by expansion.
SolutionCopy columns 1 and 2 to the right. The diagonals running down give
and the diagonals running up give
so \det C = -43 - 40 = -83. Check. Along row 1, M_{11} = -3, M_{12} = 12, M_{13} = 20 + 2 = 22, and 1(-3) - 3(12) + (-2)(22) = -3 - 36 - 44 = -83.
When a 3 by 3 determinant is zero
For which x is \det \begin{bmatrix} x & 1 & 0 \\ 3 & x & 2 \\ 0 & 1 & x \end{bmatrix} = 0?
SolutionExpand along row 1; its last entry is 0, so two terms remain.
Factor: x(x^2 - 5) = 0, so x = 0 or \displaystyle x = \pm\sqrt{5}. For these three values the columns lie in one plane through the origin. Check at x = 0: the columns are (0, 3, 0), (1, 0, 1) and (0, 2, 0), and the third is \displaystyle \frac{2}{3} of the first, so they are certainly flat.
Boundaries
- Only a square matrix has a determinant. A 2 \times 3 matrix has none.
- The bars in |A| mean determinant, not absolute value, and the value can be negative. The area is \lvert \det A \rvert.
- The area statement is about columns as arrows from the origin. For a parallelogram placed elsewhere, use the side arrows from one corner, as in Example 2.
- The diagonal shortcut holds for 3 \times 3 matrices only. A 4 \times 4 determinant is a sum of 24 products, and copying columns produces only 8 diagonals. Larger sizes use Determinants by cofactor expansion.
- A checkerboard sign belongs to the position, not to the entry; a negative entry in a + position keeps its own minus.
- The determinant does not split over addition: \det(I_2 + I_2) = \det(2I_2) = 4, while \det I_2 + \det I_2 = 2.
Where this goes next
The 2 \times 2 formula reappears at once in Inverse of a 2 by 2 matrix, and solving with it: the inverse divides by ad - bc, so it exists exactly when the determinant is not zero, which is the parallel-columns test from this lesson. Cramer's rule writes each unknown of a system as a ratio of two determinants. Determinants by cofactor expansion expands along any row or column and reaches any size, and Properties of determinants: row operations, products, transposes shows how row operations change the value, which is the fast way to compute a large determinant. What the determinant means makes the area and volume scale factor precise, and The cross product reuses the parallelogram.
Exercises
2 by 2 determinants
- \begin{vmatrix} 3 & 8 \\ 1 & 4 \end{vmatrix}
- \begin{vmatrix} -5 & 2 \\ 4 & -3 \end{vmatrix}
- \begin{vmatrix} 0 & -6 \\ 7 & 9 \end{vmatrix}
- \displaystyle \begin{vmatrix} \frac{3}{4} & -2 \\ \frac{1}{2} & 6 \end{vmatrix}
- \begin{vmatrix} x & x + 1 \\ x - 1 & x \end{vmatrix}
Area and zero determinants
- Find the area of the parallelogram spanned by the arrows (4, 1) and (2, 5).
- Find the area of the parallelogram with corners (0, 0), (6, -2), (7, 1) and (1, 3).
- Find the area of the triangle with vertices A(2, 1), B(7, 3) and C(4, 8).
- Find every k with \begin{vmatrix} k & 4 \\ 9 & k \end{vmatrix} = 0, and show the columns are parallel for each.
- Find \begin{vmatrix} 2 & -1 \\ -3 & 5 \end{vmatrix} and \begin{vmatrix} -1 & 2 \\ 5 & -3 \end{vmatrix}, and say what the signs tell you.
- Which of these have determinant 0? \begin{bmatrix} 6 & -4 \\ -9 & 6 \end{bmatrix}, \begin{bmatrix} 3 & 5 \\ 2 & 4 \end{bmatrix}, \begin{bmatrix} 0 & 0 \\ 7 & -2 \end{bmatrix}
3 by 3 determinants
- \begin{vmatrix} 1 & 2 & 0 \\ 3 & -1 & 4 \\ 2 & 0 & 1 \end{vmatrix}
- \begin{vmatrix} 2 & 0 & 0 \\ 5 & -3 & 0 \\ 1 & 4 & 7 \end{vmatrix}
- \begin{vmatrix} 3 & -2 & 1 \\ 0 & 0 & 5 \\ 4 & 1 & -2 \end{vmatrix}
- Use the diagonal shortcut: \begin{vmatrix} 2 & 1 & -1 \\ 3 & 4 & 2 \\ -1 & 5 & 1 \end{vmatrix}
- \begin{vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{vmatrix}
- Find x so that \begin{vmatrix} 2 & x & 1 \\ 1 & 3 & 0 \\ x & 1 & 1 \end{vmatrix} = 15.
Reasoning
- Show that swapping the two columns of a 2 \times 2 matrix changes the sign of its determinant, and explain it with the parallelogram.
- Show that a 2 \times 2 matrix with two equal rows has determinant 0, and say which line its columns lie on.
- Show that multiplying one column of a 2 \times 2 matrix by 3 multiplies the determinant by 3, and explain it with the parallelogram.
- Kayode says the triangle with vertices (0, 0), (a, c) and (b, d) has area \displaystyle \frac{1}{2}\lvert ad - bc \rvert. Explain why.
- Morenike says the diagonal shortcut should work for a 4 \times 4 matrix if she copies its first three columns. Explain why it cannot.
- Explain why a 3 \times 3 matrix with a row of zeros has determinant 0.
Answers
- 4. 3 \cdot 4 - 8 \cdot 1 = 12 - 8 = 4.
- 7. (-5)(-3) - 2 \cdot 4 = 15 - 8 = 7.
- 42. 0 \cdot 9 - (-6)(7) = 0 + 42 = 42.
- \displaystyle \frac{11}{2}. \displaystyle \frac{3}{4} \cdot 6 - (-2) \cdot \frac{1}{2} = \frac{9}{2} + 1 = \frac{11}{2}.
- 1, for every x. x^2 - (x + 1)(x - 1) = x^2 - (x^2 - 1) = 1.
- 18. Columns (4, 1) and (2, 5): 4 \cdot 5 - 2 \cdot 1 = 18.
- 20. The sides from the origin are (6, -2) and (1, 3), and (6, -2) + (1, 3) = (7, 1). \begin{vmatrix} 6 & 1 \\ -2 & 3 \end{vmatrix} = 18 + 2 = 20.
- \displaystyle \frac{31}{2}. B - A = (5, 2), C - A = (2, 7), \begin{vmatrix} 5 & 2 \\ 2 & 7 \end{vmatrix} = 35 - 4 = 31, and the triangle is half the parallelogram.
- k = 6 or k = -6. k^2 - 36 = 0. At k = 6 the columns are (6, 9) and \displaystyle (4, 6) = \frac{2}{3}(6, 9); at k = -6 they are (-6, 9) and \displaystyle (4, -6) = -\frac{2}{3}(-6, 9).
- 7 and -7. 10 - 3 = 7 and 3 - 10 = -7. The second matrix has the same columns in the other order: same area 7, opposite turning direction.
- The first and third. 36 - 36 = 0, with \displaystyle (-4, 6) = -\frac{2}{3}(6, -9); 12 - 10 = 2; 0 \cdot (-2) - 0 \cdot 7 = 0, with the columns (0, 7) and (0, -2) both on the vertical axis.
- 9. 1(-1 - 0) - 2(3 - 8) + 0 = -1 + 10 = 9.
- -42. Along row 1 only 2 survives: 2\begin{vmatrix} -3 & 0 \\ 4 & 7 \end{vmatrix} = 2(-21) = -42, the product of the diagonal.
- -55. Along row 2 only the 5 in position (2, 3) survives, sign -: -5\begin{vmatrix} 3 & -2 \\ 4 & 1 \end{vmatrix} = -5(3 + 8) = -55.
- -36. Down: 8 - 2 - 15 = -9. Up: 4 + 20 + 3 = 27. -9 - 27 = -36.
- 0. Along row 1, 1(45 - 48) - 2(36 - 42) + 3(32 - 35) is -3 + 12 - 9 = 0. The columns lie in one plane: the middle column is the average of the outer two.
- x = -2. Along row 1: 2(3 - 0) - x(1 - 0) + 1(1 - 3x) = 7 - 4x, and 7 - 4x = 15 gives x = -2.
- \begin{vmatrix} b & a \\ d & c \end{vmatrix} = bc - ad = -(ad - bc). The two columns span the same parallelogram, so the area is unchanged, but the turn from the first column to the second now runs the other way.
- \begin{vmatrix} a & b \\ a & b \end{vmatrix} = ab - ba = 0. The columns are (a, a) and (b, b), both on the line y = x.
- \begin{vmatrix} 3a & b \\ 3c & d \end{vmatrix} = 3ad - 3bc = 3(ad - bc). One side of the parallelogram becomes three times as long while the height measured to that side stays the same, so the area triples.
- The arrows (a, c) and (b, d) span a parallelogram of area \lvert ad - bc \rvert, and its diagonal from (a, c) to (b, d) cuts it into two congruent triangles, one of which is Kayode’s.
- Each product in a determinant takes one entry from every row and every column. A 4 \times 4 matrix has 4 \cdot 3 \cdot 2 \cdot 1 = 24 such products, but copying columns gives only 4 diagonals down and 4 up, 8 in all, so most of the products are missing.
- Expand along the zero row: each of its three terms is 0 times a minor, so the sum is 0. In the picture, every column then has a 0 in that position, so all three lie in one plane.