Femtobytes
Problem type

Determinant of a matrix

What it solves
Find the determinant of a 2 by 2, 3 by 3 or 4 by 4 matrix: by cofactor expansion with every small determinant worked out, and by row reduction to a triangle, with the two answers checked against each other.
Subject
Linear Algebra
Topic
Determinants and inverses
Also called
det, cofactor expansion, Laplace expansion
Your problem

Find the determinant of this matrix.

det⁡[2−13041−256]\det \left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & 4 & 1 \\ -2 & 5 & 6 \end{array} \right]
The square matrix
Size3
Whole numbers or fractions. 2 by 2, 3 by 3 or 4 by 4.
Invent a new one:
The problem

Find the determinant of this matrix.

det⁡[2−13041−256]\det \left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & 4 & 1 \\ -2 & 5 & 6 \end{array} \right]
The result
det⁡[2−13041−256]=64\det \left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & 4 & 1 \\ -2 & 5 & 6 \end{array} \right] = 64

The determinant is not 00, so the matrix has an inverse.

checked 26 lines of this solution were evaluated with exact arithmetic before it was shown to you. A solution with a false line is never served.
Picture 1 of 8Step 1: Say what the determinant measures
What the determinant measures
22−1-133004411−2-25566
The rows of this matrix, read as arrows from the origin, span a box. The determinant is how much that box is scaled when the matrix acts, and a determinant of zero means the box has been flattened to nothing.
1

Say what the determinant measures

Why this step

A formula for the determinant can be memorised in a minute and forgotten in a week. What stays is knowing what the number MEANS, because the meaning explains every rule about it: why a swap flips its sign, why a zero determinant means no inverse, why it multiplies when matrices multiply.

det⁡[2−13041−256]\det \left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & 4 & 1 \\ -2 & 5 & 6 \end{array} \right]
The quantity we are asked for.
2

Expand along the first row

Why this step

A 3×33 \times 3 determinant is built from three 2×22 \times 2 ones, which we already know how to do. Each entry of the first row is paired with the small determinant left when its own row and column are struck out. The signs alternate +,−,++, -, +; they are not decoration: they are what makes the answer flip sign when two rows are swapped, as any measure of orientation must.

Strike out row 11 and column 11. What is left is M1=[4156]M_{1} = \left[ \begin{array}{rr} 4 & 1 \\ 5 & 6 \end{array} \right], and its determinant is:

det⁡M1\displaystyle \det M_{1}==4⋅6−1⋅5\displaystyle 4 \cdot 6 - 1 \cdot 5
For a 2×22 \times 2 matrix: the product down the main diagonal minus the product up the other diagonal. checked
==24−5\displaystyle 24 - 5
Do the two multiplications. checked
==19\displaystyle 19
Subtract. Subtracting a negative number adds. checked

Strike out row 11 and column 22. What is left is M2=[01−26]M_{2} = \left[ \begin{array}{rr} 0 & 1 \\ -2 & 6 \end{array} \right], and its determinant is:

det⁡M2\displaystyle \det M_{2}==0⋅6−1⋅(−2)\displaystyle 0 \cdot 6 - 1 \cdot \left( -2 \right)
For a 2×22 \times 2 matrix: the product down the main diagonal minus the product up the other diagonal. checked
==0−(−2)\displaystyle 0 - \left( -2 \right)
Do the two multiplications. checked
==2\displaystyle 2
Subtract. Subtracting a negative number adds. checked

Strike out row 11 and column 33. What is left is M3=[04−25]M_{3} = \left[ \begin{array}{rr} 0 & 4 \\ -2 & 5 \end{array} \right], and its determinant is:

det⁡M3\displaystyle \det M_{3}==0⋅5−4⋅(−2)\displaystyle 0 \cdot 5 - 4 \cdot \left( -2 \right)
For a 2×22 \times 2 matrix: the product down the main diagonal minus the product up the other diagonal. checked
==0−(−8)\displaystyle 0 - \left( -8 \right)
Do the two multiplications. checked
==8\displaystyle 8
Subtract. Subtracting a negative number adds. checked
3

Combine the three pieces with their signs

Why this step

