RDRankDeterminant
Video lessons › Mathematics · Unit 3 · Matrices & Determinants · Chapter 1 · Matrices and their Algebra

Matrix Multiplication

8-minute video lesson in English, narrated with a computer voice. Also on YouTube

Full notes, solved examples and practice for this lesson
Open the lesson Free: sign up to open it.

Matrix multiplication explained like a live JEE class: when the product AB is defined and what its order is, the row times column rule, what still works (associative, distributive, identity and zero matrix) and what fails: AB not equal to BA, AB = O with non-zero matrices, no cancelling, and the (A+B) squared trap, with two solved examples.

Chapters

  1. 0:00Introduction
  2. 0:33When can we multiply two matrices?
  3. 1:40Row times column
  4. 2:39What still works
  5. 3:17What does not work
  6. 4:23The algebra trap
  7. 5:11Example 1: find AB and BA for two 2x2 matrices
  8. 6:26Example 2: compare (A+B)^2 with A^2+2AB+B^2
  9. 7:53Quick revision: row times column, AB vs BA, no cancelling

Transcript

0:00Introduction

Hello everyone! Okay, one small puzzle first. For numbers, x plus y, whole squared, is x squared, plus two x y, plus y squared, right? Now, for two matrices, is A plus B, whole squared, always A squared, plus two A B, plus B squared? Most students say yes. Hold on to your answer; by the end, you will see two simple matrices where it fails. Matrix multiplication comes up often in JEE, so let's begin.

0:33When can we multiply two matrices?

So, when can we multiply two matrices? Take A of order m by n: m rows, n columns; this cross sign is read as by. And B of order n by p. Rows of A pair with columns of B, entry by entry. So, what must match? Yes, exactly! Columns of A must equal rows of B, both n here. Otherwise, the product A B is not defined, okay? And then A B has order m by p. Topper's trick: write the orders side by side. The inner numbers must match, and the outer numbers give the order. Got it? Quick check. Matrix A is three by four, B is four by two. Inner numbers four and four match, so A B exists, of order three by two; this double arrow means implies. Now, does B A exist? No! For B A, the orders are four by two, then three by four. Two is not equal to three, that is this equals sign with a slash, so B A does not even exist! Order really matters.

1:40Row times column

Clear? Now, the entries. Here, A B in brackets, with small i j below, means the entry in row i, column j; these are subscripts. It equals capital sigma, the Greek letter for add up, for k from one to n, of small a i k, times small b k j. In plain words: take row i of A and column j of B, multiply matching entries, and add. That is what the dot means. Row times column, that's the whole rule, okay? Let's try one. These square brackets hold the entries of a matrix. Row one, two, three, times column four, five, six. What do you get? Thirty two? Correct! One times four, plus two times five, plus three times six: four, plus ten, plus eighteen, thirty two. Outer numbers one and one, so the answer is a one by one matrix, a single number. With me?

2:39What still works

Good news first: many rules of numbers still work. Associative: A B, then times C, equals A times B C, so brackets can move. Okay? Distributive works too, but watch the sides: A times, B plus C, is A B plus A C, while B plus C, times A, is B A plus C A, in that order. Clear? Capital I is the identity matrix: A I and I A both give A, like multiplying by one. O, the zero matrix, gives O from both sides, and a scalar k can sit anywhere in the product, okay?

3:17What does not work

Now, the surprises. Three times five equals five times three, but for matrices, in general, A B is not equal to B A, even when both are defined. You will see it in Example one. When A B does equal B A, we say A and B commute, a special case. Now think. For numbers, if x y is zero, x or y must be zero. So if A B is O, the zero matrix, must A or B be O? No, no! Not necessarily. Here, A B equal to O does not force either matrix to be zero. Look at this pair: every entry of the first is one; the second has one, minus one, minus one, one. Row one with column one: one minus one, zero, and every row with every column gives zero. Neither matrix is zero, but the product is! So cancelling fails too: A B equal to A C does not give B equal to C, right? You may cancel A only when A has an inverse, which comes in Chapter three. Classic trap!

4:23The algebra trap

Back to our puzzle. The small two up here means squared, so A plus B, whole squared, is A plus B, times itself. Expand it, keeping the order. What are the two middle terms? First, A times A gives A squared; then A times B gives A B; then B times A gives B A, not A B! And finally, B squared. If you kept B A separate, very good! Now, A B plus B A becomes two A B only when A B equals B A, that is, when they commute. Otherwise, the school formula can fail for matrices. Careful, so many students fall for this one! Same story for A plus B, times A minus B: it is A squared minus B squared only when A B equals B A, because the middle terms must cancel.

5:11Example 1: find AB and BA for two 2x2 matrices

Got it? Right, Example one. Matrix A is one, two, three, four, row by row, and B is zero, one, one, zero. Find A B and B A, and compare them. Pause the video and try. Done? Okay, let's check A B, row by row. Row one of A, one, two, with column one of B, zero, one: zero plus two, two. With column two, one, zero: one plus zero, one. Row two gives four and three. So A B is two, one, four, three: the columns of A, swapped! Before you calculate B A, make a guess. With B on the right, the columns got swapped. So what will B A do? It swaps the rows! Check: row one of B, zero, one, with the columns of A gives three, then four; row two of B gives one, then two. So B A is three, four, one, two: the rows of A, swapped. Perfect! So A B is not equal to B A: same matrices, opposite order, different answers. B on the right swapped the columns; on the left, it swapped the rows. Nice, right?

6:26Example 2: compare (A+B)^2 with A^2+2AB+B^2

Now Example two, our puzzle. Matrix A is one, zero, zero, zero; B is zero, one, zero, zero. Compare A plus B, whole squared, with A squared, plus two A B, plus B squared. Pause and try; hint, find A B and B A first. Done? Let's check. In A B, only row one of A with column two of B gives a one. In B A, every row of B meets the columns of A and gives zero. So B A is O, the zero matrix! Already, A B is not equal to B A. Next, A plus B is one, one, zero, zero. Squaring it, row one with each column gives one, and row two stays zero. So the square is the same matrix back. With me? Now the other side. Quickly: what are A squared and B squared? Very good! Squaring A gives A itself, and B squared is the zero matrix. So the right side is A, plus two A B, plus O: one, two, zero, zero. Top right corner: one before, two now. Not equal! The reason is in line one: A B is not equal to B A, right? Puzzle solved: for matrices, that square formula can fail. If you said yes at the start, now you know the trap.

7:53Quick revision: row times column, AB vs BA, no cancelling

So, quick revision. One: multiply only when the columns of A equal the rows of B, then go row times column. Two: brackets can move, but the order cannot. Three: no cancelling without an inverse, and the square formula needs A and B to commute. Now try the practice problems on this page. You will do great. All the best!

More videos in Unit 3 · Matrices & Determinants