Matrices

How to Multiply two matrices

Use this to find the product of two matrices, a common first step before finding an inverse.

Before you start

  1. Knowing the order of a matrix (rows × columns)
  2. Multiplying and adding numbers, including negatives
  3. Keeping track of row and column positions

When to use it

Use this to find the product of two matrices, a common first step before finding an inverse.

The steps

  1. Check the multiplication is allowed: the columns of the first matrix must equal the rows of the second.
  2. Take the first row of the left matrix and the first column of the right matrix.
  3. Multiply matching entries and add them to get one number of the answer.
  4. Repeat for every row–column pair, keeping their positions.
  5. Write the results in the correct positions of the product matrix.

Worked example

Given A = (1 2; 3 4) and B = (5 6; 7 8), find the product AB.

  1. A has 2 columns and B has 2 rows; they match, so AB exists and is a 2×2 matrix.
  2. Take row 1 of A, (1, 2), and column 1 of B, (5, 7).
  3. Multiply matching entries and add: 1×5 + 2×7 = 5 + 14 = 19, which goes in position (row 1, column 1).
  4. Repeat: row 1 × column 2 = 1×6 + 2×8 = 22; row 2 × column 1 = 3×5 + 4×7 = 43; row 2 × column 2 = 3×6 + 4×8 = 50.
  5. Place each number in its position: AB = (19 22; 43 50).

A second example, with a twist

The matrices are not square (2×3 times 3×2) and include negatives, so checking the order and the signs matters. Given A = (1 0 2; −1 3 1) and B = (2 1; 0 4; 3 −1), find AB.

  1. A has 3 columns and B has 3 rows; they match, so AB exists and is a 2×2 matrix.
  2. Take row 1 of A, (1, 0, 2), and column 1 of B, (2, 0, 3).
  3. Multiply matching entries and add: 1×2 + 0×0 + 2×3 = 2 + 0 + 6 = 8, in position (1, 1).
  4. Repeat for every pair: row 1 × column 2 = 1×1 + 0×4 + 2×(−1) = −1; row 2 × column 1 = (−1)×2 + 3×0 + 1×3 = 1; row 2 × column 2 = (−1)×1 + 3×4 + 1×(−1) = 10.
  5. Place each number: AB = (8 −1; 1 10).

Formulae you may need

Inverse of a 2x2 matrix (given in the exam)
A-1 = 1/(ad−bc) × [[d, −b], [−c, a]]
Given in the exam

Formula pages

Practise this in a KBAT problem

Book a Trial ClassOne-hour paid trial · Same-day reply · from RM50/hr

Frequently asked questions

Is AB the same as BA?

Usually not. Matrix multiplication is not commutative, so AB and BA are generally different, and sometimes only one of them is even allowed.

Always multiply in the order the question gives. Swapping the order can change every entry, or make the multiplication impossible because the sizes no longer match.

When is multiplication not allowed?

Check the sizes: the number of columns in the left matrix must equal the number of rows in the right matrix. If they do not match, the product does not exist.

For example, a 2×3 matrix can multiply a 3×2 matrix, but not another 2×3 matrix.

What size will the answer be?

The product takes its rows from the left matrix and its columns from the right matrix. So a 2×3 times a 3×2 gives a 2×2 answer, and a 2×2 times a 2×2 gives a 2×2 answer.

Write down the expected size first as a check.

Learn multiply two matrices one-to-one

Book a Trial Class
One-hour paid trial · Same-day replyfrom RM50/hr
Book a Trial Class