Resources For Teachers For Tutors For Students & Parents Pricing
Year 11 Specialist (Unit 1 & 2) Matrices

Multiplication of matrices

20 practice questions 0 video lessons Theory + worked examples

Learn multiplication of matrices for Year 11 Specialist Mathematics in Queensland (QCAA). This is the row-by-column rule that combines two matrices, checking first that the product is defined and working out its order.

You will learn to build each entry from a row and a column, multiply a matrix by a column vector, use the identity matrix, and see why AB is not always BA — the groundwork for determinants, inverses and matrix equations later in the course.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

Matrix multiplication combines two matrices using the row-by-column rule. In Year 11 Specialist Mathematics (QCAA, Queensland) you check the product is defined, then build each entry as a row of the first matrix paired with a column of the second. Order matters: in general AB is not the same as BA.

To multiply two matrices you pair each row of the first matrix with each column of the second. The product \(AB\) is only defined when the number of columns of \(A\) equals the number of rows of \(B\); this is the conformability condition.

Writing the orders as \((m\times n)(n\times p)\), the inner dimensions \(n\) must match, and the product then has the outer order \(m\times p\). For example a \(2\times3\) matrix times a \(3\times2\) matrix gives a \(2\times2\) matrix.

The entry in row \(i\), column \(j\) of \(AB\) is the row-\(i\) of \(A\) combined with the column-\(j\) of \(B\): multiply matching terms and add. The identity matrix \(I\) leaves any matrix unchanged, \(IA=AI=A\), and the power \(A^2\) means \(A\times A\).

Matrix multiplication is not commutative: \(AB\) and \(BA\) are usually different, and sometimes only one of them is even defined. Always multiply in the order given.

Row-by-column rule for a matrix product Row 1 of matrix A, shaded, is combined with column 1 of matrix B, shaded, to give the top-left entry of the product AB: 2 times 1 plus 3 times 2 equals 8. 2 3 1 0 A × 1 4 2 1 B = 8 11 1 4 AB entry (1,1) = 2×1 + 3×2 = 8
The row-by-column rule: row 1 of \(A\) with column 1 of \(B\) gives entry \((1,1)=2\times1+3\times2=8\).
Conformability of a matrix product A is 2 by 3 and B is 3 by 2. The inner numbers 3 and 3 must match for the product to be defined; the outer numbers 2 and 2 give the order of AB, which is 2 by 2. 2 × 3 A is 2×3 3 × 2 B is 3×2 inner must match: 3 = 3 outer gives order of AB = 2×2
Conformability: the inner dimensions must match \((3=3)\); the outer dimensions give the order \(2\times2\).

The general product of two \(2\times2\) matrices, entry by entry:

\[ \begin{pmatrix}a&b\\c&d\end{pmatrix}\begin{pmatrix}e&f\\g&h\end{pmatrix} = \begin{pmatrix}ae+bg & af+bh\\ ce+dg & cf+dh\end{pmatrix} \]
AB=(ae+bg)

In general, the entry in row \(i\), column \(j\) of \(AB\) is the sum of the products of the row-\(i\) entries of \(A\) with the column-\(j\) entries of \(B\):

\[ (AB)_{ij} = \sum_{k} a_{ik}\,b_{kj} \]
(AB)ij=kaikbkj

The multiplicative identity leaves a matrix unchanged:

\[ IA = AI = A, \qquad I = \begin{pmatrix}1&0\\0&1\end{pmatrix} \]
IA=AI=A
Order matters. In general \(AB\ne BA\), so matrix multiplication is not commutative. Check the product is defined (inner dimensions match) before you begin, and keep the matrices in the order written.

How to multiply two matrices

  1. Check it is defined: write the two orders side by side; the columns of the first must equal the rows of the second (the inner dimensions match).
  2. Set the size: the product has the outer order — rows of the first by columns of the second.
  3. Build each entry: for row \(i\), column \(j\), pair the row-\(i\) entries of the first with the column-\(j\) entries of the second, multiply, and add.
  4. Assemble and simplify: place each result in its position and simplify the arithmetic; keep the multiplication in the given order.
Example 1 — Product of two 2×2 matrices
Evaluate \(\begin{pmatrix}2&3\\1&0\end{pmatrix}\begin{pmatrix}1&4\\2&1\end{pmatrix}\).
Solution

Both matrices are \(2\times2\), so the product is \(2\times2\). Take each row of the first with each column of the second:

\(AB\)\(=\)\(\begin{pmatrix}2&3\\1&0\end{pmatrix}\begin{pmatrix}1&4\\2&1\end{pmatrix}\)
\(=\)\(\begin{pmatrix}2\times1+3\times2 & 2\times4+3\times1\\ 1\times1+0\times2 & 1\times4+0\times1\end{pmatrix}\)
\(=\)\(\begin{pmatrix}2+6 & 8+3\\ 1+0 & 4+0\end{pmatrix}\)
\(=\)\(\begin{pmatrix}8&11\\1&4\end{pmatrix}\)

\(AB=\begin{pmatrix}8&11\\1&4\end{pmatrix}\).

