Multiplication of matrices
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.
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.
The general product of two \(2\times2\) matrices, entry by entry:
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\):
The multiplicative identity leaves a matrix unchanged:
How to multiply two matrices
- 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).
- Set the size: the product has the outer order — rows of the first by columns of the second.
- 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.
- Assemble and simplify: place each result in its position and simplify the arithmetic; keep the multiplication in the given order.
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}\).
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}\).
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.
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
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.