Become a math whiz with AI Tutoring, Practice Questions & more.

HotmathMath Homework. Do It Faster, Learn It Better.

Matrix Multiplication

Learning how to create matrices is only the beginning as we get further into this new area of math. We can also carry out operations with matrices -- including multiplication. As we''ll soon discover, there are many important things to keep in mind when it comes to multiplication with matrices. Although it might be similar to the multiplication operations we''re already familiar with, there are a number of additional rules we must learn:

Scalar multiplication

The easiest way to multiply a matrix is through scalar multiplication. This is when we multiply a single matrix by a single number. For example, what if we wanted to multiply this matrix by 2?

$\left[\begin{array}{cc}1& 8\\ 4& 2\end{array}\right]$

Only four multiplications are necessary in this situation

$2×1=2,\phantom{\rule{4pt}{0ex}}2×8=16,\phantom{\rule{4pt}{0ex}}2×4=8,\phantom{\rule{4pt}{0ex}}2×2=4$

These products form our resulting matrix:

$\left[\begin{array}{cc}2& 16\\ 8& 4\end{array}\right]$

In other words:

$2×\left[\begin{array}{cc}1& 8\\ 4& 2\end{array}\right]=\left[\begin{array}{cc}2& 16\\ 8& 4\end{array}\right]$

As we can see, this process is quite simple -- and we can use the same basic arithmetic skills that we''re already familiar with.

Multiplying two matrices

Things get a little more complicated when we multiply one matrix by another matrix. This requires a different strategy, and we call this the "dot product" of rows and columns.

The "dot product" is an entire row multiplied by an entire column.

For example, we might multiply this row:

$\left[\begin{array}{ccc}1& 2& 4\end{array}\right]$

By this column:

$\left[\begin{array}{ccc}7& 8& 9\end{array}\right]$

But how exactly do we do this? Essentially, we use the same principles as scalar multiplication:

$\left(1,2,4\right)\cdot \left(7,8,9\right)$

One of the most important things to remember when multiplying matrices is that it''s not the same as multiplying polynomials in an algebraic equation. We do not use the FOIL method, and the operation is not commutative. The above operation is equivalent to:

$1\cdot 7+2\cdot 8+4\cdot 9=59$

Seems pretty straightforward, right? Well, we need to do this for every row and every column for the two matrices. We start with the first row and the first column, then we move to the first row and the second column. Next, we do the second row and the first column before finally tackling the second column. We follow this same pattern regardless of how many columns and rows we have on our matrices.

We categorize our matrices based on their rows and columns. For example:

• A $2×2$ matrix has 2 rows and 2 columns
• A $3×2$ matrix has 3 rows and 2 columns

We also call a $2×2$ matrix a "square matrix" because of its shape.

Why does this matter when we do matrix multiplication? Because we can only multiply matrices if their dimensions are compatible. Matrices are only compatible if the number of columns in the first matrix equals the number of rows in the second column.

For example, we could multiply these two matrices:

$\left[\begin{array}{ccc}1& 2& 3\\ 4& 5& 6\\ 1& 2& 3\end{array}\right]×\left[\begin{array}{ccccc}1& 2& 3& 4& 5\\ 1& 2& 3& 4& 5\\ 1& 2& 3& 4& 5\end{array}\right]$

Why? Because the first matrix has three columns, and the second matrix has three rows.

But we couldn''t multiply these two matrices:

$\left[\begin{array}{cc}4& 5\\ 5& 2\end{array}\right]×\left[\begin{array}{ccccc}1& 2& 3& 4& 5\\ 1& 2& 3& 4& 5\\ 1& 2& 3& 4& 5\end{array}\right]$

Why? Because the first matrix has two columns, while the second matrix has three rows. These numbers are not equal.

We can write this rule with a very specific formula:

If $A=\left[{a}_{ij}\right]$ is an $m×n$ matrix and $B=\left[{b}_{ij}\right]$ is an $n×p$ matrix, then the product $AB$ is an $m×p$ matrix.

In other words:

When we multiply one matrix $\left(m×n\right)$ by another matrix $\left(n×p\right)$ , the result is $\left(m×p\right)$ .

Unless we''re working an identity matrix (explained later), $AB$ cannot equal $BA$ .

Identity matrices

We should also learn about the "identity matrix," as this concept can be very useful when multiplying matrices.

Essentially, the identity matrix is the equivalent of "1" in the world of matrices. It looks like this:

$I=\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}\right]$

Note that this matrix has a number of important features:

• It is square
• It has ones on the main diagonal
• Every other element is 0

