Lesson 3 of 8 · 16 min

Multiplying matrices

Multiply matrices row by column, decide when a product is defined and what order it has, and calculate powers of a square matrix.

What you will be able to do

  • Decide whether a product AB\bm{AB} is defined, and state its order.
  • Multiply matrices up to 2×22 \times 2 using the row-by-column rule.
  • Calculate powers of a square matrix, such as A2\bm{A}^2 and A3\bm{A}^3.

The juice bar charges $6 for a small smoothie and $9 for a large. How much did each shop take on Saturday?

CBD: 24×6+18×9=144+162=30624 \times 6 + 18 \times 9 = 144 + 162 = 306 dollars. Toowong: 15×6+21×9=90+189=27915 \times 6 + 21 \times 9 = 90 + 189 = 279 dollars.

Each answer pairs a row of the sales matrix with the column of prices: multiply the matching entries, then add. That is exactly how matrices multiply.

Sales times prices gives each shop's takings
[24181521][69]=[24×6+18×915×6+21×9]=[306279]\begin{bmatrix} 24 & 18 \\ 15 & 21 \end{bmatrix}\begin{bmatrix} 6 \\ 9 \end{bmatrix} = \begin{bmatrix} 24 \times 6 + 18 \times 9 \\ 15 \times 6 + 21 \times 9 \end{bmatrix} = \begin{bmatrix} 306 \\ 279 \end{bmatrix}

Key idea

The row-by-column rule

The element in row ii, column jj of AB\bm{AB} comes from row ii of A\bm{A} and column jj of B\bm{B}: multiply the matching pairs and add.

For 2×22 \times 2 matrices:

[abcd][efgh]=[ae+bgaf+bhce+dgcf+dh]\begin{bmatrix} a & b \\ c & d \end{bmatrix}\begin{bmatrix} e & f \\ g & h \end{bmatrix} = \begin{bmatrix} ae + bg & af + bh \\ ce + dg & cf + dh \end{bmatrix}
Interactive

Row by column

Pick an entry of the product to see the row and column that build it. Predict each entry before you look: the top-left one is 2×4+1×(−2)=62 \times 4 + 1 \times (-2) = 6.

Definition

When is a product defined?

AB\bm{AB} is defined only when the number of columns of A\bm{A} equals the number of rows of B\bm{B}. Then

Am×n  Bn×p=ABm×p\underset{m \times n}{\bm{A}} \; \underset{n \times p}{\bm{B}} = \underset{m \times p}{\bm{AB}}

Write the orders side by side. If the inner numbers match, the product exists, and the outer numbers give its order.

Products of matrices up to 2 × 2
Order of A\bm{A}Order of B\bm{B}Order of AB\bm{AB}
2×22 \times 22×22 \times 22×22 \times 2
2×22 \times 22×12 \times 12×12 \times 1
1×21 \times 22×22 \times 21×21 \times 2
1×21 \times 22×12 \times 11×11 \times 1, a single number in brackets
2×12 \times 11×21 \times 22×22 \times 2
2×12 \times 12×22 \times 2not defined: 1 column but 2 rows
2×22 \times 21×21 \times 2not defined: 2 columns but 1 row

A\bm{A} is a 2×12 \times 1 matrix and B\bm{B} is a 1×21 \times 2 matrix. What is the order of AB\bm{AB}?

Choose one answer

Worked example

Multiply matrices and decide which products exist

  • Simple familiar
  • Technology free

Let A=[3−214]\bm{A} = \begin{bmatrix} 3 & -2 \\ 1 & 4 \end{bmatrix}, B=[25−10]\bm{B} = \begin{bmatrix} 2 & 5 \\ -1 & 0 \end{bmatrix} and C=[13]\bm{C} = \begin{bmatrix} 1 \\ 3 \end{bmatrix}.

(a) Find AB\bm{AB}.

(b) Find AC\bm{AC}.

(c) Explain why CA\bm{CA} is not defined.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Write the orders side by side; the inner numbers must match.

  2. Each entry is a row of the first matrix times a column of the second.

  3. The outer numbers give the order of the product.

Watch out for

  • Multiplying element by element instead of row by column.

  • Assuming CA\bm{CA} exists because AC\bm{AC} does.

Find [13−20][2−1]\begin{bmatrix} 1 & 3 \\ -2 & 0 \end{bmatrix}\begin{bmatrix} 2 \\ -1 \end{bmatrix}.

A square matrix can be multiplied by itself. Just as x2=x×xx^2 = x \times x, you write A2=AA\bm{A}^2 = \bm{AA} and A3=AAA=A2A\bm{A}^3 = \bm{AAA} = \bm{A}^2\bm{A}, and so on. Powers only make sense for square matrices: if A\bm{A} is 1×21 \times 2, then AA\bm{AA} is not defined.

Interactive

Powers of a matrix

Step through F2\bm{F}^2, F3\bm{F}^3, F4,…\bm{F}^4, \dots for F=[1110]\bm{F} = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix}. Which famous sequence appears in the entries?

Common mistake

Squaring each element is not A²

For A=[1234]\bm{A} = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix},

A2=[1234][1234]=[7101522], not [14916].\bm{A}^2 = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} = \begin{bmatrix} 7 & 10 \\ 15 & 22 \end{bmatrix}, \text{ not } \begin{bmatrix} 1 & 4 \\ 9 & 16 \end{bmatrix}.

Matrix multiplication is always row by column, never element by element.

Find A2\bm{A}^2 for A=[2−130]\bm{A} = \begin{bmatrix} 2 & -1 \\ 3 & 0 \end{bmatrix}.

Without technology

Write the orders first, to check the product exists and to know its size. Then work entry by entry: a row of the first matrix times a column of the second. Show the sum for at least one entry so a marker can follow your method.

With technology

On a graphics calculator, define each matrix in the matrix editor, then type the product, such as A×B\bm{A} \times \bm{B} or A2\bm{A}^2. If the orders don't match, you get a dimension error instead of an answer.

Summary

  • Each entry of AB\bm{AB} is a row of A\bm{A} times a column of B\bm{B}: multiply the matching pairs, then add.

  • AB\bm{AB} is defined only when the columns of A\bm{A} match the rows of B\bm{B}. An m×nm \times n matrix times an n×pn \times p matrix is m×pm \times p.

  • A2=AA\bm{A}^2 = \bm{AA} is defined only for square matrices, and it is not the matrix of squared elements.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 3 of 80% read

Save your progress with a free account