To multiply matrices, match the first matrix's columns with the second matrix's rows. Each entry of the product is a row-by-column dot product, not an entry-by-entry multiplication.

Open the matrix-multiplication worksheet PDF or additional matrix practice PDF. Work through the dimension check and examples before attempting the printable problems.

Check dimensions before calculating

If A has dimensions \(m\times n\) and B has dimensions \(n\times p\), then AB exists and has dimensions \(m\times p\). The inner dimensions must match; the outer dimensions give the answer's size. A \(2\times3\) matrix times a \(3\times4\) matrix produces a \(2\times4\) matrix.

The entry in row i, column j is \(c_{ij}=\sum_{k=1}^{n}a_{ik}b_{kj}\). In ordinary words: multiply corresponding entries from A's row i and B's column j, then add every product.

Worked example: a 2-by-2 product

Example 1. Let \(A=\begin{pmatrix}1&2\\3&4\end{pmatrix}\) and \(B=\begin{pmatrix}2&0\\-1&5\end{pmatrix}\). Both are \(2\times2\), so AB is defined.

  1. Top left: \(1(2)+2(-1)=0\).
  2. Top right: \(1(0)+2(5)=10\).
  3. Bottom left: \(3(2)+4(-1)=2\).
  4. Bottom right: \(3(0)+4(5)=20\).

Therefore \(AB=\begin{pmatrix}0&10\\2&20\end{pmatrix}\). Keep each row and column aligned; drawing a light guide across the row and down the column can prevent mixing entries.

Why order matters

Reversing the same matrices gives \(BA=\begin{pmatrix}2&4\\14&18\end{pmatrix}\), which is not AB. Some matrices commute, but you cannot assume that they do. Sometimes AB is defined and BA is not: a \(2\times3\) matrix times a \(3\times4\) matrix works, while reversing them gives mismatched inner dimensions 4 and 2.

Example 2: a row times a column. \(\begin{pmatrix}2&-1&3\end{pmatrix}\begin{pmatrix}4\\5\\-2\end{pmatrix}=2(4)+(-1)(5)+3(-2)=8-5-6=-3\). The result is a \(1\times1\) matrix with entry -3.

Practice

  1. What are the dimensions of \((3\times2)(2\times5)\)?
  2. Is \((2\times4)(3\times2)\) defined?
  3. Calculate \(\begin{pmatrix}1&3\end{pmatrix}\begin{pmatrix}2\\4\end{pmatrix}\).
  4. Multiply \(\begin{pmatrix}1&0\\2&1\end{pmatrix}\begin{pmatrix}3&1\\4&2\end{pmatrix}\).
Show worked answers
  1. The inner 2's match. Keep the outer dimensions: 3 by 5.
  2. No. The inner dimensions are 4 and 3, which do not match.
  3. Multiply and add: \(1(2)+3(4)=\boxed{14}\), a 1-by-1 matrix.
  4. The first row gives 3 and 1. The second gives \(2(3)+1(4)=10\) and \(2(1)+1(2)=4\). The product is \(\boxed{\begin{pmatrix}3&1\\10&4\end{pmatrix}}\).

Check the size of your answer before checking its arithmetic. A correct-looking grid with the wrong dimensions cannot be the requested product.