8.4. MULTIPLICATION OF MATRICES 137
Consider first AB. It is the product of a 2× 3 and a 3× 2 matrix and so it is a 2× 2matrix. The top left corner is the dot product of the top row of A and the first column of Band so forth. Be sure you can show the following.
AB =
(3 88 10
), BA =
11 −8 72 −1 −19 −6 3
Note that this shows that matrix multiplication is not commutative. Indeed, it can result inmatrices of different size when you interchange the order. Here is a jucy little observation.If you add the entries on the main diagonal of both matrices in the above, you get the samenumber 13. This is the diagonal from upper left to lower right. You might wonder whetherthis always happens or if this is just a fluke.
Although matrix multiplication is not commutative, it does have several very importantproperties.
Proposition 8.4.3 If all multiplications and additions make sense, the following hold formatrices A,B,C and a,b scalars.
A(aB+bC) = a(AB)+b(AC) (8.11)
(B+C)A = BA+CA (8.12)
A(BC) = (AB)C (8.13)
Proof: Using Definition 8.4.1,
(A(aB+bC))i j = ∑k
Aik (aB+bC)k j
= ∑k
Aik(aBk j +bCk j
)= a∑
kAikBk j +b∑
kAikCk j
= a(AB)i j +b(AC)i j
= (a(AB)+b(AC))i j .
Thus A(B+C) = AB+AC as claimed. Formula 8.12 is entirely similar.Formula 8.13 is the associative law of multiplication. Using Definition 8.4.1,
(A(BC))i j = ∑k
Aik (BC)k j
= ∑k
Aik ∑l
BklCl j
= ∑l(AB)il Cl j
= ((AB)C)i j .
This proves 8.13. ■Note that the claim about the associative law happens because when you have functions
f ,g,h such that it makes sense to take their composition in that order, we have f ◦ (g◦h) =( f ◦g)◦h and matrix multiplication corresponds to composition of the corresponding linearfunctions. This is the real reason for the associative law.