Question
If A=(2134) and B=(1201), find AB, BA, and check whether AB=BA.
Solution — Step by Step
Row i of AB = (row i of A) · (columns of B).
Entry (1,1): 2⋅1+3⋅2=8.
Entry (1,2): 2⋅0+3⋅1=3.
Entry (2,1): 1⋅1+4⋅2=9.
Entry (2,2): 1⋅0+4⋅1=4.
AB=(8934)
Entry (1,1): 1⋅2+0⋅1=2.
Entry (1,2): 1⋅3+0⋅4=3.
Entry (2,1): 2⋅2+1⋅1=5.
Entry (2,2): 2⋅3+1⋅4=10.
BA=(25310)
AB=BA. Matrix multiplication is not commutative in general.
Final answer: AB=(8934), BA=(25310), and AB=BA.
Why This Works
Matrix multiplication is row-of-first dotted with column-of-second. Unlike scalar multiplication, the order changes the answer. Special cases where AB=BA exist (e.g., diagonal matrices, A and A−1, A and I), but in general expect non-commutativity.
This is why “matrix algebra” is genuinely different from ordinary algebra — every identity from school like (A+B)2=A2+2AB+B2 is wrong unless AB=BA.
Alternative Method
Use the column-as-linear-combination view: column j of AB equals A acting on column j of B. Sometimes faster when one matrix has many zero columns.
The classic blunder: writing (A+B)2=A2+2AB+B2. Correct expansion is A2+AB+BA+B2. Only equal to the school version when AB=BA. Always preserve the order in matrix algebra.