Each first-row entry multiplies its own small determinant, and the middle term carries a minus sign. This is the step where most slips happen, because two minus signs often meet: the pattern's minus and a negative entry or a negative small determinant. So we write every sign out.

det⁡A\displaystyle \det A==2⋅19−(−1⋅2)+3⋅8\displaystyle 2 \cdot 19 - \left( -1 \cdot 2 \right) + 3 \cdot 8
det⁡A=a11det⁡M1−a12det⁡M2+a13det⁡M3\det A = a_{11} \det M_1 - a_{12} \det M_2 + a_{13} \det M_3, with the numbers put in. checked
==38+2+24\displaystyle 38 + 2 + 24
Do each multiplication, keeping its sign. checked
==64\displaystyle 64
Add. checked
4

Check by a completely different method: reduce to a triangle

Why this step

The expansion had a dozen small multiplications and several sign decisions. A second method that shares none of them is the honest way to check it. For a triangular matrix (zeros below the diagonal) the determinant is simply the product of the diagonal, so we row reduce to a triangle, keeping track of what each move does to the determinant.

5

Pivot 1: column 1, row 1

Why this step

We work one column at a time, left to right. The goal for a column is zeros BELOW its pivot; the pivot itself may be any number that is not zero. We deliberately never multiply a row by a number here, because that would multiply the determinant too. The two moves we do use have the simplest possible effect on a determinant: a swap flips its sign, and adding a multiple of one row to another leaves it untouched.

Replace row 3 by R3+R1R_{3} + R_{1}. The multiplier is chosen so that the entry under attack, −2-2, is cancelled exactly by the pivot: −2+1⋅2=0-2 + 1 \cdot 2 = 0.

columnworkingnew entry
11−2+1⋅2-2 + 1 \cdot 200
225+1⋅(−1)5 + 1 \cdot \left( -1 \right)44
336+1⋅36 + 1 \cdot 399
Row 3, entry by entry: old entry plus the multiple of row 1.
[2−13041049]\left[ \begin{array}{rrr} \boxed{2} & -1 & 3 \\ 0 & 4 & 1 \\ 0 & 4 & 9 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
6

Pivot 2: column 2, row 2

Why this step

The same job for the next column. Working left to right matters: the rows we use now already have zeros in the earlier pivot columns, so clearing this column cannot spoil the columns already finished. That is why the method never has to go back.

Replace row 3 by R3−R2R_{3} - R_{2}. The multiplier is chosen so that the entry under attack, 44, is cancelled exactly by the pivot: 4−1⋅4=04 - 1 \cdot 4 = 0.

columnworkingnew entry
110−1⋅00 - 1 \cdot 000
224−1⋅44 - 1 \cdot 400
339−1⋅19 - 1 \cdot 188
Row 3, entry by entry: old entry minus the multiple of row 2.
[2−13041008]\left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & \boxed{4} & 1 \\ 0 & 0 & 8 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
7

Pivot 3: column 3, row 3

Why this step

The same job for the next column. Working left to right matters: the rows we use now already have zeros in the earlier pivot columns, so clearing this column cannot spoil the columns already finished. That is why the method never has to go back.

The pivot is already 11 and the rest of its column is already zero, so there is nothing to do for this column.

[2−13041008]\left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & 4 & 1 \\ 0 & 0 & \boxed{8} \end{array} \right]
The matrix as it stands, with this pivot boxed. checked
8

Multiply down the diagonal

Why this step

Below the diagonal everything is now zero, so in the expansion of this determinant every product except the one down the diagonal contains a zero and vanishes. All that remains is to multiply the diagonal and account for the row swaps we made on the way.

[2−13041008]\left[ \begin{array}{rrr} 2 & -1 & 3 \\ 0 & 4 & 1 \\ 0 & 0 & 8 \end{array} \right]
The triangular matrix the reduction arrived at. checked
product of the diagonal\displaystyle \text{product of the diagonal}==2⋅4⋅8\displaystyle 2 \cdot 4 \cdot 8
The diagonal entries, multiplied together. checked
==64\displaystyle 64
Multiply. checked

We made no row swaps, so the sign is unchanged and the determinant is 6464.