NEETJEE.guru
MathematicsJEE

Why Matrix Multiplication Is Not Commutative (AB ≠ BA)

By Admin 13 November 2026 Updated 27 November 2026 11 min read 8 views
On this page· 13 sections
Overview

Source & scope. Class 12 Mathematics, Chapter 3 Matrices, Section 3.4.5, the sub-topic Non-commutativity of multiplication of matrices. Builds on: Multiplication of Matrices: Definition and the Rule for When AB Is Defined. Next: [Zero Matrix as the Product of Two Non-Zero Matrices](/study-materials/...

Source & scope. Class 12 Mathematics, Chapter 3 Matrices, Section 3.4.5, the sub-topic Non-commutativity of multiplication of matrices. Builds on: Multiplication of Matrices: Definition and the Rule for When AB Is Defined. Next: [Zero Matrix as the Product of Two Non-Zero Matrices](/study-materials/math12-ch03-zero-matrix-as-product-of-nonzero-matrices), another "matrices don't behave like numbers" result from the same section.

Matrix multiplication is, in general, not commutative — even when both AB and BA are defined and have the same order, AB need not equal BA. This is a fundamental difference from multiplying ordinary numbers, where ab always equals ba, and it must be checked explicitly rather than assumed in any matrix calculation.

At a glance

  • In general, , even when both products are defined.
  • AB and BA can differ because they have different orders (one case), or because they have the same order but different entries (a second, stronger case).
  • NCERT verifies non-commutativity with two separate worked examples (Example 13 and Example 14).
  • Exception: diagonal matrices of the same order do commute — AB = BA for them.
  • A frequent JEE trap is assuming matrices behave like ordinary numbers under multiplication.

Learning objectives

  • State that matrix multiplication is not commutative in general, i.e., AB ≠ BA.
  • Distinguish the two ways AB and BA can fail to match: different orders, or same order with different entries.
  • Verify AB ≠ BA numerically for two different pairs of matrices.
  • Identify diagonal matrices of the same order as a named exception where multiplication does commute.

Prerequisite knowledge

The reader should already understand how to compute a matrix product AB using the row-times-column rule, and when AB and BA are each individually defined (see the linked prerequisite article), before comparing the two products to each other.

Core explanation

The core idea. For ordinary real numbers a and b, ab = ba always — multiplication of numbers is commutative. Matrix multiplication does not carry this property over: even when both AB and BA are defined, it is not necessary that AB = BA. This has to be checked case by case; it can never be assumed.

Case 1 — AB and BA have different orders entirely. If A is 2×3 and B is 3×2, then AB is a 2×2 matrix while BA is a 3×3 matrix — they cannot possibly be equal, since equal matrices must first have the same order (see Equality of Matrices). This alone is enough to show AB ≠ BA whenever A and B are non-square and "mismatched" in this way.

Case 2 — AB and BA have the same order, but still differ. A sceptical reader might think AB and BA could still turn out equal whenever they happen to land on the same order (for instance, when A and B are both square matrices of the same size). NCERT shows this is false too, with a second, independent example using two 2×2 matrices.

The diagonal-matrix exception. Non-commutativity is the general rule, not a universal one — NCERT explicitly notes that this does not mean AB ≠ BA for every pair of matrices for which both products are defined. In particular, multiplication of diagonal matrices of the same order is commutative: if A and B are both diagonal matrices of the same order, then AB = BA always. This exception is a common reverse-trap in true/false exam questions ("all diagonal matrices commute under multiplication" — true), so it is worth remembering alongside the main non-commutativity result.

Key terms

  • Commutative — an operation where the order of the two inputs doesn't change the result (true for ab with numbers; false for AB with matrices in general).
  • — the general statement that matrix multiplication does not commute.
  • Order mismatch — one way AB and BA can differ: they simply have different shapes (rows × columns).
  • Diagonal matrix exception — the named case where AB = BA always holds: A and B both diagonal matrices of the same order.

Diagram / figure guidance

Draw two small panels side by side. In the left panel, show A (2×3) and B (3×2) feeding into AB (2×2) in one direction and BA (3×3) in the other, with a large "≠" between the two differently-sized result grids. In the right panel, show two diagonal 2×2 matrices A and B with only their leading-diagonal cells shaded, feeding into AB and BA that land on the identical 2×2 grid, with an "=" sign between them, to visually contrast the general case against the diagonal exception.

Worked example

(NCERT Example 13 — the primary worked example.) If A = [[1, −2, 3], [−4, 2, 5]] and B = [[2, 3], [4, 5], [2, 1]], find AB and BA, and show AB ≠ BA.

Setup. A is a 2×3 matrix and B is a 3×2 matrix, so both AB and BA are defined, with AB of order 2×2 and BA of order 3×3.

Computing AB (row of A times column of B):

  • (1,1): 1(2) + (−2)(4) + 3(2) = 2 − 8 + 6 = 0
  • (1,2): 1(3) + (−2)(5) + 3(1) = 3 − 10 + 3 = −4
  • (2,1): (−4)(2) + 2(4) + 5(2) = −8 + 8 + 10 = 10
  • (2,2): (−4)(3) + 2(5) + 5(1) = −12 + 10 + 5 = 3

Computing BA (row of B times column of A):

  • (1,1): 2(1) + 3(−4) = 2 − 12 = −10
  • (1,2): 2(−2) + 3(2) = −4 + 6 = 2
  • (1,3): 2(3) + 3(5) = 6 + 15 = 21
  • (2,1): 4(1) + 5(−4) = 4 − 20 = −16
  • (2,2): 4(−2) + 5(2) = −8 + 10 = 2
  • (2,3): 4(3) + 5(5) = 12 + 25 = 37
  • (3,1): 2(1) + 1(−4) = 2 − 4 = −2
  • (3,2): 2(−2) + 1(2) = −4 + 2 = −2
  • (3,3): 2(3) + 1(5) = 6 + 5 = 11

Conclusion. AB is a 2×2 matrix and BA is a 3×3 matrix — different orders entirely — so immediately, without even needing to compare individual entries.

A second illustration (NCERT Example 14), where AB and BA share the same order. Let A = [[1, 0], [0, −1]] and B = [[0, 1], [1, 0]]. Both are 2×2, so AB and BA are both 2×2 — the same order this time.

  • AB: (1,1) = 1(0)+0(1) = 0; (1,2) = 1(1)+0(0) = 1; (2,1) = 0(0)+(−1)(1) = −1; (2,2) = 0(1)+(−1)(0) = 0. So .
  • BA: (1,1) = 0(1)+1(0) = 0; (1,2) = 0(0)+1(−1) = −1; (2,1) = 1(1)+0(0) = 1; (2,2) = 1(0)+0(−1) = 0. So .

Even though AB and BA are both 2×2 here, their entries differ in positions (1,2) and (2,1) — even at matching orders. This confirms that matching order never guarantees matching products.

Common misconceptions

  • "If AB and BA end up the same order, they must be equal." False — NCERT's Example 14 shows two 2×2 matrices where AB = [[0,1],[−1,0]] and BA = [[0,−1],[1,0]] are different matrices despite sharing the same 2×2 order.
  • "AB ≠ BA for every single pair of matrices." Not quite — diagonal matrices of the same order always satisfy AB = BA; non-commutativity is the general rule, not a universal one.
  • "Matrix multiplication behaves exactly like multiplying real numbers." It does not — ab = ba always for real numbers, but AB and BA can differ in order, in entries, or both, for matrices.
  • "Only non-square matrices fail to commute." Square matrices of the same order can also fail to commute, as Example 14 shows with two 2×2 matrices; squareness guarantees both products are defined and share an order, but not that they're equal.

Exam application (JEE)

JEE regularly tests non-commutativity directly — "evaluate AB and BA and compare" problems — and also tests it as a conceptual true/false or assertion-reasoning item ("AB = BA for all square matrices A, B" is false; "AB = BA for diagonal matrices of the same order" is true). The diagonal-matrix exception is a favourite reverse-trap: students who over-generalise "matrices never commute" can be caught out by a question built entirely on diagonal matrices, so always check whether the matrices involved are diagonal before assuming AB ≠ BA.

Frequently asked questions

  • Is matrix multiplication commutative? No — in general AB ≠ BA for matrices, even when both products are defined, which is a key difference from multiplying ordinary numbers.
  • Can AB and BA ever be equal? Yes, in special cases — for example, if A and B are both diagonal matrices of the same order, then AB = BA always.
  • Why can AB ≠ BA even when both have the same order? Because matrix multiplication combines whole rows and columns through sums of products, and swapping which matrix is "first" generally changes which row pairs with which column, producing different entries even at a matching order.
  • Does AB ≠ BA mean BA is undefined? Not necessarily — BA can be perfectly well-defined and simply unequal to AB; being undefined and being unequal are two different situations.
  • What is the one named exception to non-commutativity in this chapter? Diagonal matrices of the same order — their products always commute, i.e. AB = BA.

Practice questions (original practice questions)

  1. For A = [[2, 0], [0, 3]] and B = [[5, 0], [0, 7]], what can be said about AB and BA?
    • (a) AB ≠ BA since matrices never commute
    • (b) AB = BA, since both are diagonal matrices of the same order
    • (c) AB and BA have different orders
    • (d) Cannot be determined
    • Answer: (b) — Both A and B are diagonal 2×2 matrices, so by the named exception, AB = BA = [[10, 0], [0, 21]].
  2. If A is 3×2 and B is 2×3, which statement is true?
    • (a) AB and BA are always equal
    • (b) AB is 3×3 and BA is 2×2 — necessarily different orders, so AB ≠ BA
    • (c) Neither product is defined
    • (d) Only BA is defined
    • Answer: (b) — AB has order (rows of A)×(columns of B) = 3×3; BA has order (rows of B)×(columns of A) = 2×2 — different orders force AB ≠ BA.
  3. For A = [[0, 1], [1, 0]] and B = [[1, 0], [0, −1]], compute AB and BA; are they equal?
    • (a) Yes, AB = BA = [[0, −1], [1, 0]]
    • (b) No, AB = [[0, −1], [1, 0]] but BA = [[0, 1], [−1, 0]]
    • (c) Yes, both equal the identity matrix
    • (d) No product is defined
    • Answer: (b) — AB: row1·col = [0(1)+1(0), 0(0)+1(−1)] = [0,−1]; row2 = [1(1)+0(0), 1(0)+0(−1)] = [1,0], so AB=[[0,−1],[1,0]]. BA: row1 = [1(0)+0(1), 1(1)+0(0)] = [0,1]; row2 = [0(0)+(−1)(1), 0(1)+(−1)(0)] = [−1,0], so BA=[[0,1],[−1,0]] — they differ.
  4. Which of the following pairs of matrices is guaranteed to commute under multiplication?
    • (a) Any two square matrices of the same order
    • (b) Any two matrices with equal number of rows
    • (c) Two diagonal matrices of the same order
    • (d) Any matrix with its transpose
    • Answer: (c) — The chapter's explicit named exception is diagonal matrices of the same order; general square matrices are not guaranteed to commute.
  5. If A is 2×2 and B is 2×2 but AB ≠ BA, what does this prove about non-commutativity?
    • (a) That non-commutativity requires mismatched orders
    • (b) That even matrices of identical order can fail to commute
    • (c) That A or B must be the zero matrix
    • (d) That A and B cannot both be square
    • Answer: (b) — This is exactly the point of NCERT's Example 14: matching order does not guarantee AB = BA.

Quick revision

  • In general, , even when both products are defined.
  • Example 13: AB = [[0,−4],[10,3]] (2×2) while BA = [[−10,2,21],[−16,2,37],[−2,−2,11]] (3×3) — different orders.
  • Example 14: AB = [[0,1],[−1,0]] and BA = [[0,−1],[1,0]] — same 2×2 order, still unequal.
  • Exception: diagonal matrices of the same order always satisfy AB = BA.
  • Never assume commutativity for matrices — always verify AB and BA separately.

Related articles

NCERTMathematicsClass 12
Rate this article
No ratings yetSign in to rate

0 Comments

Sign in to join the discussion.

Matrix Multiplication Not Commutative (AB≠BA) — JEE | NEETJEE.guru