IB Maths AI HLMatricesPaper 1 & 2Addition & multiplication~8 min read
Operations with Matrices
Adding and subtracting matrices is straightforward — same order, element-by-element. Multiplication is where matrices get interesting: the inner dimensions must match, the order of the factors matters, and the new entry in row i, column j comes from a row-times-column dot product.
📘 What you need to know
Addition / subtraction: matrices must have the same order; combine element by element.
Scalar multiplication: kA multiplies every entry by k; the order is unchanged.
Matrix multiplication: AB exists only if cols of A = rows of B; if A is m × n and B is n × p, then AB is m × p.
Entry (AB)i,j = row i of A · column j of B (dot product).
NOT commutative: in general AB ≠ BA. Multiplication is associative and distributive.
Powers of a square matrix: A2 = AA, A3 = AAA, …
Addition, subtraction and scalar multiplication
Two matrices of the same order can be added or subtracted by working entry-by-entry: (A ± B)i,j = ai,j ± bi,j. The result has the same order as the originals. Scalar multiplicationkA simply multiplies every entry by k.
Addition is commutative (A + B = B + A) and associative. The zero matrix is the additive identity: A + O = A. Subtraction is just adding the negative: A − B = A + (−B).
Matrix multiplication
Multiplication is the operation that makes matrices powerful — and also the one with the trickiest rules. First, AB only exists when the number of columns in A equals the number of rows in B. When it does, the result has the outer dimensions: an m × n times an n × p gives an m × p product.
Each entry (AB)i,j comes from multiplying the ith row of A by the jth column of B entry-by-entry and summing — a dot product.
Inner dimensions must match (the 3 in 2×3 times 3×2). The outer dimensions (2 and 2) give the order of the product. Every entry of AB is a row-times-column dot product.
Matrix multiplication: when and what shapeA(m × n) · B(n × p) = (AB)(m × p)inner dimensions must match; outer dimensions give the result
Properties and powers
Matrix multiplication satisfies most of the algebra you expect — but not commutativity. Switching the order of two matrices generally changes the answer (and sometimes even the very existence of the product). Useful identities you can rely on:
Properties of multiplication: associative A(BC) = (AB)C; distributive A(B+C) = AB + AC; identity AI = IA = A; zero AO = OA = O. But AB ≠ BA in general — never assume otherwise.
For a square matrix, powers are repeated multiplication by itself: A2 = AA, A3 = AAA, and so on. Non-square matrices have no well-defined powers, since AA wouldn’t be compatible.
🧠Recipe — multiplying two matrices
Check compatibility: the number of columns in A must equal the number of rows in B.
Find the order of the result: m × p (the outer dimensions).
For each entry (i, j): take row i of A and column j of B.
Multiply pairwise and add: pair the first row-entry with the first column-entry, the second with the second, …, and sum.
Repeat for every position of the result; check with your GDC if available.
Worked examples
WE 1
Addition and subtraction
Let A = ((3, −1), (2, 5)) and B = ((−2, 4), (1, −3)). Find A + B and A − B.
add element by elementA + B = ((3−2, −1+4), (2+1, 5−3)) = ((1, 3), (3, 2))subtract element by elementA − B = ((3+2, −1−4), (2−1, 5+3)) = ((5, −5), (1, 8))A + B = ((1, 3), (3, 2)) · A − B = ((5, −5), (1, 8))order matches the originals (2×2 in, 2×2 out).
WE 2
Scalar multiplication
Let A = ((4, −2, 1), (0, 5, −3)). Find 3A and −2A.
multiply every entry by the scalar3A = ((12, −6, 3), (0, 15, −9))−2A = ((−8, 4, −2), (0, −10, 6))3A and −2A as showna negative scalar flips the sign of every entry; the order stays 2×3.
WE 3
Compatibility check
Let A be 2 × 4, B be 4 × 3 and C be 3 × 2. State whether each product is defined and, if so, give its order: AB, BA, BC, CB.
check inner dimensions for eachAB: 2×4 · 4×3 ⇒ inner 4 = 4 ✓ → 2×3BA: 4×3 · 2×4 ⇒ inner 3 ≠ 2 ✗ not definedBC: 4×3 · 3×2 ⇒ inner 3 = 3 ✓ → 4×2CB: 3×2 · 4×3 ⇒ inner 2 ≠ 4 ✗ not definedAB: 2×3 · BC: 4×2 · BA, CB: not definedswitching the order can kill the product altogether — not just change the answer.
WE 4
AB versus BA — non-commutativity
Let A = ((2, 1), (3, 4)) and B = ((1, −1), (2, 3)). Find AB and BA, and verify they differ.
AB: row i of A times col j of BAB₁₁ = 2(1)+1(2) = 4; AB₁₂ = 2(−1)+1(3) = 1AB₂₁ = 3(1)+4(2) = 11; AB₂₂ = 3(−1)+4(3) = 9AB = ((4, 1), (11, 9))BA: row i of B times col j of ABA = ((−1, −3), (13, 14))AB = ((4,1),(11,9)) · BA = ((−1,−3),(13,14)) ⇒ AB ≠ BAorder matters — matrix multiplication is not commutative.
WE 5
2×3 times 3×2
Let A = ((1, 2, −1), (3, 0, 2)) and B = ((4, 1), (−2, 3), (5, −1)). Find AB.
Let A = ((1, 2), (3, 4)). (a) Find A2. (b) Find 2A − 3I, where I is the 2 × 2 identity. (c) Verify that AI = A.
(a) A² = AAA²₁₁ = 1(1)+2(3) = 7; A²₁₂ = 1(2)+2(4) = 10A²₂₁ = 3(1)+4(3) = 15; A²₂₂ = 3(2)+4(4) = 22A² = ((7, 10), (15, 22))(b) 2A = ((2, 4), (6, 8)); 3I = ((3, 0), (0, 3))2A − 3I = ((−1, 4), (6, 5))(c) AI computed entry-by-entryAI = ((1, 2), (3, 4)) = A ✓(a) ((7,10),(15,22)) · (b) ((−1,4),(6,5)) · (c) AI = Athe identity is to matrices what 1 is to numbers — multiplying by it changes nothing.
💡 Top tips
Check compatibility before computing: cols of A = rows of B. The order of the result is then outer × outer.
For each entry: row of left · column of right — written as a single sum of products.
(A + B)2 = A2 + AB + BA + B2 — notA2 + 2AB + B2, since AB ≠ BA in general.
Only square matrices have powers: A2 needs AA to be compatible.
Use your GDC to multiply larger matrices — faster, and a useful check by hand.
âš Common mistakes
Multiplying entry-by-entry — that’s not matrix multiplication; only addition and subtraction work that way.
Assuming AB = BA — matrix multiplication is non-commutative.
Forgetting the compatibility check — trying to multiply matrices whose inner dimensions don’t match.
Adding or subtracting matrices of different orders — not allowed.
Concluding A = O or B = O from AB = O — the zero-product rule does not carry over to matrices.
Next up: Determinants & Inverses — the determinant tells you whether a square matrix is invertible, and the inverse undoes matrix multiplication, just like 1/x undoes multiplication by x.
Need help with AI HL Matrices?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.