A matrix is a rectangular table of numbers arranged in rows and columns. Matrices organise data, such as marks of students in several subjects, and they make it possible to solve many equations at once. Computer graphics, economics, physics and machine learning all depend on them. This lesson covers matrix types and operations, multiplication, the determinant, the inverse of a 2 × 2 matrix, and solving simultaneous equations with matrices and Cramer’s rule.
In this lesson you will learn
- Matrix order, elements and special types
- Adding, subtracting and scalar multiplication
- Multiplying matrices and why AB ≠ BA
- Determinants of 2 × 2 and 3 × 3 matrices
- The inverse of a 2 × 2 matrix and solving equations
You should know simultaneous linear equations.
Order and Types
A matrix with m rows and n columns has order m × n. The element in row i, column j is written aᵢⱼ.
| Type | Description | Example |
|---|---|---|
| Row matrix | One row | [2 5 7] |
| Column matrix | One column | [3; 1] (written vertically) |
| Square matrix | Same number of rows and columns | 2 × 2, 3 × 3 |
| Zero (null) matrix O | All elements 0 | [0 0; 0 0] |
| Identity matrix I | 1s on the main diagonal, 0 elsewhere | [1 0; 0 1] |
| Transpose Aᵀ | Rows become columns | [1 2; 3 4]ᵀ = [1 3; 2 4] |
In this lesson, [a b; c d] means a 2 × 2 matrix with first row a, b and second row c, d.
Adding and Scalar Multiplication
A = [2 1; 3 4] B = [1 0; −2 5]
A + B = [3 1; 1 9] add matching elements (same order needed)
A − B = [1 1; 5 −1]
3A = [6 3; 9 12] multiply every element by 3
Matrix Multiplication
To multiply A (m × n) by B (n × p), the number of columns of A must equal the number of rows of B. The result is m × p. Each element is a row of A times a column of B: multiply matching entries and add.
AB = [2 1; 3 4] × [1 0; −2 5]
row 1 · col 1: 2(1) + 1(−2) = 0 row 1 · col 2: 2(0) + 1(5) = 5
row 2 · col 1: 3(1) + 4(−2) = −5 row 2 · col 2: 3(0) + 4(5) = 20
AB = [0 5; −5 20]
BA = [1 0; −2 5] × [2 1; 3 4] = [2 1; 11 18] so AB ≠ BA
Matrix multiplication is not commutative: the order matters. Multiplying by the identity leaves a matrix unchanged: AI = IA = A.
Determinants
2 × 2: det [a b; c d] = ad − bc
det [2 1; 3 4] = 8 − 3 = 5
3 × 3 (expand along the first row, with signs + − +):
| 1 2 3 |
| 0 4 5 | = 1(4·6 − 5·0) − 2(0·6 − 5·1) + 3(0·0 − 4·1)
| 1 0 6 | = 24 + 10 − 12 = 22
A matrix whose determinant is 0 is called singular: it has no inverse. Geometrically, the determinant of a 2 × 2 matrix gives the area scale factor of the transformation it represents.
The Inverse of a 2 × 2 Matrix
Inverse
If A = [a b; c d] and det A ≠ 0, then A⁻¹ = (1/det A) × [d −b; −c a]. It satisfies AA⁻¹ = A⁻¹A = I.
A = [2 1; 3 4], det A = 5
A⁻¹ = (1/5) [4 −1; −3 2]
Check: A × A⁻¹ = (1/5)[2·4 + 1·(−3) 2·(−1) + 1·2; 3·4 + 4·(−3) 3·(−1) + 4·2]
= (1/5)[5 0; 0 5] = [1 0; 0 1] ✓
In words: swap a and d, change the signs of b and c, and divide by the determinant.
Solving Simultaneous Equations
2x + 3y = 12
x − y = 1
Matrix form: [2 3; 1 −1] [x; y] = [12; 1]
Cramer's rule:
D = det [2 3; 1 −1] = −2 − 3 = −5
Dx = det [12 3; 1 −1] = −12 − 3 = −15 x = Dx / D = 3
Dy = det [2 12; 1 1] = 2 − 12 = −10 y = Dy / D = 2
Dx replaces the x-column with the constants, and Dy replaces the y-column. If D = 0, the equations have either no solution or infinitely many.
Common Mistakes
- Multiplying element by element. Matrix multiplication is row × column.
- Assuming AB = BA.
- Multiplying matrices of incompatible orders, such as (2 × 3)(2 × 3).
- Forgetting the alternating signs (+ − +) when expanding a 3 × 3 determinant.
Practice Exercises
Exercise 1. Find det [5 2; 7 3] and the inverse of the matrix.
Show answer
det = 15 − 14 = 1. Inverse = [3 −2; −7 5].
Exercise 2. For which value of k is [k 4; 2 2] singular?
Show answer
2k − 8 = 0, so k = 4.
Exercise 3. Use Cramer’s rule to solve 3x + 2y = 7 and x − y = −1.
Show answer
D = −3 − 2 = −5. Dx = det [7 2; −1 −1] = −7 + 2 = −5, so x = 1. Dy = det [3 7; 1 −1] = −3 − 7 = −10, so y = 2.
Frequently Asked Questions
Where are matrices used in real life?
Computer graphics use them to rotate, scale and move images; search engines and machine learning models multiply huge matrices; economists use them to model how industries depend on each other.
How is the inverse of a 3 × 3 matrix found?
By finding the matrix of cofactors, transposing it to get the adjoint, and dividing by the determinant. This is part of the HSC syllabus and follows the same idea as the 2 × 2 rule.
Summary
- An m × n matrix has m rows and n columns; add matrices of the same order element by element.
- Multiply row by column; the inner orders must match, and AB is usually not BA.
- det [a b; c d] = ad − bc; a zero determinant means no inverse.
- A⁻¹ = (1/det) [d −b; −c a]; Cramer’s rule solves simultaneous equations with determinants.