Example 2 — Matrix times a column vector
Evaluate \(\begin{pmatrix}3&1\\2&4\end{pmatrix}\begin{pmatrix}5\\2\end{pmatrix}\).
Solution

A \(2\times2\) times a \(2\times1\) gives a \(2\times1\) column. Each entry is a row of the matrix with the single column:

\(A\mathbf{v}\)\(=\)\(\begin{pmatrix}3&1\\2&4\end{pmatrix}\begin{pmatrix}5\\2\end{pmatrix}\)
\(=\)\(\begin{pmatrix}3\times5+1\times2\\ 2\times5+4\times2\end{pmatrix}\)
\(=\)\(\begin{pmatrix}15+2\\ 10+8\end{pmatrix}\)
\(=\)\(\begin{pmatrix}17\\18\end{pmatrix}\)

\(A\mathbf{v}=\begin{pmatrix}17\\18\end{pmatrix}\).

Example 3 — Order matters (AB vs BA)
For \(A=\begin{pmatrix}1&2\\0&1\end{pmatrix}\) and \(B=\begin{pmatrix}2&0\\1&3\end{pmatrix}\), find \(AB\) and \(BA\) and compare.
Solution

First compute \(AB\), row-by-column:

\(AB\)\(=\)\(\begin{pmatrix}1&2\\0&1\end{pmatrix}\begin{pmatrix}2&0\\1&3\end{pmatrix}\)
\(=\)\(\begin{pmatrix}1\times2+2\times1 & 1\times0+2\times3\\ 0\times2+1\times1 & 0\times0+1\times3\end{pmatrix}\)
\(=\)\(\begin{pmatrix}4&6\\1&3\end{pmatrix}\)

Now compute \(BA\), swapping the order:

\(BA\)\(=\)\(\begin{pmatrix}2&0\\1&3\end{pmatrix}\begin{pmatrix}1&2\\0&1\end{pmatrix}\)
\(=\)\(\begin{pmatrix}2\times1+0\times0 & 2\times2+0\times1\\ 1\times1+3\times0 & 1\times2+3\times1\end{pmatrix}\)
\(=\)\(\begin{pmatrix}2&4\\1&5\end{pmatrix}\)

Compare the two products:

\(AB\)\(=\)\(\begin{pmatrix}4&6\\1&3\end{pmatrix}\)
\(BA\)\(=\)\(\begin{pmatrix}2&4\\1&5\end{pmatrix}\)
\(AB\)\(\ne\)\(BA\)

\(AB\ne BA\), so matrix multiplication is not commutative.

Example 4 — Applied: canteen takings
A canteen records sales over two days in \(S=\begin{pmatrix}7&4\\5&6\end{pmatrix}\) (rows are the days; columns are pies and juices). Pies cost \(\$3\) and juices \(\$2\), written \(P=\begin{pmatrix}3\\2\end{pmatrix}\). Find the takings each day with \(SP\).
Solution

Each row of sales is paired with the price column to give that day's takings:

\(SP\)\(=\)\(\begin{pmatrix}7&4\\5&6\end{pmatrix}\begin{pmatrix}3\\2\end{pmatrix}\)
\(=\)\(\begin{pmatrix}7\times3+4\times2\\ 5\times3+6\times2\end{pmatrix}\)
\(=\)\(\begin{pmatrix}21+8\\ 15+12\end{pmatrix}\)
\(=\)\(\begin{pmatrix}29\\27\end{pmatrix}\)

Day 1 takings are \(\$29\) and Day 2 takings are \(\$27\).

Common pitfalls

Assuming \(AB=BA\). Matrix multiplication is not commutative. Watch out for swapping the order — \(AB\) and \(BA\) are usually different, and sometimes only one is defined.
Not checking the product is defined. Line the orders up first: the columns of the first must equal the rows of the second. If the inner dimensions differ, the product does not exist.
Multiplying entry-by-entry. Do not just multiply matching positions. Each entry of the product is a whole row combined with a whole column (multiply matching terms, then add).
Thinking \(AB=0\) forces a zero matrix. A product can be the zero matrix even when neither \(A\) nor \(B\) is zero, so you cannot "cancel" a matrix the way you cancel a number.

Frequently asked questions

When is a matrix product defined?

The product \(AB\) is defined only when the number of columns of \(A\) equals the number of rows of \(B\) — the inner dimensions must match.

What order does the product have?

If \(A\) is \(m\times n\) and \(B\) is \(n\times p\), then \(AB\) has the outer order \(m\times p\).

How do you find one entry of a matrix product?

The entry in row \(i\), column \(j\) of \(AB\) is row \(i\) of \(A\) paired with column \(j\) of \(B\): multiply matching terms and add them.

Is matrix multiplication commutative?

No. In general \(AB\ne BA\), so matrix multiplication is not commutative; always multiply in the order given.

What does the identity matrix do?

The identity \(I=\begin{pmatrix}1&0\\0&1\end{pmatrix}\) leaves a matrix unchanged: \(IA=AI=A\).

What does \(A^2\) mean for a matrix?

\(A^2\) means \(A\times A\); it is only defined for a square matrix, and you evaluate it with the row-by-column rule.