University of Regina MATH 122 - Linear Algebra I
MATH 122 - Linear Algebra I
§2.3. Matrix multiplication
Martin Frankland
October 3, 2022
Example 1. Consider the matrices
6 −2
3 −1 4
A= and B = 0 1 .
1 2 5
1 3
Compute the matrices AB and BA.
Solution. First note that the product AB is defined:
sizes (2 × 3)(3 × 2) ⇝ size 2 × 2
and the product BA is also defined:
sizes (3 × 2)(2 × 3) ⇝ size 3 × 3.
The entries of the product AB can be computed as the dot product of the rows of A with
the columns of B:
(AB)ij = Ai · ⃗bj .
Using this formula, we compute:
6 −2
3 −1 4
AB = 0 1
1 2 5
1 3
18 + 0 + 4 −6 − 1 + 12
=
6 + 0 + 5 −2 + 2 + 15
22 5
= .
11 15
© 2022 Martin Frankland All Rights Reserved 1
MATH 122 - Linear Algebra I
§2.3. Matrix multiplication
Martin Frankland
October 3, 2022
Example 1. Consider the matrices
6 −2
3 −1 4
A= and B = 0 1 .
1 2 5
1 3
Compute the matrices AB and BA.
Solution. First note that the product AB is defined:
sizes (2 × 3)(3 × 2) ⇝ size 2 × 2
and the product BA is also defined:
sizes (3 × 2)(2 × 3) ⇝ size 3 × 3.
The entries of the product AB can be computed as the dot product of the rows of A with
the columns of B:
(AB)ij = Ai · ⃗bj .
Using this formula, we compute:
6 −2
3 −1 4
AB = 0 1
1 2 5
1 3
18 + 0 + 4 −6 − 1 + 12
=
6 + 0 + 5 −2 + 2 + 15
22 5
= .
11 15
© 2022 Martin Frankland All Rights Reserved 1