# Video: Matrix Multiplication

In this video, we will learn how to identify the conditions for matrix multiplication, and evaluate the product of two matrices if possible.

12:31

### Video Transcript

In this video, we will learn how to identify the conditions for matrix multiplication and evaluate the product of two matrices if possible. Recall that a matrix is an array, often consisting of numbers which we call elements, but also a matrix could consist of symbols or expressions. We often use capital letters to represent matrices. We can describe the size of a matrix with its dimensions. If a matrix has 𝑚 rows and 𝑛 columns, we say that this is an 𝑚-by-𝑛 matrix. For example, this is a two-by-two matrix and this is a three-by-four matrix.

There are two types of multiplication we can do with matrices, scalar multiplication and the matrix multiplication. Scalar multiplication involves multiplying a matrix by a scalar. This just means multiplying a matrix by a number. For example, with the matrix 𝐵, we could find three 𝐵 by multiplying each component of the matrix 𝐵 by three. So that is scalar multiplication. Matrix multiplication is a bit harder than this as it involves multiplying matrices together. In order to do matrix multiplication, we’ve got to pay attention to the size of the matrices which we want to multiply together. We can’t just multiply any two matrices together.

For two matrices 𝐴 and 𝐵, to find the product 𝐴𝐵, if 𝐴 has dimensions 𝑚 by 𝑛, then matrix 𝐵 must have dimensions 𝑛 by 𝑝 in order for multiplication to work. In other words, matrix 𝐴 must have the same number of columns as the rows of matrix 𝐵. We can also determine the size of the resultant matrix 𝐴𝐵. The resultant matrix will have dimensions 𝑚 by 𝑝. Let’s demonstrate this in an example.

Consider the one-by-two matrix 𝐴 and the two-by-one matrix 𝐵. Their product 𝐴𝐵 must exist because 𝐴 has the same number of columns as the number of rows in matrix 𝐵. We can also say that 𝐴𝐵 has dimensions one by one. The multiplication of these two matrices is very similar to the way we find the dot product. We start by doing two multiplied by seven and then we add three multiplied by one. This gives us 14 add three, which is 17.

Let’s now have a look at a more difficult example.

Consider the matrices 𝐴 and 𝐵. Find 𝐴𝐵, if possible.

Let’s first establish whether the multiplication of these two matrices is possible. Matrix 𝐴 has three rows and two columns, and matrix 𝐵 has two rows and three columns. Seen is the number of columns in matrix 𝐴 is the same as the number of rows in matrix 𝐵, we know that the resultant matrix exists. Additionally, we can tell the dimensions of the resultant matrix by seeing that matrix 𝐴 has three rows and matrix 𝐵 has three columns. So the resultant matrix will be a three-by-three matrix. We find the first element of 𝐴𝐵 by multiplying the top row of matrix 𝐴 by the left-hand column of matrix 𝐵. Remember that this is just the same as finding the dot product of this first row of matrix 𝐴 with the left-hand column of matrix 𝐵.

That is 11 multiplied by negative eight add negative two multiplied by negative four. To get the top middle element, we multiply the top row of matrix 𝐴 with the middle column of matrix 𝐵. That is 11 multiplied by negative nine add negative two multiplied by eight. To get the top right element, we multiply the top row of matrix 𝐴 with the right-hand column of matrix 𝐵. That is 11 multiplied by six add negative two multiplied by nine. We can then find the middle left component by multiplying the middle row of matrix 𝐴 with the left-hand column of matrix 𝐵.

We find the middle component by multiplying the middle row of matrix 𝐴 with the middle column of matrix 𝐵. And we find the middle right component by multiplying together the middle row of matrix 𝐴 with the right-hand column of matrix 𝐵. And we follow the same pattern for the bottom left component, the bottom middle component, and the bottom right component. We can then simplify each component. And that gives us our final answer, which is just as we worked out a three-by-three matrix.

One really important thing to note is that matrix multiplication is not commutative. This means that 𝐴𝐵 is not equal to 𝐵𝐴. We can see how this is the case by considering the dimensions of the matrices in the previous example. If we were to work out the dimensions of the resultant matrix, we would see that we would end up with a two-by-two matrix, whereas 𝐴𝐵 gave us a three-by-three matrix. We can use matrix multiplication to find powers of matrices.

Let’s have a look at an example.

Given that 𝐴 equals negative six, one, negative five, five, find 𝐴 squared.

Remember that 𝐴 squared simply means 𝐴 multiplied by 𝐴. So this simply means the matrix 𝐴 multiplied by the matrix 𝐴. So because 𝐴 is a two-by-two matrix, we’re doing a two-by-two matrix multiplied by a two-by-two matrix. We know this is possible because the number of columns in matrix 𝐴 is of course the same as the number of rows in matrix 𝐴. And the resultant matrix is going to be a two-by-two matrix. We find the top-left component of the resultant matrix by multiplying the top row of the first matrix by the left-hand column of the second matrix. That is negative six times negative six add one times negative five.

We then find the top right-hand component by multiplying the top row of the first matrix by the right-hand column of the second matrix, that is, negative six times one add one times five. We can then find the bottom left component by multiplying the bottom row of the first matrix by the left-hand column of the second matrix. That is negative five times negative six add five times negative five. And we find the bottom right-hand element by doing the bottom row of the first matrix multiplied by the right-hand column of the second matrix. That is negative five times one add five times five.

