Matrix Multiplication Notes

Published on: September 29, 2026

These Matrix Multiplication Notes explain how to multiply two matrices, with every entry of the answer shown as it is built. In Algebra 2, matrix multiplication is how a system of equations is written as one matrix equation, and it only works when the columns of the first matrix match the rows of the second. Each entry comes from one row times one column, multiplied in pairs and added. Following the same pattern every time keeps each row lined up with the right column.

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of A with each column of B.
  4. Work out each entry.

Formula: Matrix Multiplication Formula

This formula gives each entry of AB. Multiply the entries of row i of A by the matching entries of column j of B, then add the products.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Useful Tips to Remember

The columns of A must match the rows of B, and the answer has the rows of A and the columns of B. Order matters, because \(AB\) is usually not equal to \(BA\). Move along the row of A and down the column of B at the same time. Keep track of signs, since one negative product can change the whole entry.

Required knowledge

Where Is Matrix Multiplication Used?

In Algebra 2, matrix multiplication turns a system of linear equations into the single equation \(AX = B\), which can then be solved with an inverse matrix. It is also used in word problems that combine quantities with prices, such as the cost of several orders at once. Beyond school, computer graphics multiplies matrices to move and rotate shapes, and AI models are built from millions of them.

  • Rotating and moving objects in 3D graphics
  • Running neural networks and AI models
  • Input-output models in economics
  • Markov chains and transition probabilities
  • Solving systems of equations with matrices

Matrix Multiplication Practice Problems

Example 1 multiplies two \(2 \times 2\) matrices, and Example 2 multiplies a \(2 \times 3\) matrix by a \(3 \times 2\) matrix, giving a \(2 \times 2\) answer. Examples 3 and 4 give you two more problems of the same kind to try. Pair each row with each column yourself and compare.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix},\; B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of A with each column of B.
  4. Work out each entry.

Formula

Formula: Matrix Multiplication Formula

This formula gives each entry of AB. Multiply the entries of row i of A by the matching entries of column j of B, then add the products.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 2\) and Matrix B is \(2 \times 2\). The 2 columns of A match the 2 rows of B, so they can be multiplied and the answer is \(2 \times 2\).

\(A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix},\; B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of AB comes from one row of A and one column of B. The matching entries are multiplied in pairs and the products are added.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 3

Step 3 - Pair each row of A with each column of B.

In this problem: Pairing every row of A with every column of B gives \(AB = \begin{bmatrix} 1 \times 5 + 2 \times 7 & 1 \times 6 + 2 \times 8 \\ 3 \times 5 + 4 \times 7 & 3 \times 6 + 4 \times 8 \end{bmatrix}\). For example, the top left entry uses \(\text{row } 1 = \begin{bmatrix} 1 & 2 \end{bmatrix}\) of A and \(\text{column } 1 = \begin{bmatrix} 5 \\ 7 \end{bmatrix}\) of B.

\(AB = \begin{bmatrix} 1 \times 5 + 2 \times 7 & 1 \times 6 + 2 \times 8 \\ 3 \times 5 + 4 \times 7 & 3 \times 6 + 4 \times 8 \end{bmatrix}\)

Step 4

Step 4 - Work out each entry.

In this problem: Working out each entry gives \(1 \times 5 + 2 \times 7 = 5 + 14 = 19\), \(1 \times 6 + 2 \times 8 = 6 + 16 = 22\), \(3 \times 5 + 4 \times 7 = 15 + 28 = 43\) and \(3 \times 6 + 4 \times 8 = 18 + 32 = 50\).

\(AB = \begin{bmatrix} 1 \times 5 + 2 \times 7 & 1 \times 6 + 2 \times 8 \\ 3 \times 5 + 4 \times 7 & 3 \times 6 + 4 \times 8 \end{bmatrix} = \begin{bmatrix} 5 + 14 & 6 + 16 \\ 15 + 28 & 18 + 32 \end{bmatrix} = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}\)

Final Answer

\(AB = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}\)
See Example 2 Hide Example 2

Problem