As long as our identity matrix has 1s on the main diagonal and 0s everywhere else, it is still an identity matrix. It doesn''t matter whether it''s as small as a $2×2$ matrix or as large as a $100×100$ . As long as the 1s are along the diagonal, our identity matrix can have any number of elements. In other words, we can construct an identity matrix that fits our given matrix, no matter how many columns or rows we might need in order to facilitate a compatible multiplication.

But why is the identity matrix so special?

If the identity matrix is the equivalent of "1" in the world of matrices, this means we can multiply any matrix by the identity matrix and get exactly the same matrix we started with.

It''s the same logic as any number multiplied by 1, such as $8\cdot 1=8$ .

Similarly, the product will be identical to the original matrix. This is useful if we need to find the inverse of a matrix, which is an important step when using matrices to solve systems of linear equations.

We can also use our identity matrix to verify whether two given matrices are inverses of each other. Identity matrices are even more handy when you consider that division operations are impossible with matrices, so finding the inverse is our only option in many cases.

We represent the identity matrix with the letter "I."

We can say that $I\cdot A=A$ and $A\cdot I=A$ .

This shows us that the order of our multiplication doesn''t matter when we multiply a matrix by an identity matrix. In contrast, the order does matter when we multiply two normal, non-identity matrices. This is an important concept to keep in mind since the order does not matter with normal arithmetic multiplication. Remember, multiplying matrices is similar to normal multiplication but not identical. The two notable differences are:

• We get different results based on which matrix comes first
• Matrix multiplication is not commutative (no FOIL method)

Multiplying larger matrices

Now that we know all about multiplying matrices, it''s time to move on to something a little more challenging. Consider the following:

$\left[\begin{array}{ccc}1& 0& 1\\ 0& 1& 2\end{array}\right]\left[\begin{array}{cc}3& 5\\ -1& 0\\ 2& -1\end{array}\right]$

How would we multiply these two matrices? A smart starting point would be to write out our resulting matrix with variables:

$\left[\begin{array}{cc}{e}_{11}& {e}_{12}\\ {e}_{21}& {e}_{22}\end{array}\right]$

Let''s start with ${e}_{11}$ . We know that to get ${e}_{11}$ , we need to multiply row 1 of the first matrix by column 2 of the second matrix. We can write this as:

${e}_{11}=\left[\begin{array}{ccc}1& 0& 1\end{array}\right]\left[\begin{array}{c}3\\ -1\\ 2\end{array}\right]=1\left(3\right)+0\left(-1\right)+1\left(2\right)=5$

Great! Now we have our first element for our resulting matrix. ${e}_{11}=5$

Now we can do exactly the same operation to find the other three elements of our resulting matrix:

${e}_{12}=\left[\begin{array}{ccc}1& 0& 1\end{array}\right]\left[\begin{array}{c}5\\ 0\\ -1\end{array}\right]=1\left(5\right)+0\left(0\right)+1\left(-1\right)=4$

${e}_{12}=4$

${e}_{21}=\left[\begin{array}{ccc}0& 1& 2\end{array}\right]\left[\begin{array}{c}3\\ -1\\ 2\end{array}\right]=0\left(3\right)+1\left(-1\right)+2\left(2\right)=3$

${e}_{21}=3$

${e}_{22}=\left[\begin{array}{ccc}0& 1& 2\end{array}\right]\left[\begin{array}{c}5\\ 0\\ -1\end{array}\right]=0\left(5\right)+1\left(0\right)+2\left(-1\right)=-2$

${e}_{22}=-2$

Now we know all our values for our resulting matrix. We can replace our variables with the results:

$\left[\begin{array}{cc}5& 4\\ 3& -2\end{array}\right]$

Therefore: $\left[\begin{array}{ccc}1& 0& 1\\ 0& 1& 2\end{array}\right]\left[\begin{array}{cc}3& 5\\ -1& 0\\ 2& -1\end{array}\right]=\left[\begin{array}{cc}5& 4\\ 3& -2\end{array}\right]$

Pair your student with a suitable tutor who understands how to multiply matrices

One of the most important requirements for learning how to multiply matrices is to get plenty of practice. But what if your student isn''t getting enough time to hone their skills during class time? In this case, you can have Varsity Tutors pair your student up with a suitable tutor who understands this concept in depth. Tutors can customize lesson plans based on your student''s learning style, choosing verbal techniques for verbal learners and visual techniques for visual learners. They can even use examples that match your student''s hobbies to make learning more fun and engaging. Reach out to our Educational Directors today and rest assured: Varsity Tutors will pair your student with a suitable tutor.

;