Math explained
Matrices: how to multiply them, the 3×3 determinant, and Gaussian elimination to reduced row echelon form, each worked line by line
Matrix multiplication entry by entry, the 3×3 determinant by cofactors with the sign students drop, and Gaussian elimination to reduced row echelon form.
Three things are asked of every first-year linear algebra student: multiply two matrices (row of the first times column of the second, entry by entry), find a 3×3 determinant (expand along a row with alternating signs), and solve a linear system by row operations down to reduced row echelon form. Each has one fault that costs the mark: multiplying entry by entry, dropping the middle minus sign, and replacing the wrong row. Here is one of each, computed to the end, with the fault shown and its wrong answer beside the right one.
A note on notation. No typeset matrix is possible on this page, so a matrix is written row by row in one pair of brackets, a semicolon between rows: [1, 2; 3, 4] is the 2×2 matrix with first row 1, 2 and second row 3, 4. An augmented matrix carries a bar before its last column: [1, 2, −1 | 3].
Matrix multiplication: row times column
The rule for how to multiply matrices is one sentence. The entry in row i, column j of the product AB is row i of A dotted with column j of B: multiply the matching entries and add. It is the dot product applied over and over, once for each position in the answer.
Sizes decide whether the product exists. An m×n matrix times an n×p matrix gives an m×p matrix. The inner numbers must match, because a row of A has n entries and a column of B has n entries, and you cannot dot lists of different lengths. The outer numbers are the shape of the answer.
In the linear algebra course this is idea 17, matrix sums, scalar products and multiplication. Before it is idea 16, representing linear maps with matrices, which is why the product is defined this way: AB is the matrix of doing B first and then A, and the row-times-column rule is what makes that true. After it comes idea 18, matrix inverses. The determinant is ideas 23 and 24, and row reduction is ideas 1 and 6, so this page gathers three parts of the course that a test gathers too. No Ontario Grade 12 course covers matrices; a student arriving from MCV4U has met vectors and the dot product, and the first-year page says where linear algebra sits beside first-year calculus.
Worked example 1: a 2×2 product, entry by entry
Let A = [1, 2; 3, 4] and B = [0, 1; 5, −2]. Find AB and BA.
Line 1, entry (1, 1), row 1 of A dotted with column 1 of B: 1(0) + 2(5) = 0 + 10 = 10.
Line 2, entry (1, 2), row 1 of A with column 2 of B: 1(1) + 2(−2) = 1 − 4 = −3.
Line 3, entry (2, 1), row 2 of A with column 1 of B: 3(0) + 4(5) = 0 + 20 = 20.
Line 4, entry (2, 2), row 2 of A with column 2 of B: 3(1) + 4(−2) = 3 − 8 = −5.
Line 5, the product: AB = [10, −3; 20, −5].
Line 6, the other order, rows of B with columns of A: (1, 1): 0(1) + 1(3) = 3; (1, 2): 0(2) + 1(4) = 4; (2, 1): 5(1) + (−2)(3) = 5 − 6 = −1; (2, 2): 5(2) + (−2)(4) = 10 − 8 = 2. BA = [3, 4; −1, 2].
Not the same matrix. So the answer to "is matrix multiplication commutative" is no, and here is a pair that shows it.
The common wrong lines
Entrywise multiplication. A student multiplies each entry of A by the entry in the same place in B and writes [0, 2; 15, −8]. That is an operation, but it is not matrix multiplication, and it does not compose the two linear maps the matrices represent. The right answer has 10 in the corner, not 0; if your corner entry is a single product rather than a sum of products, you have multiplied entrywise.
Assuming AB = BA. Line 6 shows the two orders give different matrices. A student who computes BA when the question asked for AB has done the right procedure on the wrong problem, and the marker cannot give the mark. Read the order off the page before you start.
The 3×3 determinant by cofactor expansion
The determinant of a 3×3 matrix is found by expanding along a row (or a column). Along row 1:
det = a₁₁M₁₁ − a₁₂M₁₂ + a₁₃M₁₃,
where each M is the 2×2 determinant left when you delete that entry's row and column, and the 2×2 determinant of [a, b; c, d] is ad − bc. The signs alternate: plus, minus, plus. That middle minus is the one students drop.
Choose the row or column with the most zeros, because each zero entry kills a whole term. The diagonals trick some courses teach works only for 3×3 matrices; the cofactor expansion is the method that generalises, so it is the one worth learning.
Worked example 2: a 3×3 determinant, line by line
Let M = [2, 0, 1; 1, 3, −1; 0, 2, 4]. Find det M.
Row 1 has a zero in the middle, so expand along row 1.
Line 1, the first term, entry 2 times the minor with row 1 and column 1 deleted: 2 × det[3, −1; 2, 4] = 2 × (3(4) − (−1)(2)) = 2 × (12 + 2) = 2 × 14 = 28.
Line 2, the second term, with its minus sign, entry 0 times the minor with row 1 and column 2 deleted: −0 × det[1, −1; 0, 4] = −0 × 4 = 0.
Line 3, the third term, with its plus sign, entry 1 times the minor with row 1 and column 3 deleted: +1 × det[1, 3; 0, 2] = 1 × (1(2) − 3(0)) = 1 × 2 = 2.
Line 4, the sum: det M = 28 − 0 + 2 = 30.
What the number tells you, in one sentence: a determinant of zero means the matrix has no inverse and the system it represents has no unique solution; a nonzero determinant means it does, and the absolute value is the factor by which the matrix scales volume. Here 30 is nonzero, so M is invertible.
The common wrong lines
All plus signs. A student writes + + + instead of + − + and gets 28 + 0 + 2 = 30, the same answer, because the middle entry here is 0 and the dropped sign multiplied nothing. That is luck, not method. The sibling below has a nonzero middle entry, and there the same mistake gives −79 instead of 1. The cofactor signs alternate by position, whatever the entries are.
The 2×2 minors as ad + bc. A student computes the first minor as 3(4) + (−1)(2) = 10 instead of 12 − (−2) = 14, and the determinant comes out 2 × 10 − 0 + 1 × 2 = 22. The 2×2 determinant is a difference, ad − bc, and a double negative inside it becomes a plus, which is exactly where the slip hides.
Gaussian elimination to reduced row echelon form
Row operations rewrite a system without changing its solutions. There are three, and only three:
- Swap two rows.
- Multiply a row by a nonzero number.
- Add a multiple of one row to another row.
Gaussian elimination uses them to reach echelon form: each nonzero row has a leading entry with zeros below it, the staircase. Reduced row echelon form, RREF, goes further: each leading entry is 1 and the column above it is zeros too, so the solution can be read off the augmented column without back-substitution. In the linear algebra course the first is idea 1, Gauss' method, and the second is idea 6, Gauss-Jordan reduction and reduced echelon form.
Write each operation as a sentence before you do it, in the form "new row ← old row − 2 × other row". The row named on the left is the only row that changes. That sentence is the method; the arithmetic is what follows from it.
Worked example 3: one system, line by line
Solve the system x + 2y − z = 3, 2x + 3y + z = 8, −x + y + 2z = 1.
Line 1, the augmented matrix, one row per equation, the constants after the bar: R1 = [1, 2, −1 | 3], R2 = [2, 3, 1 | 8], R3 = [−1, 1, 2 | 1].
Line 2, clear the first column below the leading 1: R2 ← R2 − 2R1: [2 − 2, 3 − 4, 1 + 2 | 8 − 6] = [0, −1, 3 | 2]. R3 ← R3 + R1: [−1 + 1, 1 + 2, 2 − 1 | 1 + 3] = [0, 3, 1 | 4].
Line 3, make the second leading entry a 1: R2 ← −R2: [0, 1, −3 | −2].
Line 4, clear the second column below it, then scale the third row: R3 ← R3 − 3R2: [0, 3 − 3, 1 + 9 | 4 + 6] = [0, 0, 10 | 10]. R3 ← R3/10: [0, 0, 1 | 1]. Echelon form is reached, and the last row says z = 1.
Line 5, back up to reduced form, clearing above each leading 1: R2 ← R2 + 3R3: [0, 1, 0 | −2 + 3] = [0, 1, 0 | 1]. R1 ← R1 + R3: [1, 2, 0 | 3 + 1] = [1, 2, 0 | 4]. R1 ← R1 − 2R2: [1, 0, 0 | 4 − 2] = [1, 0, 0 | 2].
Line 6, the reduced row echelon form and the solution: [1, 0, 0 | 2], [0, 1, 0 | 1], [0, 0, 1 | 1], so x = 2, y = 1, z = 1. Check in every original equation: 2 + 2 − 1 = 3; 4 + 3 + 1 = 8; −2 + 1 + 2 = 1. All three hold.
The check in line 6 takes thirty seconds and catches every arithmetic slip in the five lines above it. Make it part of the method.
The common wrong lines
The result put into the wrong row. A student writes "R2 ← R2 − 2R1" and then replaces R1 with the result, because R1 was the row they multiplied. The operation changes exactly one row, the one named on the left of the arrow. Replacing R1 instead destroys the leading 1 and the system drifts away from its own solution.
The augmented column left behind. A student does R2 ← R2 − 2R1 on the three coefficients and forgets the constant, writing [0, −1, 3 | 8] instead of [0, −1, 3 | 2]. The bar is a visual aid, not a wall; the operation applies to the whole row, constant included.
Stopping at echelon form and calling it reduced. The matrix after line 4 is in echelon form, and it is enough to solve by back-substitution. It is not reduced: reduced needs zeros above every leading 1 as well, which is line 5. If the question says RREF, line 5 is part of the answer.
Siblings to try cold
Do all three with the page closed. Then check. Attempting before you look is chapter 1 of the free playbook, and testing yourself before you reread explains why the attempt, not the reading, is the learning.
- Multiply [2, 1; 0, 3] by [1, −1; 4, 2].
- Find the determinant of [1, 2, 3; 0, 1, 4; 5, 6, 0].
- Solve by row reduction: x + y + z = 6; 2y + 5z = −4; 2x + 5y − z = 27.
Check
- [6, 0; 12, 6].
- Along row 1: 1(0 − 24) − 2(0 − 20) + 3(0 − 5) = −24 + 40 − 15 = 1. With all plus signs it would be −24 − 40 − 15 = −79, so here the sign matters and the fault is visible.
- (x, y, z) = (5, 3, −2). Check: 5 + 3 − 2 = 6; 6 − 10 = −4; 10 + 15 + 2 = 27.
Where this sits in the course, and where it goes next
The linear algebra course opens with idea 1, Gauss' method, and idea 6, Gauss-Jordan reduction and reduced echelon form, because solving systems is what everything else is built to explain. Matrix multiplication is idea 17, after idea 16 (representing linear maps with matrices) and before idea 18 (matrix inverses). Determinants are ideas 23 and 24, after the chapters on vector spaces and maps.
Each procedure on this page is the first step of a later one. Matrix inverses (idea 18) come from row-reducing [A | I] until the left half is the identity, which is Worked example 3 with three constant columns instead of one. Cramer's rule (idea 24) solves a system by determinants, which is Worked example 2 repeated. Eigenvalues (idea 25) are the roots of a determinant with an unknown on the diagonal.
To learn them: one procedure at a time until each is automatic, then a mixed set where the question does not say which procedure it wants. Sweller and Cooper (1985) found that studying worked examples paired with problems teaches a procedure faster than unguided problem solving; worked examples, then practice problems has the order, and cognitive load is why one new procedure at a time is the limit.
Matrices on one screen
- Multiplication: entry (i, j) of AB is row i of A dotted with column j of B. An m×n times an n×p is m×p. AB ≠ BA in general. Entrywise multiplication is not matrix multiplication.
- The 3×3 determinant: expand along a row, each entry times its 2×2 minor, with signs + − +. The 2×2 determinant is ad − bc. Pick the row with the most zeros. Zero determinant means no inverse.
- The three row operations: swap two rows; multiply a row by a nonzero number; add a multiple of one row to another.
- The arrow rule: in "R2 ← R2 − 2R1", only R2 changes, and its constant changes with it.
- Echelon vs reduced: echelon has zeros below each leading entry; reduced also has leading 1s and zeros above them.
- The check: substitute the solution into every original equation.
Questions students ask
How do you multiply two matrices?
Each entry of the product is a row of the first matrix dotted with a column of the second: multiply matching entries and add. The number of columns in the first must equal the number of rows in the second, and the product has the first's row count and the second's column count.
Is matrix multiplication commutative?
No. AB and BA are usually different matrices, and one of them may not even be defined if the sizes do not match both ways. The page's 2×2 example gives [10, −3; 20, −5] one way and [3, 4; −1, 2] the other.
How do you find the determinant of a 3×3 matrix?
Expand along a row or column: each entry times the 2×2 determinant left when you delete its row and column, with signs alternating plus, minus, plus. Choose a row or column with a zero in it to save a term. The 2×2 determinant is ad − bc.
What is the difference between row echelon form and reduced row echelon form?
Echelon form has a leading entry in each nonzero row with zeros below it, which is enough to solve by back-substitution. Reduced form also makes each leading entry 1 and clears the zeros above it, so the solution can be read straight off the augmented column.
What does a zero determinant mean?
The matrix has no inverse, and the linear system it represents has either no solution or infinitely many rather than exactly one. Geometrically the matrix squashes space onto a lower dimension, so the volume scale factor is zero.
Put tonight's studying on rails
YSR Studies turns your notes, lectures and course into cards that come back before you forget, a tutor that makes you try first, and a map of what you know. Free, five hours a month, no card asked.
Read next
- MathVectors: magnitude, direction, the dot product and the cross product, worked on one pair, and which question wants which
- CoursesFirst-year calculus: what changes after high school, the 26 ideas in order, and how to study it week by week
- MethodsActive recall: how to study by testing yourself (five ways to do it tonight, and how to grade yourself honestly)
- How to studyWorked examples, practice problems and past exams: the order that teaches, and where to find them
Sources
- Hefferon, J. (2020). Linear Algebra, 4th edition. Chapter One (Linear Systems: Gauss's method, reduced echelon form), chapter Three (Maps Between Spaces: matrix operations), chapter Four (Determinants; section III, Laplace's Formula). Free under CC BY-SA 3.0 or GFDL.
- OpenStax (2021). Precalculus 2e, chapter 9, Systems of Equations and Inequalities, sections 9.5 Matrices and Matrix Operations and 9.6 Solving Systems with Gaussian Elimination. Houston: OpenStax. CC BY 4.0.
- Sweller, J., & Cooper, G. A. (1985). The use of worked examples as a substitute for problem solving in learning algebra. Cognition and Instruction, 2(1), 59–89. https://doi.org/10.1207/s1532690xci0201_3
- YSR Studies (2026). The linear algebra course map: Gauss' method is idea 1 of 26, Gauss-Jordan reduction idea 6, matrix multiplication idea 17, determinants ideas 23 and 24.