Lesson 4 of 8 · 15 min
Order matters: the rules of matrix algebra
See why AB and BA are usually different, use the identity matrix and the distributive laws, and avoid the algebra habits that fail for matrices.
What you will be able to do
- Recognise that matrix multiplication is not commutative in general: usually .
- Use and the left and right distributive laws.
- Expand expressions such as correctly, keeping every product in order.
With numbers, , so you never have to think about order. Try the same thing with two matrices:
Same two matrices, opposite order, different answers.
This shows . Enter the two matrices the other way round to get . Then look for a second matrix that gives the same product in both orders.
Key idea
Matrix multiplication is not commutative
In general, . When does happen, we say and commute.
Order can matter even more than that. can exist when doesn't (a matrix times a matrix), and the two products can have different orders (a times a is , but the reverse is ).
Because order matters, say which side you multiply on. Multiplying by on the left gives : you pre-multiply by . Multiplying on the right gives : you post-multiply. You will need this language to solve matrix equations.
Which statement is true for all matrices and ?
Key idea
The identity matrix commutes with everything
For any matrix ,
so is the multiplicative identity: it does for matrices what 1 does for numbers. Check one entry: the top-left entry of is .
Other matrices that commute with include any , the powers and , and, as you will see, the inverse .
| Law | Statement | Same as for numbers? |
|---|---|---|
| Commutative law for addition | Yes | |
| Additive identity | Yes | |
| Additive inverse | Yes | |
| Multiplicative identity | Yes | |
| Multiplicative inverse | Only when exists | |
| Associative law for multiplication | Yes | |
| Left distributive law | Yes, keeping on the left | |
| Right distributive law | Yes, keeping on the right | |
| Commutative law for multiplication | No, it fails in general |
Worked example
Why
(a) Show that for any matrices and .
(b) For and , show that .
Step 1: Expand with the distributive laws
The right distributive law splits the first bracket, then the left distributive law splits each product. Every matrix keeps its side, so and stay separate.
Step 2: Find directly
, so .
Step 3: Find the four products
, , and .
Step 4: Compare
, which agrees with (a). But
equals only when , and these matrices do not commute.
Try it yourself first, then check the working one step at a time.
Answer
, while . They differ because .
Method
Expand brackets with the distributive laws, keeping every product in order.
Combine and only if you know the matrices commute.
A single counterexample is enough to show that a general statement is false.
Watch out for
Writing for .
Expand and simplify , where is a matrix.
Common mistake
No zero-product rule and no cancelling
Two habits from ordinary algebra fail for matrices.
- A zero product doesn't need a zero factor. , but neither matrix is .
- You can't cancel. does not mean , unless has an inverse you can multiply by.
And never write unless you know and commute.
Why the distributive laws hold
Take any entry of , say the one in row and column . It is row of times column of :
by the distributive law for numbers. The right-hand side is the entry of plus the entry of . Every entry agrees, so . The right distributive law is proved the same way, with on the right.
Find so that and commute.
Summary
Matrix multiplication is not commutative: in general . Pre-multiplying and post-multiplying are different operations.
: the identity matrix acts like the number 1.
The distributive laws hold if every matrix keeps its side: and .
. A zero product does not force a zero factor, and you cannot cancel.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.