Steply

AB and BA for A = [1, 2; 0, 3], B = [2, 0; 1, 1]

Step by step, with the reason for every step · Multiplying matrices · Algebra 2

Step by step

The question

Question: work out A B and B A.

Is the order important?

A = [1, 2; 0, 3]

A B means A times B.

B A means B times A.

B = [2, 0; 1, 1]

1 Check the sizes

Both are 2 by 2.

The inside numbers are 2 and 2 both ways.

So we can multiply in both orders, and both answers are 2 by 2.

2 Work out AB

Careful!

In A B, the rows come from A and the columns from B.

Careful: A B: rows of A × columns of B
AB = [1 × 2 + 2 × 1, 1 × 0 + 2 × 1; 0 × 2 + 3 × 1, 0 × 0 + 3 × 1]

First we work out every times.

AB = [2 + 2, 0 + 2; 0 + 3, 0 + 3]

Then we add.

So A B is rows 4, 2 and 3, 3.

AB = [4, 2; 3, 3]

3 Work out BA

Now the other order: rows of B, columns of A.

BA = [2 × 1 + 0 × 0, 2 × 2 + 0 × 3; 1 × 1 + 1 × 0, 1 × 2 + 1 × 3]

First we work out every times.

BA = [2 + 0, 4 + 0; 1 + 0, 2 + 3]

Then we add.

So B A is rows 2, 4 and 1, 5.

BA = [2, 4; 1, 5]

4 Compare

The two answers are different.

So A B is not the same as B A: with matrices, the order matters!

AB ≠ BA

5 Check

Let's check A B: each entry's products added the other way round.

2 + 2 = 4, 2 + 0 = 2
3 + 0 = 3, 3 + 0 = 3

A B is right.

And B A the same way.

0 + 2 = 2, 0 + 4 = 4
0 + 1 = 1, 3 + 2 = 5

B A is right too.

So the answer is right!

Let's look back.

First: check the sizes.

Then: work out AB.

Then: work out BA.

Then: compare.

Last: check.

Answer
AB ≠ BA

Your turn

Try this one yourself, then check:

Work out AB and BA: A = [1, 4; 1, 1], B = [2, 1; 1, 1]
Show the answer
AB ≠ BA

More from Multiplying matrices

The whole lesson: Multiplying matrices →