The first thing I’m going to do is work out each of these multiplications. And we’ve got to be really careful here as we have a lot of negatives. And finally, we can simplify to get our final answer. 𝐴 squared equals 31, negative one, five, 20. One thing to note is that we can use this process to find higher powers of 𝐴. For example, we could find 𝐴 cubed by multiplying 𝐴 squared by 𝐴 on the right. It would look like this.

Let’s see one more example on matrix multiplication.

Given that 𝐴 equals negative three, negative seven, negative one, three, four, one; 𝐵 equals six, negative four, three, find 𝐴𝐵 if possible.

Recall that for the multiplication of matrices 𝐴 and 𝐵, if 𝐴 has dimensions 𝑚 by 𝑛, where 𝑚 is the number of rows and 𝑛 is the number of columns, then 𝐵 must have dimensions 𝑛 by 𝑝 in order for matrix multiplication to work. In other words, matrix 𝐴 must have the same number of columns as the number of rows in matrix 𝐵. Matrix 𝐴 has two rows and three columns, so it has dimensions two by three. Matrix 𝐵 has three rows and one column, so it has dimensions three by one. So as the number of columns of matrix 𝐴 is the same as the number of rows of matrix 𝐵, the product exists.

We can also tell the dimensions of the resultant matrix. For 𝐴 with dimensions 𝑚 by 𝑛 and 𝐵 with dimensions 𝑛 by 𝑝, 𝐴𝐵 has dimensions 𝑚 by 𝑝. So for this question, we can tell that the resulting matrix will have dimensions two by one. It’s always worth checking this before beginning a matrix multiplication question to avoid making any mistakes.

Let’s now go ahead and multiply these matrices together. We find the top component in 𝐴𝐵 by taking the top row of matrix 𝐴 and multiplying it with the column in matrix 𝐵. That is negative three times six add negative seven times negative four add negative one times three. And we get the bottom row in the matrix 𝐴𝐵 by taking the bottom row of the matrix 𝐴 and multiplying it with the column in matrix 𝐵. That is three times six add four times negative four add one times three. We can then multiply the terms together and then simplify to get the final answer. Just as we expected, the resultant matrix 𝐴𝐵 has dimensions two by one.

We can use matrix multiplication to find unknown entries in matrices which are part of a product. As an example, let’s say we know that the product of the matrices three, two, five, 𝑥 and one, three equals nine, negative one. We know that the nine comes from the multiplication of the top row of the first matrix with the column in the second matrix. But the negative one comes from the multiplication of the bottom row of the first matrix with the column in the second matrix. That is five times one add 𝑥 times three. In other words, we know that five add three 𝑥 must give us negative one. So three 𝑥 must be negative six. Therefore, 𝑥 equals negative two.

Let’s see a harder example of this.

Find the values of 𝑥 and 𝑦 given the following: the matrix one, three, negative two, one multiplied by the matrix two, zero, 𝑥, 𝑦 equals the matrix eight, negative nine, negative two, negative three.

To solve this for 𝑥 and 𝑦, we can consider how we obtain some of the components and the resultant matrix. Let’s start with the top left component, which is eight. We know that the eight must’ve been obtained by the multiplication of the top row of the first matrix with the left-hand column of the second matrix. That is one times two add three times 𝑥 equals eight or two add three 𝑥 equals eight. We then obtain that three 𝑥 equals six by subtracting two from both sides. And we find that 𝑥 must be equal to two.

Now if we think about how the negative nine was obtained, as this is the top right element, this is the multiplication of the top row of the first matrix with the right-hand column of the second matrix. That is, one times zero add three times 𝑦 must equal negative nine. This simplifies to three 𝑦 equals negative nine. Therefore, 𝑦 must be equal to negative three. We’re then able to verify our answer by checking that these values of 𝑥 and 𝑦 work for the bottom two values in the resultant matrix.

To get the bottom left value of the resultant matrix negative two, we must do the bottom row of the first matrix multiplied by the left-hand column of the second matrix. That is negative two times two add one times 𝑥, which is two, equals negative two. This gives us negative four add two equals negative two, which is true. So our value of 𝑥 is correct. And we can check the bottom right-hand component of the resultant matrix by multiplying the bottom row of the first matrix with the right-hand column of the second matrix. That is negative two times zero add one times negative three equals negative three. That is zero add negative three equals negative three, which is true. So we know our value for 𝑦 is also correct. It’s always good when possible to confirm the values that you found for 𝑥 and 𝑦.

Let’s now summarize the main points from this video. There are two types of multiplication of matrices: scalar multiplication and matrix multiplication. Matrix multiplication is not commutative. For two matrices 𝐴 and 𝐵, 𝐴 multiplied by 𝐵 is not equal to 𝐵 multiplied by 𝐴. Matrix multiplication is only possible when the first matrix has the same number of columns as the number of rows of the second matrix. And we can use the dimensions of the two matrices we’re multiplying together to find the dimensions of the resultant matrix. We can use matrix multiplication to find powers of matrices. And we can use matrix multiplication to find unknowns in matrix equations by considering how certain components in the resultant matrix are obtained.