9.5Matrix Operations and Applications
Add, subtract, and multiply matrices. Apply scalar multiplication. Understand dimension compatibility for multiplication (m×n · n×p = m×p) and the non-commutativity of matrix products.
Matrices are the language of linear algebra, computer graphics, machine learning, and data science. Matrix multiplication encodes linear transformations — the foundation of everything from 3D rendering to neural networks.
Essential Question
How does matrix multiplication encode a system of linear equations, and why is the order of multiplication critical — what does it mean that matrix multiplication is not commutative?
Lesson Overview
Matrix: a rectangular array of numbers with m rows and n columns (m×n matrix).
Entry notation: aᵢⱼ = entry in row i, column j.
Matrix equality: two matrices are equal iff they have the same dimensions and all corresponding entries are equal.
Matrix addition/subtraction: add/subtract corresponding entries (matrices must have the same dimensions).
Scalar multiplication: multiply every entry by the scalar k.
Matrix multiplication: A (m×n) · B (n×p) = C (m×p).
- Entry cᵢⱼ = (row i of A) · (column j of B) = Σ aᵢₖ bₖⱼ
- REQUIREMENT: number of columns of A = number of rows of B
- NOT commutative: AB ≠ BA in general
Special matrices:
- Zero matrix: all entries are 0.
- Identity matrix Iₙ: n×n matrix with 1s on diagonal, 0s elsewhere; AI = IA = A.
Encoding a system: Ax = b where A is the coefficient matrix, x is the variable vector, b is the constant vector.
Worked Examples
Given A = [[1,2],[3,4]] and B = [[5,6],[7,8]], find A+B, A−B, and 3A.
A+B: add corresponding entries → [[1+5, 2+6],[3+7, 4+8]] = [[6,8],[10,12]]
A−B: subtract corresponding entries → [[1−5, 2−6],[3−7, 4−8]] = [[−4,−4],[−4,−4]]
3A: multiply every entry by 3 → [[3·1, 3·2],[3·3, 3·4]] = [[3,6],[9,12]]
Find AB where A = [[1,2,3],[4,5,6]] (2×3) and B = [[7,8],[9,10],[11,12]] (3×2).
A is 2×3, B is 3×2 → result is 2×2.
c₁₁ = 1·7 + 2·9 + 3·11 = 7 + 18 + 33 = 58
c₁₂ = 1·8 + 2·10 + 3·12 = 8 + 20 + 36 = 64
c₂₁ = 4·7 + 5·9 + 6·11 = 28 + 45 + 66 = 139
c₂₂ = 4·8 + 5·10 + 6·12 = 32 + 50 + 72 = 154
Show AB ≠ BA for A = [[1,2],[3,4]] and B = [[0,1],[1,0]].
AB: c₁₁=1·0+2·1=2; c₁₂=1·1+2·0=1; c₂₁=3·0+4·1=4; c₂₂=3·1+4·0=3 → AB = [[2,1],[4,3]]
BA: c₁₁=0·1+1·3=3; c₁₂=0·2+1·4=4; c₂₁=1·1+0·3=1; c₂₂=1·2+0·4=2 → BA = [[3,4],[1,2]]
[[2,1],[4,3]] ≠ [[3,4],[1,2]], so AB ≠ BA.
Write the system 2x + 3y = 7, x − 4y = −2 as a matrix equation Ax = b.
Coefficient matrix A: row 1 = [2, 3], row 2 = [1, −4]
Variable vector x = [[x],[y]], constant vector b = [[7],[−2]]
Matrix equation: [[2,3],[1,−4]] · [[x],[y]] = [[7],[−2]]
Find x and y if [[2x+1, 3],[y−2, 5]] = [[7, 3],[4, 5]].
Set corresponding entries equal: 2x+1 = 7 and y−2 = 4.
2x+1 = 7 → 2x = 6 → x = 3
y−2 = 4 → y = 6
Guided Practice
Given A = [[2,−1],[0,3]] and B = [[1,4],[−2,1]], find A+B, A−B, and 2A−3B.
Hint: Perform each operation entry by entry.
Find AB where A = [[1,0],[2,1]] and B = [[3,1],[−1,2]].
Hint: Use the row-times-column rule for each entry.
Find BA for the same A and B as in problem 2. Is AB = BA?
Hint: Compare your answers from problems 2 and 3.
Write the system 3x − 2y + z = 5, x + y − z = 2, 2x + 3y + z = 8 as a matrix equation Ax = b.
Hint: The coefficient matrix A has the coefficients of x, y, z in each row.
Find x, y, z if [[x+y, 2z],[3, x−z]] = [[5, 4],[3, 1]].
Hint: Set corresponding entries equal and solve the resulting system.
Key Vocabulary
Matrix
A rectangular array of numbers with m rows and n columns.
Entry aᵢⱼ
The element in row i, column j of matrix A.
Dimensions
The size of a matrix, written as m×n (rows × columns).
Scalar multiplication
Multiplying every entry of a matrix by a constant.
Example: 3·[[1,2],[3,4]] = [[3,6],[9,12]]
Matrix multiplication
AB where entry cᵢⱼ = (row i of A)·(column j of B); requires columns of A = rows of B.
Example: (2×3)(3×2) = 2×2
Identity matrix Iₙ
The n×n matrix with 1s on the main diagonal and 0s elsewhere; AI = IA = A.
Example: I₂ = [[1,0],[0,1]]
Zero matrix
A matrix with all entries equal to 0.
Non-commutative
AB ≠ BA in general for matrices — order of multiplication matters.
Quick Check — Interactive Quiz
Interactive Practice — 5 Questions
A 3×4 matrix multiplied by a 4×2 matrix gives a matrix of size:
Matrix multiplication is:
The identity matrix I₂ is:
If A is 2×3 and B is 4×3, then AB is:
2 · [[1,3],[−2,0]] =
Common Mistakes
Multiplying matrices entry-by-entry (like addition).
Matrix multiplication uses the row-times-column dot product. Entry cᵢⱼ = (row i of A)·(column j of B).
Assuming AB = BA.
Matrix multiplication is NOT commutative. Always check — AB and BA may be different matrices (or one may not even be defined).
Multiplying matrices with incompatible dimensions.
For AB to be defined, the number of columns of A must equal the number of rows of B. Check dimensions first.
Confusing the order of rows and columns in the dimension notation.
An m×n matrix has m ROWS and n COLUMNS. The entry aᵢⱼ is in row i, column j.
Math Tips
Dimension check first: (m×n)(n×p) = m×p. The inner dimensions must match; the result has the outer dimensions.
The identity matrix is the matrix equivalent of the number 1: AI = IA = A for any compatible matrix A.
To encode a system Ax = b: A is the coefficient matrix, x is the column vector of variables, b is the column vector of constants.
Matrix addition is commutative (A+B = B+A) and associative. Matrix multiplication is associative but NOT commutative.
When computing AB, think of it as: each column of AB is A times the corresponding column of B.