Matrix Multiplication
You can only multiply two matrices if their dimensions are compatible , which means the number of columns in the first matrix is the same as the number of rows in the second matrix.
If is an matrix and is an matrix, the product is an matrix.
, where .
(The entry in the row and column is denoted by the double subscript notation , , and . For instance, the entry is the entry in the second row and third column.)
The definition of matrix multiplication indicates a row-by-column multiplication, where the entries in the row of are multiplied by the corresponding entries in the column of and then adding the results.
Matrix multiplication is NOT commutative. If neither nor is an identity matrix, .
Multiplying a Row by a Column
We'll start by showing you how to multiply a matrix by an matrix. The first is just a single row, and the second is a single column. By the rule above, the product is a matrix; in other words, a single number.
First, let's name the entries in the row , and the entries in the column . Then the product of the row and the column is the matrix
.
Example:
Find the product.
We have to multiply a matrix by a matrix. The number of columns in the first is the same as the number of rows in the second, so they are compatible.
The product is:
Multiplying Larger Matrices
Now that you know how to multiply a row by a column, multiplying larger matrices is easy. For the entry in the row and the column of the product matrix, multiply each entry in the row of the first matrix by the corresponding entry in the column of the second matrix and adding the results.
Let's take the following problem, multiplying a matrix with a matrix, to get a matrix as the product. The entries of the product matrix are called when they're in the row and column.
To get , multiply Row of the first matrix by Column of the second.
To get , multiply Row of the first matrix by Column of the second.
To get , multiply Row of the first matrix by Column of the second.
To get , multiply Row of the first matrix by Column of the second.
Writing the product matrix, we get:
Therefore, we have shown: