Skip to content
Worked Examples · Example 13

Q.If A=[1−23−425]A = \begin{bmatrix} 1 & -2 & 3 \\ -4 & 2 & 5 \end{bmatrix} and B=[234521]B = \begin{bmatrix} 2 & 3 \\ 4 & 5 \\ 2 & 1 \end{bmatrix}, then find ABAB, BABA. Show that AB≠BAAB \neq BA.

Uttar Pradesh UpmspTextbookSubjective· 3mImportance★★★★★
31% · 57/182 Questions
✓ Free question

Matrix multiplication is not commutative — the product ABAB exists when the column count of AA matches the row count of BB, but BABA may not even be defined, or if it is, the two products are different matrices. Here ABAB is 2×22\times 2 and BABA is 3×33\times 3, so they cannot be equal.

We start with the core idea: two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second. This is the compatibility condition. For AA and BB given, AA is 2×32 \times 3 (2 rows, 3 columns) and BB is 3×23 \times 2 (3 rows, 2 columns). So ABAB is defined and will be 2×22 \times 2. Similarly, BABA is also defined (since BB has 2 columns and AA has 2 rows) and will be 3×33 \times 3. Two matrices of different sizes can never be equal, so AB≠BAAB \neq BA is immediate. But let’s compute both to see the actual numbers.

  1. Compute ABAB

    AA is 2×32 \times 3, BB is 3×23 \times 2. The product ABAB will be 2×22 \times 2.

    The entry in row ii, column jj of ABAB is the dot product of row ii of AA with column jj of BB.

    • Row 1 of AA: [1,−2,3][1, -2, 3]

      Column 1 of BB: [242]\begin{bmatrix}2 \\ 4 \\ 2\end{bmatrix}

      (AB)11=1⋅2+(−2)⋅4+3⋅2=2−8+6=0(AB)_{11} = 1\cdot 2 + (-2)\cdot 4 + 3\cdot 2 = 2 - 8 + 6 = 0

    • Row 1 of AA with column 2 of BB: [351]\begin{bmatrix}3 \\ 5 \\ 1\end{bmatrix}

      (AB)12=1⋅3+(−2)⋅5+3⋅1=3−10+3=−4(AB)_{12} = 1\cdot 3 + (-2)\cdot 5 + 3\cdot 1 = 3 - 10 + 3 = -4

    • Row 2 of AA: [−4,2,5][-4, 2, 5]

      With column 1: (−4)⋅2+2⋅4+5⋅2=−8+8+10=10(-4)\cdot 2 + 2\cdot 4 + 5\cdot 2 = -8 + 8 + 10 = 10

    • Row 2 with column 2: (−4)⋅3+2⋅5+5⋅1=−12+10+5=3(-4)\cdot 3 + 2\cdot 5 + 5\cdot 1 = -12 + 10 + 5 = 3

    So

AB=[0−4103]AB = \begin{bmatrix} 0 & -4 \\ 10 & 3 \end{bmatrix}

  1. Compute BABA

    BB is 3×23 \times 2, AA is 2×32 \times 3, so BABA is 3×33 \times 3.

    Each entry is the dot product of a row of BB with a column of AA.

    Rows of BB:

    Row 1: [2,3][2, 3]

    Row 2: [4,5][4, 5]

    Row 3: [2,1][2, 1]

    Columns of AA:

    Col 1: [1−4]\begin{bmatrix}1 \\ -4\end{bmatrix}, Col 2: [−22]\begin{bmatrix}-2 \\ 2\end{bmatrix}, Col 3: [35]\begin{bmatrix}3 \\ 5\end{bmatrix}

    Compute systematically:

    • (BA)11(BA)_{11}: row 1 of BB with col 1 of AA: 2⋅1+3⋅(−4)=2−12=−102\cdot 1 + 3\cdot (-4) = 2 - 12 = -10

    • (BA)12(BA)_{12}: row 1 with col 2: 2⋅(−2)+3⋅2=−4+6=22\cdot (-2) + 3\cdot 2 = -4 + 6 = 2

    • (BA)13(BA)_{13}: row 1 with col 3: 2⋅3+3⋅5=6+15=212\cdot 3 + 3\cdot 5 = 6 + 15 = 21

    • (BA)21(BA)_{21}: row 2 with col 1: 4⋅1+5⋅(−4)=4−20=−164\cdot 1 + 5\cdot (-4) = 4 - 20 = -16

    • (BA)22(BA)_{22}: row 2 with col 2: 4⋅(−2)+5⋅2=−8+10=24\cdot (-2) + 5\cdot 2 = -8 + 10 = 2

    • (BA)23(BA)_{23}: row 2 with col 3: 4⋅3+5⋅5=12+25=374\cdot 3 + 5\cdot 5 = 12 + 25 = 37

    • (BA)31(BA)_{31}: row 3 with col 1: 2⋅1+1⋅(−4)=2−4=−22\cdot 1 + 1\cdot (-4) = 2 - 4 = -2

    • (BA)32(BA)_{32}: row 3 with col 2: 2⋅(−2)+1⋅2=−4+2=−22\cdot (-2) + 1\cdot 2 = -4 + 2 = -2

    • (BA)33(BA)_{33}: row 3 with col 3: 2⋅3+1⋅5=6+5=112\cdot 3 + 1\cdot 5 = 6 + 5 = 11

    So

BA=[−10221−16237−2−211]BA = \begin{bmatrix} -10 & 2 & 21 \\ -16 & 2 & 37 \\ -2 & -2 & 11 \end{bmatrix}

  1. Compare ABAB and BABA ABAB is 2×22 \times 2, BABA is 3×33 \times 3. They don’t even have the same shape, so they cannot be equal. Even if we ignore size, the entries are completely different. This illustrates a fundamental fact: matrix multiplication is not commutative — in general, AB≠BAAB \neq BA, and often one product may not even be defined when the other is.
Watch out

A common mistake is to assume AB=BAAB = BA because multiplication of numbers is commutative. Matrices are different: the order matters, and the dimensions must align. Always check compatibility first.

Tip

When AA is m×nm \times n and BB is n×mn \times m, both ABAB (m×mm \times m) and BABA (n×nn \times n) exist, but unless m=nm = n, they can't be equal because their sizes differ. Here m=2m=2, n=3n=3, so ABAB is 2×22\times 2 and BABA is 3×33\times 3 — immediate proof of inequality.

✓Final answer

AB=[0−4103]AB = \begin{bmatrix} 0 & -4 \\ 10 & 3 \end{bmatrix}, BA=[−10221−16237−2−211]BA = \begin{bmatrix} -10 & 2 & 21 \\ -16 & 2 & 37 \\ -2 & -2 & 11 \end{bmatrix}, and since they are of different orders, AB≠BAAB \neq BA.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.