Resources For Teachers For Tutors For Students & Parents Pricing
Pre-Calculus Matrices

Matrix multiplication

20 practice questions 0 video lessons Theory + worked examples

Matrix Multiplication

California Pre-Calculus • Standard N-VM.9 • Matrices

Matrix Multiplication is a topic in Matrices in the California Common Core State Standards. It is aligned to Standard N-VM.9, which requires students to multiply matrices and understand the dimension rule.

Matrix multiplication takes each entry as the dot product of a row with a column, is defined only when the inner dimensions match, and is not commutative.

California Pre-Calculus › Matrices › Matrix Multiplication  —  Standard N-VM.9

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

Theory

To multiply matrices, the entry in row \(i\), column \(j\) of the product is the dot product of row \(i\) of the first matrix with column \(j\) of the second.

This only works when the inner dimensions match: an \(m\times n\) times an \(n\times p\) gives an \(m\times p\) result.

Order matters. \(AB\neq BA\) in general — one product may exist while the other doesn't, or they may differ.
Dimensions for matrix multiplication To multiply an m by n matrix by an n by p matrix the inner dimensions must match, giving an m by p result. (m×n) (n×p) inner n must match result: m×p
Inner dimensions must match; the outer ones give the result size.
Row times column Row times column Row times column entry (i,j) = row i · column j = sum of products AB ≠ BA (usually)
Each entry is a row-by-column dot product.

The multiplication rule:

\[(AB)_{ij}=\sum_{k} A_{ik}B_{kj},\qquad (m\times n)(n\times p)=(m\times p)\]
the i j entry of A B is the sum over k of A i k times B k j; inner dimensions must match
If the inner dimensions don't match, the product is undefined.

How to multiply matrices

  1. Check the inner dimensions match.
  2. For each entry, dot the correct row with the correct column.
  3. Sum the products to get that entry.
  4. Assemble the \(m\times p\) result.
Example 1 — A single entry
For the product \(\begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}5&6\\7&8\end{bmatrix}\), find the top-left entry.
Solution

Row 1 of the first, dotted with column 1 of the second.

\((1)(5)+(2)(7)\)\(=\)\(5+14=19\)
top-left entry is 19
Example 2 — Full 2×2 product
Compute \(\begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}5&6\\7&8\end{bmatrix}\).
Solution

Each entry is a row-by-column dot product.

\[=\begin{bmatrix}1(5)+2(7)&1(6)+2(8)\\3(5)+4(7)&3(6)+4(8)\end{bmatrix}=\begin{bmatrix}19&22\\43&50\end{bmatrix}\]
product is 19, 22, 43, 50
Example 3 — Check dimensions
Can a \(2\times 3\) matrix multiply a \(3\times 2\) matrix, and what size is the result?
Solution

The inner dimensions (3 and 3) match, so the product exists.

\((2\times 3)(3\times 2)\)\(\to\)\(2\times 2\)
yes, the result is 2 by 2
Example 4 — Order matters
Is matrix multiplication commutative?
Solution

In general no: \(AB\neq BA\). The products can even have different sizes, or one may not exist.

\(AB\)\(\neq\)\(BA\)
matrix multiplication is not commutative

Common pitfalls

Row times column, not entrywise. Matrix multiplication is not multiplying matching entries.
Check dimensions first. Inner numbers must match or the product is undefined.
\(AB\neq BA\). Never assume you can swap the order.

Frequently asked questions

How do you multiply two matrices?

Each entry of the product is the dot product of a row of the first matrix with a column of the second.

When can two matrices be multiplied?

When the inner dimensions match: an \(m\times n\) times an \(n\times p\). The result is \(m\times p\).

Is matrix multiplication commutative?

No. In general \(AB\neq BA\); the order changes the result, and one order may not even be defined.

What size is the product?

The outer dimensions: an \(m\times n\) times \(n\times p\) gives an \(m\times p\) matrix.