Product of two matrices
A shop has a price list for pens and books and a table of how many of each three customers bought. Multiplying the two tables gives each customer's bill.
AB is defined only if the number of columns of A equals the number of rows of B. If A is m × n and B is n × p then AB is m × p. The entry in row i, column j of AB is the sum of products of row i of A with column j of B.
Formula: (AB)ᵢⱼ = aᵢ₁ b₁ⱼ + aᵢ₂ b₂ⱼ + ... + aᵢₙ bₙⱼ
Rule 1: Multiply — Take a row of A and a column of B, multiply pairs, add.
- Easy: [1 2 ; 3 4] [5 ; 6] = [1×5 + 2×6 ; 3×5 + 4×6] = [17 ; 39].
- Medium: [1 2 ; 3 4] [5 6 ; 7 8] = [19 22 ; 43 50].
- Exam-type: [1 0 2 ; 3 1 1] [2 1 ; 0 3 ; 1 0] = [4 1 ; 7 6].
Rule 2: Check the order first — Inner numbers must match; outer numbers give the answer.
- Easy: (2 × 3)(3 × 4) gives a 2 × 4 matrix.
- Medium: (3 × 1)(1 × 3) gives a 3 × 3 matrix.
- Exam-type: (2 × 3)(2 × 3) is not defined because 3 is not 2.
Row of the first times column of the second, always in that order.
Multiplying entry by entry like addition; that is not matrix multiplication.
Inner numbers match, outer numbers survive: (m × n)(n × p) = m × p.
Practice questions
- 1A is 3 × 2 and B is 2 × 5. What is the order of AB?
- 2A is 2 × 3 and B is 2 × 3. Is AB defined?
- 3Find [2 3] [4 ; 5].
- 4Find [1 2 ; 0 1] [3 0 ; 1 2].
- 5Find [2 0 ; 1 3] [1 1 ; 2 0].
- 6For A = [1 2 ; 3 4] and B = [0 1 ; 1 0], find AB and BA.
- 7Find [1 2 3] [2 ; −1 ; 1].
- 8Find A² for A = [1 −1 ; 2 0].
Show answers (try them yourself first)
- 13 × 5
- 2No, columns of A (3) differ from rows of B (2)
- 3[2×4 + 3×5] = [23]
- 4[5 4 ; 1 2]
- 5[2 2 ; 7 1]
- 6AB = [2 1 ; 4 3] and BA = [3 4 ; 1 2], so AB is not BA
- 7[2 − 2 + 3] = [3]
- 8A² = [−1 −1 ; 2 −2]
Properties of matrix multiplication
Putting on socks and then shoes is not the same as shoes and then socks. Matrix multiplication also depends on the order.
Matrix multiplication is not commutative (AB may differ from BA), but it is associative: (AB)C = A(BC), and distributive: A(B + C) = AB + AC. For the identity, AI = IA = A. AB = O does not force A = O or B = O.
Formula: AI = IA = A, (AB)C = A(BC), AB ≠ BA in general
Rule 1: Show a property fails — One example is enough.
- Easy: A = [1 0 ; 0 0], B = [0 1 ; 0 0]: AB = [0 1 ; 0 0] but BA = [0 0 ; 0 0].
- Medium: A = [1 0 ; 0 0], B = [0 0 ; 0 1] give AB = O although A and B are not O.
- Exam-type: (A + B)² = A² + AB + BA + B², which equals A² + 2AB + B² only when AB = BA.
Rule 2: Compute powers — Multiply step by step and look for a pattern.
- Easy: A = [1 1 ; 0 1]: A² = [1 2 ; 0 1].
- Medium: Then A³ = [1 3 ; 0 1], so Aⁿ = [1 n ; 0 1].
- Exam-type: A = [0 1 ; 0 0] has A² = O.
Multiplying by I changes nothing; multiplying by O gives O.
Cancelling a common matrix factor, like turning AB = AC into B = C.
Order matters, grouping does not.
Practice questions
- 1Find A I for A = [3 5 ; 2 1].
- 2If AB = O for 2 × 2 matrices, must A = O or B = O?
- 3Find A² for A = [1 1 ; 0 1].
- 4Find A³ for A = [1 1 ; 0 1].
- 5Find A² for A = [0 1 ; 0 0].
- 6Find A² for A = [2 0 ; 0 3].
- 7For A = [1 2 ; 0 1] and B = [1 0 ; 3 1], find AB and BA. Are they equal?
- 8For A = [1 2 ; 0 1], find A² − 2A + I.
Show answers (try them yourself first)
- 1A itself, [3 5 ; 2 1]
- 2No; for example [1 0 ; 0 0] [0 0 ; 0 1] = O
- 3[1 2 ; 0 1]
- 4[1 3 ; 0 1]
- 5O = [0 0 ; 0 0]
- 6[4 0 ; 0 9]
- 7AB = [7 2 ; 3 1] and BA = [1 2 ; 3 7]; they are not equal
- 8A² = [1 4 ; 0 1], 2A = [2 4 ; 0 2], so A² − 2A + I = [0 0 ; 0 0]