haya.Learning made clear
Unit III · Matrices
8 min readConcept sheet1-mark MCQ or assertion-reason; 2-mark 'show that AB ≠ BA' or 'give an example' questions

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.

Non-commutativeIn general AB ≠ BA. When AB = BA we say A and B commute, e.g. A and I, or A and A².
Zero productAB = O does not force A = O or B = O. Example: A = [0, 1; 0, 0] ≠ O, but A² = O.
Square of a sum(A + B)² = A² + AB + BA + B². It equals A² + 2AB + B² only when AB = BA.
No cancellingAB = AC does not in general give B = C.

Example 1: AB ≠ BA

Problem

If A = [1, 2; 0, 1] and B = [1, 0; 3, 1], find AB and BA.

Working
  1. Rule: multiply row by column. (Matrices are written row by row, rows separated by semicolons.)
  2. AB, row 1: (1)(1) + (2)(3) = 7 and (1)(0) + (2)(1) = 2
  3. AB, row 2: (0)(1) + (1)(3) = 3 and (0)(0) + (1)(1) = 1
  4. So AB = [7, 2; 3, 1].
  5. BA, row 1: (1)(1) + (0)(0) = 1 and (1)(2) + (0)(1) = 2
  6. BA, row 2: (3)(1) + (1)(0) = 3 and (3)(2) + (1)(1) = 7
  7. So BA = [1, 2; 3, 7].
Answer

AB = [7, 2; 3, 1] and BA = [1, 2; 3, 7], so AB ≠ BA.

Example 2: non-zero matrices with a zero product

Problem

If A = [1, 2; 2, 4] and B = [2, −6; −1, 3], find AB and BA.

Working
  1. Rule: multiply row by column.
  2. AB, row 1: (1)(2) + (2)(−1) = 0 and (1)(−6) + (2)(3) = 0
  3. AB, row 2: (2)(2) + (4)(−1) = 0 and (2)(−6) + (4)(3) = 0
  4. So AB = O, although A ≠ O and B ≠ O.
  5. BA, row 1: (2)(1) + (−6)(2) = −10 and (2)(2) + (−6)(4) = −20
  6. BA, row 2: (−1)(1) + (3)(2) = 5 and (−1)(2) + (3)(4) = 10
Answer

AB = O, but BA = [−10, −20; 5, 10] ≠ O.

Numbers vs square matrices

Real numbersab = ba always. ab = 0 forces a = 0 or b = 0. If ab = ac and a ≠ 0, then b = c.
Square matricesAB ≠ BA in general. AB = O is possible with A ≠ O and B ≠ O. AB = AC with A ≠ O need not give B = C.

So never 'cancel' a matrix, and keep the order of every product exactly as given.

Example 3: why (A + B)² needs care

Problem

For A = [1, 2; 0, 1] and B = [1, 0; 3, 1] from Example 1, compare (A + B)² with A² + 2AB + B².

Working
  1. Rule: (A + B)² = (A + B)(A + B) = A² + AB + BA + B².
  2. A + B = [2, 2; 3, 2], so (A + B)² = [4 + 6, 4 + 4; 6 + 6, 6 + 4] = [10, 8; 12, 10].
  3. A² = [1, 4; 0, 1] and B² = [1, 0; 6, 1].
  4. 2AB = 2[7, 2; 3, 1] = [14, 4; 6, 2].
  5. A² + 2AB + B² = [1 + 14 + 1, 4 + 4 + 0; 0 + 6 + 6, 1 + 2 + 1] = [16, 8; 12, 4].
  6. 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.
Answer

(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.
In real life

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.

Exam angle

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².

Remember it

Matrices are not numbers: order matters (AB ≠ BA), zero can hide (AB = O with A, B ≠ O), and you cannot cancel.