Matrix multiplication pairs each row of the first matrix with each column of the second. The inner dimensions must match, and the outer dimensions give the product's shape.
Free matrix multiplication practice: topic practice PDF, topic quiz. The original short practice below includes explained solutions.
Rules and restrictions
An \(m\times n\) matrix times an \(n\times p\) matrix produces an \(m\times p\) matrix. Entry \(c_{ij}\) is \(\sum_{k=1}^{n}a_{ik}b_{kj}\): multiply matching row-column entries and add. This is different from entrywise multiplication, and generally \(AB\ne BA\).
Worked examples
Example 1
Multiply \(\begin{bmatrix}1&2\\-1&3\end{bmatrix}\begin{bmatrix}4&0\\2&5\end{bmatrix}\).
The \(2\times2\) times \(2\times2\) product is defined. Calculate each entry: \(c_{11}=1(4)+2(2)=8\), \(c_{12}=1(0)+2(5)=10\), \(c_{21}=(-1)(4)+3(2)=2\), \(c_{22}=(-1)(0)+3(5)=15\). The result is \(\begin{bmatrix}8&10\\2&15\end{bmatrix}\).
Example 2
Compare \(AB\) and \(BA\) for \(A=\begin{bmatrix}1&2\end{bmatrix}\), \(B=\begin{bmatrix}3\\4\end{bmatrix}\).
AB is \(1\times1\): \(AB=\begin{bmatrix}1(3)+2(4)\end{bmatrix}=\begin{bmatrix}11\end{bmatrix}\). BA is \(2\times2\): \(BA=\begin{bmatrix}3(1)&3(2)\\4(1)&4(2)\end{bmatrix}=\begin{bmatrix}3&6\\4&8\end{bmatrix}\). Both exist, but even their shapes differ.
Try these before opening the solutions
- Multiply \(\begin{bmatrix}2&-1&3\end{bmatrix}\begin{bmatrix}4\\5\\0\end{bmatrix}\).
- If A is \(2\times3\) and B is \(3\times4\), which product exists?
- Multiply \(\begin{bmatrix}1&0\\2&1\end{bmatrix}\begin{bmatrix}3&4\\5&6\end{bmatrix}\).
Show step-by-step solutions
- The inner dimensions are 3, so the result is \(1\times1\). Its entry is \(2(4)+(-1)(5)+3(0)=8-5+0=3\). Thus the product is \(\begin{bmatrix}3\end{bmatrix}\).
- AB exists because the inner dimensions are both 3; its shape is \(2\times4\). BA would have inner dimensions 4 and 2, which do not match, so BA is undefined.
- The first row gives \(1(3)+0(5)=3\), \(1(4)+0(6)=4\). The second gives \(2(3)+1(5)=11\), \(2(4)+1(6)=14\). Hence the product is \(\begin{bmatrix}3&4\\11&14\end{bmatrix}\).
Common mistakes
Check dimensions before arithmetic. Pair a row with a column, not a row with a row, and do not assume reversing order preserves the product.
Related skills
Matrix Multiplication worksheets; Solving Matrix Equations lesson; Adding and Subtracting Matrices lesson; Finding Matrix Determinants lesson.

