AB ≠ BA, and zero products
For square matrices of order 2, AB is usually not equal to BA, and AB = O is possible even when A ≠ O and B ≠ O.
Example 1: AB ≠ BA
If A = [1, 2; 0, 1] and B = [1, 0; 3, 1], find AB and BA.
- Rule: multiply row by column. (Matrices are written row by row, rows separated by semicolons.)
- AB, row 1: (1)(1) + (2)(3) = 7 and (1)(0) + (2)(1) = 2
- AB, row 2: (0)(1) + (1)(3) = 3 and (0)(0) + (1)(1) = 1
- So AB = [7, 2; 3, 1].
- BA, row 1: (1)(1) + (0)(0) = 1 and (1)(2) + (0)(1) = 2
- BA, row 2: (3)(1) + (1)(0) = 3 and (3)(2) + (1)(1) = 7
- So BA = [1, 2; 3, 7].
AB = [7, 2; 3, 1] and BA = [1, 2; 3, 7], so AB ≠ BA.
Example 2: non-zero matrices with a zero product
If A = [1, 2; 2, 4] and B = [2, −6; −1, 3], find AB and BA.
- Rule: multiply row by column.
- AB, row 1: (1)(2) + (2)(−1) = 0 and (1)(−6) + (2)(3) = 0
- AB, row 2: (2)(2) + (4)(−1) = 0 and (2)(−6) + (4)(3) = 0
- So AB = O, although A ≠ O and B ≠ O.
- BA, row 1: (2)(1) + (−6)(2) = −10 and (2)(2) + (−6)(4) = −20
- BA, row 2: (−1)(1) + (3)(2) = 5 and (−1)(2) + (3)(4) = 10
AB = O, but BA = [−10, −20; 5, 10] ≠ O.
Numbers vs square matrices
So never 'cancel' a matrix, and keep the order of every product exactly as given.
Example 3: why (A + B)² needs care
For A = [1, 2; 0, 1] and B = [1, 0; 3, 1] from Example 1, compare (A + B)² with A² + 2AB + B².
- Rule: (A + B)² = (A + B)(A + B) = A² + AB + BA + B².
- A + B = [2, 2; 3, 2], so (A + B)² = [4 + 6, 4 + 4; 6 + 6, 6 + 4] = [10, 8; 12, 10].
- A² = [1, 4; 0, 1] and B² = [1, 0; 6, 1].
- 2AB = 2[7, 2; 3, 1] = [14, 4; 6, 2].
- A² + 2AB + B² = [1 + 14 + 1, 4 + 4 + 0; 0 + 6 + 6, 1 + 2 + 1] = [16, 8; 12, 4].
- But A² + AB + BA + B² = [1 + 7 + 1 + 1, 4 + 2 + 2 + 0; 0 + 3 + 3 + 6, 1 + 1 + 7 + 1] = [10, 8; 12, 10], which matches.
(A + B)² = [10, 8; 12, 10], but A² + 2AB + B² = [16, 8; 12, 4]. They differ because AB ≠ BA.
When do matrices commute?
- Any square matrix A commutes with I and with O of the same order.
- A commutes with its own powers: A × A² = A² × A = A³.
- A commutes with any scalar matrix kI: A(kI) = (kI)A = kA.
- Two diagonal matrices of the same order always commute.
- Otherwise, assume AB ≠ BA unless you have checked.
Order matters in photo editing too: rotating a picture and then flipping it gives a different result from flipping first and then rotating. Editing apps use matrix products, and AB ≠ BA is the reason.
1 marks: “Give an example of two non-zero 2 × 2 matrices A and B with AB = O.” A = [1, 2; 2, 4] and B = [2, −6; −1, 3]. Every entry of AB works out to 0.
2 marks: “If A = [1, 1; 0, 2] and B = [2, 0; 1, 1], show that AB ≠ BA.” AB = [2 + 1, 0 + 1; 0 + 2, 0 + 2] = [3, 1; 2, 2]. BA = [2 + 0, 2 + 0; 1 + 0, 1 + 2] = [2, 2; 1, 3]. They differ, so AB ≠ BA.
3 marks: “If A and B are square matrices of the same order with AB = BA, prove that (A + B)² = A² + 2AB + B².” (A + B)² = (A + B)(A + B) = A(A + B) + B(A + B) = A² + AB + BA + B², by the distributive law. Since BA = AB, this is A² + 2AB + B².
Matrices are not numbers: order matters (AB ≠ BA), zero can hide (AB = O with A, B ≠ O), and you cannot cancel.