\(A = \begin{bmatrix} 2 & 0 & -1 \\ 3 & 1 & 4 \end{bmatrix},\; B = \begin{bmatrix} 1 & 2 \\ 0 & 5 \\ -2 & 3 \end{bmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of A with each column of B.
  4. Work out each entry.

Formula

Formula: Matrix Multiplication Formula

This formula gives each entry of AB. Multiply the entries of row i of A by the matching entries of column j of B, then add the products.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 3\) and Matrix B is \(3 \times 2\). The 3 columns of A match the 3 rows of B, so they can be multiplied and the answer is \(2 \times 2\).

\(A = \begin{bmatrix} 2 & 0 & -1 \\ 3 & 1 & 4 \end{bmatrix},\; B = \begin{bmatrix} 1 & 2 \\ 0 & 5 \\ -2 & 3 \end{bmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of AB comes from one row of A and one column of B. The matching entries are multiplied in pairs and the products are added.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 3

Step 3 - Pair each row of A with each column of B.

In this problem: Pairing every row of A with every column of B gives \(AB = \begin{bmatrix} 2 \times 1 + 0 \times 0 + \left(-1\right) \times \left(-2\right) & 2 \times 2 + 0 \times 5 + \left(-1\right) \times 3 \\ 3 \times 1 + 1 \times 0 + 4 \times \left(-2\right) & 3 \times 2 + 1 \times 5 + 4 \times 3 \end{bmatrix}\). For example, the top left entry uses \(\text{row } 1 = \begin{bmatrix} 2 & 0 & -1 \end{bmatrix}\) of A and \(\text{column } 1 = \begin{bmatrix} 1 \\ 0 \\ -2 \end{bmatrix}\) of B.

\(AB = \begin{bmatrix} 2 \times 1 + 0 \times 0 + \left(-1\right) \times \left(-2\right) & 2 \times 2 + 0 \times 5 + \left(-1\right) \times 3 \\ 3 \times 1 + 1 \times 0 + 4 \times \left(-2\right) & 3 \times 2 + 1 \times 5 + 4 \times 3 \end{bmatrix}\)

Step 4

Step 4 - Work out each entry.

In this problem: Working out each entry gives \(2 \times 1 + 0 \times 0 + \left(-1\right) \times \left(-2\right) = 2 + 0 + 2 = 4\), \(2 \times 2 + 0 \times 5 + \left(-1\right) \times 3 = 4 + 0 - 3 = 1\), \(3 \times 1 + 1 \times 0 + 4 \times \left(-2\right) = 3 + 0 - 8 = -5\) and \(3 \times 2 + 1 \times 5 + 4 \times 3 = 6 + 5 + 12 = 23\).

\(AB = \begin{bmatrix} 2 \times 1 + 0 \times 0 + \left(-1\right) \times \left(-2\right) & 2 \times 2 + 0 \times 5 + \left(-1\right) \times 3 \\ 3 \times 1 + 1 \times 0 + 4 \times \left(-2\right) & 3 \times 2 + 1 \times 5 + 4 \times 3 \end{bmatrix} = \begin{bmatrix} 2 + 0 + 2 & 4 + 0 - 3 \\ 3 + 0 - 8 & 6 + 5 + 12 \end{bmatrix} = \begin{bmatrix} 4 & 1 \\ -5 & 23 \end{bmatrix}\)

Final Answer

\(AB = \begin{bmatrix} 4 & 1 \\ -5 & 23 \end{bmatrix}\)
See Example 3 Hide Example 3

Problem

\(A = \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix},\; B = \begin{bmatrix} 1 & 0 \\ 5 & 2 \end{bmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of A with each column of B.
  4. Work out each entry.

Formula

Formula: Matrix Multiplication Formula

This formula gives each entry of AB. Multiply the entries of row i of A by the matching entries of column j of B, then add the products.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 2\) and Matrix B is \(2 \times 2\). The 2 columns of A match the 2 rows of B, so they can be multiplied and the answer is \(2 \times 2\).

\(A = \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix},\; B = \begin{bmatrix} 1 & 0 \\ 5 & 2 \end{bmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of AB comes from one row of A and one column of B. The matching entries are multiplied in pairs and the products are added.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 3

Step 3 - Pair each row of A with each column of B.

In this problem: Pairing every row of A with every column of B gives \(AB = \begin{bmatrix} 2 \times 1 + 3 \times 5 & 2 \times 0 + 3 \times 2 \\ 1 \times 1 + 4 \times 5 & 1 \times 0 + 4 \times 2 \end{bmatrix}\). For example, the top left entry uses \(\text{row } 1 = \begin{bmatrix} 2 & 3 \end{bmatrix}\) of A and \(\text{column } 1 = \begin{bmatrix} 1 \\ 5 \end{bmatrix}\) of B.

\(AB = \begin{bmatrix} 2 \times 1 + 3 \times 5 & 2 \times 0 + 3 \times 2 \\ 1 \times 1 + 4 \times 5 & 1 \times 0 + 4 \times 2 \end{bmatrix}\)

Step 4

Step 4 - Work out each entry.

In this problem: Working out each entry gives \(2 \times 1 + 3 \times 5 = 2 + 15 = 17\), \(2 \times 0 + 3 \times 2 = 0 + 6 = 6\), \(1 \times 1 + 4 \times 5 = 1 + 20 = 21\) and \(1 \times 0 + 4 \times 2 = 0 + 8 = 8\).

\(AB = \begin{bmatrix} 2 \times 1 + 3 \times 5 & 2 \times 0 + 3 \times 2 \\ 1 \times 1 + 4 \times 5 & 1 \times 0 + 4 \times 2 \end{bmatrix} = \begin{bmatrix} 2 + 15 & 0 + 6 \\ 1 + 20 & 0 + 8 \end{bmatrix} = \begin{bmatrix} 17 & 6 \\ 21 & 8 \end{bmatrix}\)

Final Answer

\(AB = \begin{bmatrix} 17 & 6 \\ 21 & 8 \end{bmatrix}\)
See Example 4 Hide Example 4

Problem

\(A = \begin{bmatrix} 1 & 2 & 0 \\ -1 & 3 & 2 \end{bmatrix},\; B = \begin{bmatrix} 3 & 1 \\ 2 & 0 \\ 1 & 4 \end{bmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of A with each column of B.
  4. Work out each entry.

Formula

Formula: Matrix Multiplication Formula

This formula gives each entry of AB. Multiply the entries of row i of A by the matching entries of column j of B, then add the products.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 3\) and Matrix B is \(3 \times 2\). The 3 columns of A match the 3 rows of B, so they can be multiplied and the answer is \(2 \times 2\).

\(A = \begin{bmatrix} 1 & 2 & 0 \\ -1 & 3 & 2 \end{bmatrix},\; B = \begin{bmatrix} 3 & 1 \\ 2 & 0 \\ 1 & 4 \end{bmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of AB comes from one row of A and one column of B. The matching entries are multiplied in pairs and the products are added.

\((AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj}\)

Step 3

Step 3 - Pair each row of A with each column of B.

In this problem: Pairing every row of A with every column of B gives \(AB = \begin{bmatrix} 1 \times 3 + 2 \times 2 + 0 \times 1 & 1 \times 1 + 2 \times 0 + 0 \times 4 \\ \left(-1\right) \times 3 + 3 \times 2 + 2 \times 1 & \left(-1\right) \times 1 + 3 \times 0 + 2 \times 4 \end{bmatrix}\). For example, the top left entry uses \(\text{row } 1 = \begin{bmatrix} 1 & 2 & 0 \end{bmatrix}\) of A and \(\text{column } 1 = \begin{bmatrix} 3 \\ 2 \\ 1 \end{bmatrix}\) of B.

\(AB = \begin{bmatrix} 1 \times 3 + 2 \times 2 + 0 \times 1 & 1 \times 1 + 2 \times 0 + 0 \times 4 \\ \left(-1\right) \times 3 + 3 \times 2 + 2 \times 1 & \left(-1\right) \times 1 + 3 \times 0 + 2 \times 4 \end{bmatrix}\)

Step 4

Step 4 - Work out each entry.

In this problem: Working out each entry gives \(1 \times 3 + 2 \times 2 + 0 \times 1 = 3 + 4 + 0 = 7\), \(1 \times 1 + 2 \times 0 + 0 \times 4 = 1 + 0 + 0 = 1\), \(\left(-1\right) \times 3 + 3 \times 2 + 2 \times 1 = -3 + 6 + 2 = 5\) and \(\left(-1\right) \times 1 + 3 \times 0 + 2 \times 4 = -1 + 0 + 8 = 7\).

\(AB = \begin{bmatrix} 1 \times 3 + 2 \times 2 + 0 \times 1 & 1 \times 1 + 2 \times 0 + 0 \times 4 \\ \left(-1\right) \times 3 + 3 \times 2 + 2 \times 1 & \left(-1\right) \times 1 + 3 \times 0 + 2 \times 4 \end{bmatrix} = \begin{bmatrix} 3 + 4 + 0 & 1 + 0 + 0 \\ -3 + 6 + 2 & -1 + 0 + 8 \end{bmatrix} = \begin{bmatrix} 7 & 1 \\ 5 & 7 \end{bmatrix}\)

Final Answer

\(AB = \begin{bmatrix} 7 & 1 \\ 5 & 7 \end{bmatrix}\)

Calculator and Practice Mode