Skip to main content
Logo image

Elementary Linear Algebra: For University of Lethbridge Math 1410

Section 4.2 Matrix Multiplication

In the previous section we found that the definition of matrix addition was very intuitive, and we ended that section discussing the fact that eventually we’d like to know what it means to multiply matrices together.
In the spirit of the last section, take another wild stab: what do you think
\begin{equation*} \bbm 1 \amp 2\\3 \amp 4\ebm \times \bbm 1\amp -1\\2\amp 2\ebm \end{equation*}
means?
You are likely to have guessed
\begin{equation*} \bbm 1 \amp -2\\6 \amp 8\ebm \end{equation*}
but this is, in fact, not right. (You could define multiplication this way; you’ll even find that it satisfies plenty of nice properties. Unfortunately, nice properties don’t make up for the fact that this definition just isn’t useful.) The actual answer is
\begin{equation*} \bbm 5 \amp 3\\11 \amp 5\ebm\text{.} \end{equation*}
If you can look at this one example and suddenly understand exactly how matrix multiplication works, then you are probably smarter than the author. While matrix multiplication isn’t hard, it isn’t nearly as intuitive as matrix addition is.
To further muddy the waters (before we clear them), consider
\begin{equation*} \bbm 1 \amp 2\\3 \amp 4\ebm \times \bbm 1\amp -1\amp 0\\2\amp 2\amp -1\ebm\text{.} \end{equation*}
Our experience from the last section would lend us to believe that this is not defined, but our confidence is probably a bit shaken by now. In fact, this multiplication is defined, and it is
\begin{equation*} \bbm 5 \amp 3 \amp -2\\11\amp 5\amp -4\ebm\text{.} \end{equation*}
You may see some similarity in this answer to what we got before, but again, probably not enough to really figure things out.
Before diving in to the general definition of matrix multiplication, let’s start simple, with row and column vectors. Recall from Definition 4.1.3 in Section 4.1 that a row vector is a \(1\times n\) matrix of the form \(\vec a = \bbm a_1 \amp a_2 \amp \cdots \amp a_n\ebm\text{,}\) and a column vector is an \(m\times 1\) matrix of the form \(\vec{b} = \bbm b_1\\b_2\\\vdots \\ b_m\ebm\text{.}\)

Definition 4.2.1. Multiplying a row vector by a column vector.

Let \(\vu\) be an \(1\times n\) row vector with entries \(u_1, u_2, \cdots, u_n\) and let \(\vvv\) be an \(n\times 1\) column vector with entries \(v_1, v_2, \cdots, v_n\text{.}\) The product of \(\vu\) and \vvv, denoted \(\dotp uv\) or \(\vu\vvv\text{,}\) is
\begin{equation*} \vu\vvv = \sum_{i=1}^n u_iv_i = u_1v_1 + u_2v_2 + \cdots + u_nv_n\text{.} \end{equation*}
Notice that this is essentially the same as the definition of the dot product given at the beginning of Section 2.7. There are two key points to notice about the product defined in Definition 4.2.1:
  1. In order for the product \(\vu\vvv\) to be defined, \(\vu\) and \(\vvv\) need to have the same number of entries.
  2. To multiply \(\vu\) and \(\vvv\text{,}\) we multiply the corresponding entries, and then add up the resulting values.

Example 4.2.2. Multiplying row and column vectors.

Let
\begin{equation*} \vu = \bbm 1 \amp 2 \amp 3\ebm,\ \vvv = \bbm 2\amp 0\amp 1\amp -1\ebm,\ \vx = \bbm-2\\4\\3\ebm,\ \vy = \bbm 1\\2\\5\\0\ebm\text{.} \end{equation*}
Find the following products.
  1. \(\displaystyle \vu\vx\)
  2. \(\displaystyle \vvv\vy\)
  3. \(\displaystyle \vu\vy\)
  4. \(\displaystyle \vu\vvv\)
  5. \(\displaystyle \vx\vu\)
Solution.
  1. \(\displaystyle \vu\vx = \bbm 1\amp 2\amp 3\ebm\bbm-2\\4\\3\ebm = 1(-2)+2(4)+3(3) = 15\)
  2. \(\displaystyle \vvv\vy = \bbm 2\amp 0\amp 1\amp -1\ebm\bbm 1\\2\\5\\0\ebm = 2(1)+0(2)+1(5)-1(0) = 7\)
  3. \(\vu\vy\) is not defined; Definition 4.2.1 specifies that in order to multiply a row vector and column vector, they must have the same number of entries.
  4. \(\vu\vvv\) is not defined; we only know how to multipy row vectors by column vectors. We haven’t defined how to multiply two row vectors (in general, it can’t be done).
  5. The product \(\vx\vu\) is defined, but we don’t know how to do it yet. Right now, we only know how to multiply a row vector times a column vector; we don’t know how to multiply a column vector times a row vector. (That’s right: \(\vu\vx \neq \vx\vu!\))
Now that we understand how to multiply a row vector by a column vector, we are ready to define matrix multiplication.

Definition 4.2.3. Matrix Multiplication.

Let \(\tta\) be an \(m\times r\) matrix, and let \(\ttb\) be an \(r\times n\) matrix. The matrix product of \(\tta\) and \ttb, denoted \(\tta\cdot\ttb\text{,}\) or simply \(\tta\ttb\text{,}\) is the \(m\times n\) matrix \(\ttm\) whose entry in the \(i\)th row and \(j\)th column is the product of the \(i\)th row of \(\tta\) and the \(j\)th column of \(\ttb\text{.}\)
It may help to illustrate it in this way. Let matrix \(\tta\) have rows \(\vec{a}_{1}\text{,}\) \(\vec{a}_{2}\text{,}\) \(\cdots\text{,}\) \(\vec{a}_{m}\) and let \(\ttb\) have columns \(\vec{b}_{1}\text{,}\) \(\vec{b}_{2}\text{,}\) \(\cdots\text{,}\) \(\vec{b}_{n}\text{.}\) Thus \(\tta\) looks like
\begin{equation*} \bbm- \amp \vec{a}_{1} \amp -\\-\amp \vec{a}_{2}\amp -\\ \amp \vdots \amp \\ -\amp \vec{a}_{m}\amp -\ebm\text{,} \end{equation*}
where the “\(-\)” symbols just serve as reminders that the \(\vec{a}_{i}\) represent rows, and \(\ttb\) looks like
\begin{equation*} \bbm|\amp |\amp \amp |\\\vec{b}_{1}\amp \vec{b}_{2}\amp \cdots\amp \vec{b}_{n}\\|\amp |\amp \amp |\ebm\text{,} \end{equation*}
where again, the “\(|\)” symbols just remind us that the \(\vec{b}_{i}\) represent column vectors. Then
\begin{equation*} \tta\ttb = \bbm\vec{a}_{1}\vec{b}_{1} \amp \vec{a}_{1}\vec{b}_{2} \amp \cdots \amp \vec{a}_{1}\vec{b}_{n}\\ \vec{a}_{2}\vec{b}_{1} \amp \vec{a}_{2}\vec{b}_{2} \amp \cdots \amp \vec{a}_{2}\vec{b}_{n}\\ \vdots \amp \vdots \amp \ddots \amp \vdots \\ \vec{a}_{m}\vec{b}_{1} \amp \vec{a}_{m}\vec{b}_{2} \amp \cdots \amp \vec{a}_{m}\vec{b}_{n}\ebm\text{.} \end{equation*}
Two quick notes about this definition. First, notice that in order to multiply \(\tta\) and \(\ttb\text{,}\) the number of columns of \(\tta\) must be the same as the number of rows of \(\ttb\) (we refer to these as the “inner dimensions”). Secondly, the resulting matrix has the same number of rows as \(\tta\) and the same number of columns as \(\ttb\) (we refer to these as the “outer dimensions”).
\begin{equation*} \overbrace{(m\times\hspace{-38pt} \underbrace{r) \times (r}_\text{these inner dimensions must match}\hspace{-38pt}\times n)}^\text{final dimensions are the outer dimensions} \end{equation*}
Of course, this will make much more sense when we see an example.

Example 4.2.4. A more general matrix product.

Revisit the matrix product we saw at the beginning of this section; multiply
\begin{equation*} \bbm 1 \amp 2\\3 \amp 4\ebm\bbm 1\amp -1\amp 0\\2\amp 2\amp -1\ebm\text{.} \end{equation*}
Solution.
Let’s call our first matrix \(\tta\) and the second \(\ttb\text{.}\) We should first check to see that we can actually perform this multiplication. Matrix \(\tta\) is \(2\times 2\) and \(\ttb\) is \(2\times 3\text{.}\) The “inner” dimensions match up, so we can compute the product; the “outer” dimensions tell us that the product will be \(2\times 3\text{.}\) Let
\begin{equation*} \tta\ttb = \bbm m_{11} \amp m_{12} \amp m_{13}\\m_{21} \amp m_{22} \amp m_{23}\ebm\text{.} \end{equation*}
Let’s find the value of each of the entries.
The entry \(m_{11}\) is in the first row and first column; therefore to find its value, we need to multiply the first row of \(\tta\) by the first column of \(\ttb\text{.}\) Thus
\begin{equation*} m_{11} = \bbm 1 \amp 2\ebm\bbm 1\\2\ebm = 1(1)+2(2) = 5\text{.} \end{equation*}
So now we know that
\begin{equation*} \tta\ttb = \bbm 5 \amp m_{12} \amp m_{13}\\m_{21} \amp m_{22} \amp m_{23}\ebm\text{.} \end{equation*}
Finishing out the first row, we have
\begin{equation*} m_{12} = \bbm 1 \amp 2\ebm\bbm-1\\2\ebm = 1(-1)+2(2) = 3 \end{equation*}
using the first row of \(\tta\) and the second column of \(\ttb\text{,}\) and
\begin{equation*} m_{13} = \bbm 1 \amp 2\ebm\bbm 0\\-1\ebm = 1(0)+2(-1) = -2 \end{equation*}
using the first row of \(\tta\) and the third column of \(\ttb\text{.}\) Thus we have
\begin{equation*} \tta\ttb = \bbm 5 \amp 3 \amp -2\\m_{21} \amp m_{22} \amp m_{23}\ebm\text{.} \end{equation*}
To compute the second row of \(\tta\ttb\text{,}\) we multiply with the second row of \(\tta\text{.}\) We find
\begin{align*} m_{21} \amp = \bbm 3\amp 4\ebm\bbm 1\\2\ebm = 11,\\ m_{22} \amp = \bbm 3\amp 4\ebm\bbm-1\\2\ebm = 5, \text{ and}\\ m_{23} \amp = \bbm 3\amp 4\ebm\bbm 0\\-1\ebm = -4\text{.} \end{align*}
Thus
\begin{equation*} \tta\ttb = \bbm 1 \amp 2\\3 \amp 4\ebm\bbm 1\amp -1\amp 0\\2\amp 2\amp -1\ebm = \bbm 5 \amp 3 \amp -2\\11 \amp 5 \amp -4\ebm\text{.} \end{equation*}

Example 4.2.5. Multiplying matrices.

Multiply
\begin{equation*} \bbm 1 \amp -1\\5 \amp 2\\-2\amp 3\ebm\bbm 1\amp 1\amp 1\amp 1\\2\amp 6\amp 7\amp 9\ebm\text{.} \end{equation*}
Solution.
Let’s first check to make sure this product is defined. Again calling the first matrix \(\tta\) and the second \(\ttb\text{,}\) we see that \(\tta\) is a \(3\times 2\) matrix and \(\ttb\) is a \(2\times4\) matrix; the inner dimensions match so the product is defined, and the product will be a \(3\times 4\) matrix,
\begin{equation*} \tta\ttb = \bbm m_{11} \amp m_{12} \amp m_{13}\amp m_{14}\\ m_{21}\amp m_{22}\amp m_{23}\amp m_{24}\\m_{31}\amp m_{32}\amp m_{33}\amp m_{34}\ebm\text{.} \end{equation*}
We will demonstrate how to compute some of the entries, then give the final answer. The reader can fill in the details of how each entry was computed.
\begin{align*} m_{11} \amp = \bbm 1\amp -1\ebm\bbm 1\\2\ebm = -1\\ m_{13} \amp = \bbm 1\amp -1\ebm\bbm 1\\7\ebm = -6\\ m_{23} \amp = \bbm 5\amp 2\ebm\bbm 1\\7\ebm = 19\\ m_{24} \amp = \bbm 5\amp 2\ebm\bbm 1\\9\ebm = 23\\ m_{32} \amp = \bbm-2\amp 3\ebm\bbm 1\\6\ebm = 16\\ m_{34} \amp = \bbm-2\amp 3\ebm\bbm 1\\9\ebm = 25\text{.} \end{align*}
So far, we’ve computed this much of \(\tta\ttb\text{:}\)
\begin{equation*} \tta\ttb = \bbm-1 \amp m_{12} \amp -6\amp m_{14}\\ m_{21}\amp m_{22}\amp 19\amp 23\\m_{31}\amp 16\amp m_{33}\amp 25\ebm\text{.} \end{equation*}
The final product is
\begin{equation*} \tta\ttb = \bbm-1 \amp -5 \amp -6\amp -8\\ 9\amp 17\amp 19\amp 23\\4\amp 16\amp 19\amp 25\ebm\text{.} \end{equation*}

Example 4.2.6. An undefined product.

Multiply, if possible,
\begin{equation*} \bbm 2 \amp 3 \amp 4\\9\amp 8\amp 7\ebm\bbm 3\amp 6\\5\amp -1\ebm\text{.} \end{equation*}
Solution.
Again, we’ll call the first matrix \(\tta\) and the second \(\ttb\text{.}\) Checking the dimensions of each matrix, we see that \(\tta\) is a \(2\times 3\) matrix, whereas \(\ttb\) is a \(2\times2\) matrix. The inner dimensions do not match, therefore this multiplication is not defined.

Example 4.2.7. A vector product revisited.

In Example 4.2.2, we were told that the product \(\vx\vu\) was defined, where
\begin{equation*} \vx =\bbm-2\\4\\3\ebm \quad \text{and} \quad \vu = \bbm 1 \amp 2\amp 3\ebm\text{,} \end{equation*}
although we were not shown what that product was. Find \(\vx\vu\text{.}\)
Solution.
Again, we need to check to make sure the dimensions work correctly (remember that even though we are referring to \(\vu\) and \(\vx\) as vectors, they are, in fact, just matrices).
The column vector \(\vx\) has dimensions \(3\times1\text{,}\) whereas the row vector \(\vu\) has dimensions \(1\times 3\text{.}\) Since the inner dimensions match, the matrix product is defined; the outer dimensions tell us that the product will be a \(3\times3\) matrix, as shown below:
\begin{equation*} \vx\vu = \bbm m_{11} \amp m_{12} \amp m_{13}\\ m_{21}\amp m_{22}\amp m_{23}\\m_{31}\amp m_{32}\amp m_{33}\ebm\text{.} \end{equation*}
To compute the entry \(m_{11}\text{,}\) we multiply the first row of \(\vx\) by the first column of \(\vu\text{.}\) What is the first row of \(\vx\text{?}\) Simply the number \(-2\text{.}\) What is the first column of \(\vu\text{?}\) Just the number 1. Thus \(m_{11} = -2\text{.}\) (This does seem odd, but through checking, you can see that we are indeed following the rules.)
What about the entry \(m_{12}\text{?}\) Again, we multiply the first row of \(\vx\) by the first column of \(\vu\text{;}\) that is, we multiply \(-2(2)\text{.}\) So \(m_{12} = -4\text{.}\)
What about \(m_{23}\text{?}\) Multiply the second row of \(\vx\) by the third column of \(\vu\text{;}\) multiply \(4(3)\text{,}\) so \(m_{23} = 12\text{.}\)
One final example: \(m_{31}\) comes from multiplying the third row of\(\vx\text{,}\) which is 3, by the first column of \(\vu\text{,}\) which is 1. Therefore \(m_{31} = 3\text{.}\)
So far we have computed
\begin{equation*} \vx\vu = \bbm-2 \amp -4 \amp m_{13}\\ m_{21}\amp m_{22}\amp 12\\3\amp m_{32}\amp m_{33}\ebm\text{.} \end{equation*}
After performing all 9 multiplications, we find
\begin{equation*} \vx\vu = \bbm-2 \amp -4 \amp -6\\ 4\amp 8\amp 12\\3\amp 6\amp 9\ebm\text{.} \end{equation*}
In this last example, we saw a “nonstandard” multiplication (at least, it felt nonstandard). Studying the entries of this matrix, it seems that there are several different patterns that can be seen amongst the entries. (Remember that mathematicians like to look for patterns. Also remember that we often guess wrong at first; don’t be scared and try to identify some patterns.)
In Section 4.1, we identified the zero matrix \(\tto\) that had a nice property in relation to matrix addition (i.e., \(\tta+\tto = \tta\) for any matrix \(\tta\)). In the following example we’ll identify a matrix that works well with multiplication as well as some multiplicative properties. For instance, we’ve learned how \(1\cdot\tta = \tta\text{;}\) is there a matrix that acts like the number 1? That is, can we find a matrix \(\ttx\) where \(\ttx\cdot\tta=\tta\text{?}\) (We made a guess in Section 4.1 that maybe a matrix of all 1s would work, but you can probably already see that this guess is doomed to failure.)

Example 4.2.8. Computing matrix products.

Let
\begin{align*} \tta \amp = \bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm, \amp \ttb \amp = \bbm 1\amp 1\amp 1\\1\amp 1\amp 1\\1\amp 1\amp 1\ebm\\ \ttc \amp = \bbm 1\amp 0\amp 2\\2\amp 1\amp 0\\0\amp 2\amp 1\ebm, \amp \tti \amp = \bbm 1\amp 0\amp 0\\0\amp 1\amp 0\\0\amp 0\amp 1\ebm\text{.} \end{align*}
Find the following products.
  1. \(\displaystyle \tta\ttb\)
  2. \(\displaystyle \ttb\tta\)
  3. \(\displaystyle \tta\tto_{3\times4}\)
  4. \(\displaystyle \tta\tti\)
  5. \(\displaystyle \tti\tta\)
  6. \(\displaystyle \tti^2\)
  7. \(\displaystyle \ttb\ttc\)
  8. \(\displaystyle \ttb^2\)
Solution.
We will find each product, but we leave the details of each computation to the reader.
  1. \(\displaystyle \tta\ttb = \bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm\bbm 1\amp 1\amp 1\\1\amp 1\amp 1\\1\amp 1\amp 1\ebm = \bbm 6\amp 6\amp 6\\0\amp 0\amp 0\\-7\amp -7\amp -7\ebm\)
  2. \(\displaystyle \ttb\tta = \bbm 1\amp 1\amp 1\\1\amp 1\amp 1\\1\amp 1\amp 1\ebm\bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm = \bbm 1\amp -13\amp 11\\1\amp -13\amp 11\\1\amp -13\amp 11\ebm\)
  3. \(\tta\tto_{3\times4} = \tto_{3\times4}\text{.}\)
  4. \(\displaystyle \tta\tti = \bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm\eyethree = \bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm\)
  5. \(\displaystyle \tti\tta = \eyethree\bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm = \bbm 1\amp 2\amp 3\\2\amp -7\amp 5\\-2\amp -8\amp 3\ebm\)
  6. We haven’t formally defined what \(\tti^2\) means, but we could probably make the reasonable guess that \(\tti^2=\tti\cdot\tti \text{.}\) Thus
    \begin{equation*} \tti^2 = \eyethree\eyethree = \eyethree\text{.} \end{equation*}
  7. \(\displaystyle \ttb\ttc = \bbm 1\amp 1\amp 1\\1\amp 1\amp 1\\1\amp 1\amp 1\ebm \bbm 1\amp 0\amp 2\\2\amp 1\amp 0\\0\amp 2\amp 1\ebm = \bbm 3\amp 3\amp 3\\3\amp 3\amp 3\\3\amp 3\amp 3\ebm\)
  8. \(\displaystyle \ttb^2 = \ttb\ttb = \bbm 1\amp 1\amp 1\\1\amp 1\amp 1\\1\amp 1\amp 1\ebm\bbm 1\amp 1\amp 1\\1\amp 1\amp 1\\1\amp 1\amp 1\ebm=\bbm 3\amp 3\amp 3\\3\amp 3\amp 3\\3\amp 3\amp 3\ebm\)
This example is simply chock full of interesting ideas; it is almost hard to think about where to start.
Interesting Idea #1
Notice that in our example, \(\tta\ttb \neq \ttb\tta\text{!}\) When dealing with numbers, we were used to the idea that \(ab = ba\text{.}\) With matrices, multiplication is not commutative. (Of course, we can find special situations where it does work. In general, though, it doesn’t.)
Interesting Idea #2
Right before this example we wondered if there was a matrix that “acted like the number 1,” and guessed it may be a matrix of all 1s. However, we found out that such a matrix does not work in that way; in our example, \(\tta\ttb \neq \tta\text{.}\) We did find that \(\tta\tti = \tti\tta = \tta\text{.}\) There is a Multiplicative Identity; it just isn’t what we thought it would be. And just as \(1^2 = 1\text{,}\) \(\tti^2 = \tti\text{.}\)
Interesting Idea #3
When dealing with numbers, we are very familiar with the notion that “If \(ax = bx\text{,}\) then \(a=b\text{.}\)” (As long as \(x\neq 0\text{.}\)) Notice that, in our example, \(\ttb\ttb = \ttb\ttc\text{,}\) yet \(\ttb\neq\ttc\text{.}\) In general, just because \(\tta\ttx = \ttb\ttx\text{,}\) we cannot conclude that \(\tta =\ttb\text{.}\)
Matrix multiplication is turning out to be a very strange operation. We are very used to multiplying numbers, and we know a bunch of properties that hold when using this type of multiplication. When multiplying matrices, though, we probably find ourselves asking two questions, “What does work?” and “What doesn’t work?” We’ll answer these questions; first we’ll do an example that demonstrates some of the things that do work.

Example 4.2.9. Exploring properties of matrix multiplication.

Let
\begin{equation*} \tta = \bbm 1 \amp 2\\3 \amp 4\ebm,\quad \ttb = \bbm 1\amp 1\\1\amp -1\ebm \quad \text{and} \quad \ttc=\bbm 2\amp 1\\1\amp 2\ebm\text{.} \end{equation*}
Find the following:
  1. \(\displaystyle \tta(\ttb+\ttc)\)
  2. \(\displaystyle \tta\ttb+\tta\ttc\)
  3. \(\displaystyle \tta(\ttb\ttc)\)
  4. \(\displaystyle (\tta\ttb)\ttc\)
Solution.
We’ll compute each of these without showing all the intermediate steps. Keep in mind order of operations: things that appear inside of parentheses are computed first.
  1. \begin{align*} \tta(\ttb+\ttc) \amp = \bbm 1\amp 2\\3\amp 4\ebm\left(\bbm 1\amp 1\\1\amp -1\ebm+\bbm 2\amp 1\\1\amp 2\ebm\right)\\ \amp = \bbm 1\amp 2\\3\amp 4\ebm\bbm 3\amp 2\\2\amp 1\ebm\\ \amp = \bbm 7\amp 4\\17\amp 10\ebm \end{align*}
  2. \begin{align*} \tta\ttb+\tta\ttc \amp = \bbm 1\amp 2\\3\amp 4\ebm\bbm 1\amp 1\\1\amp -1\ebm+\bbm 1\amp 2\\3\amp 4\ebm\bbm 2\amp 1\\1\amp 2\ebm\\ \amp = \bbm 3\amp -1\\7\amp -1\ebm + \bbm 4\amp 5\\10\amp 11\ebm\\ \amp = \bbm 7\amp 4\\17\amp 10\ebm \end{align*}
  3. \begin{align*} \tta(\ttb\ttc) \amp = \bbm 1\amp 2\\3\amp 4\ebm\left(\bbm 1\amp 1\\1\amp -1\ebm\bbm 2\amp 1\\1\amp 2\ebm\right)\\ \amp = \bbm 1\amp 2\\3\amp 4\ebm\bbm 3\amp 3\\1\amp -1\ebm\\ \amp = \bbm 5\amp 1\\13\amp 5\ebm \end{align*}
  4. \begin{align*} \left(\tta\ttb\right)\ttc \amp = \left(\bbm 1\amp 2\\3\amp 4\ebm\bbm 1\amp 1\\1\amp -1\ebm\right)\bbm 2\amp 1\\1\amp 2\ebm\\ \amp = \bbm 3\amp -1\\7\amp -1\ebm\bbm 2\amp 1\\1\amp 2\ebm\\ \amp = \bbm 5\amp 1\\13\amp 5\ebm \end{align*}
In looking at our example, we should notice two things. First, it looks like the “distributive property” holds; that is, \(\tta(\ttb+\ttc) = \tta\ttb + \tta\ttc\text{.}\) This is nice as many algebraic techniques we have learned about in the past (when doing “ordinary algebra”) will still work. Secondly, it looks like the “associative property” holds; that is, \(\tta(\ttb\ttc) = (\tta\ttb)\ttc\text{.}\) This is nice, for it tells us that when we are multiplying several matrices together, we don’t have to be particularly careful in what order we multiply certain pairs of matrices together.
In leading to an important theorem, let’s define a matrix we saw in an earlier example.

Definition 4.2.10. Identity Matrix.

The \(n\times n\) matrix with 1s on the diagonal and zeros elsewhere is the \(n\times n\) identity matrix, denoted \(\tti_n\text{.}\) When the context makes the dimension of the identity clear, the subscript is generally omitted.
Note that while the zero matrix can come in all different shapes and sizes, the identity matrix is always a square matrix. We show a few identity matrices below.
\begin{equation*} \tti_2= \eyetwo ,\quad \tti_3 = \eyethree , \quad \tti_4 = \eyefour\text{.} \end{equation*}
In our examples above, we have seen examples of things that do and do not work. We should be careful about what examples prove, though. If someone were to claim that \(\tta\ttb = \ttb\tta\) is always true, one would only need to show them one example where they were false, and we would know the person was wrong. However, if someone claims that \(\tta(\ttb+\ttc) = \tta\ttb+\tta\ttc\) is always true, we can’t prove this with just one example. We need something more powerful; we need a true proof.
In this text, we forgo most proofs. The reader should know, though, that when we state something in a theorem, there is a proof that backs up what we state. Our justification comes from something stronger than just examples.
Now we give the good news of what does work when dealing with matrix multiplication.
The above box contains some very good news, and probably some very surprising news. Matrix multiplication probably seems to us like a very odd operation, so we probably wouldn’t have been surprised if we were told that \(\tta(\ttb\ttc)\neq(\tta\ttb)\ttc\text{.}\) It is a very nice thing that the Associative Property does hold.
As we near the end of this section, we raise one more issue of notation. We define \(\tta^0 = \tti\text{.}\) If \(n\) is a positive integer, we define
\begin{equation*} \tta^n = \underbrace{\tta\cdot\tta\cdot \ \cdots\ \cdot\tta}_{n \text{ times}}\text{.} \end{equation*}
With numbers, we are used to \(a^{-n} = \frac{1}{a^n}\text{.}\) Do negative exponents work with matrices, too? The answer is yes, sort of. We’ll have to be careful, and we’ll cover the topic in detail once we define the inverse of a matrix. For now, though, we recognize the fact that \(\tta^{-1} \neq \frac{1}{\tta}\text{,}\) for \(\frac{1}{\tta}\) makes no sense; we don’t know how to “divide” by a matrix.
We end this section with a reminder of some of the things that do not work with matrix multiplication. The good news is that there are really only two things on this list.
  1. Matrix multiplication is not commutative; that is, \(\tta\ttb \neq \ttb\tta\text{.}\)
  2. In general, just because \(\tta\ttx = \ttb\ttx\text{,}\) we cannot conclude that \(\tta=\ttb\text{.}\)
The bad news is that these ideas pop up in many places where we don’t expect them. For instance, we are used to
\begin{equation*} (a+b)^2 = a^2+2ab+b^2\text{.} \end{equation*}
What about \((\tta+\ttb)^2\text{?}\) All we’ll say here is that
\begin{equation*} (\tta+\ttb)^2 \neq \tta^2+2\tta\ttb+\ttb^2; \end{equation*}
we leave it to the reader to figure out why.

Exercises Exercises

Exercise Group.

Row and column vectors \(\vu\) and \(\vvv\) are given. Find the product \(\vu\vvv\text{,}\) where possible.
1.
\(\vu = \bbm 1 \amp -4\ebm \quad \vvv = \bbm -2\\5\ebm\)
2.
\(\vu = \bbm 2 \amp 3\ebm \quad \vvv = \bbm 7\-4\ebm\)
3.
\(\vu = \bbm 1 \amp -1\ebm \quad \vvv = \bbm 3\\3\ebm\)
4.
\(\vu = \bbm 0.6 \amp 0.8\ebm \quad \vvv = \bbm 0.6\\0.8\ebm\)
5.
\(\vu = \bbm 1 \amp 2 \amp -1\ebm \ \vvv = \bbm 2\\1\\-1\ebm\)
6.
\(\vu = \bbm 3 \amp 2 \amp -2\ebm \ \vvv = \bbm -1\\0\\9\ebm\)
7.
\(\vu = \bbm 8 \amp -4 \amp 3\ebm \ \vvv = \bbm 2\\4\\5\ebm\)
8.
\(\vu = \bbm -3 \amp 6 \amp 1\ebm\) \ \(\vvv = \bbm 1\-1\\1\ebm\)
9.
\(\vu = \bbm 1 \amp 2\amp 3\amp 4\ebm\) \(\vvv = \bbm 1\\-1\\1\\-1\ebm\)
10.
\(\vu = \bbm 6 \amp 2\amp -1\amp 2\ebm\) \(\vvv = \bbm 3\\2\\9\\5\ebm\)
11.
\(\vu = \bbm 1 \amp 2 \amp 3\ebm \quad \vvv = \bbm 3\\2\ebm\)
12.
\(\vu = \bbm 2 \amp -5\ebm \quad \vvv = \bbm 1\\1\\1\ebm\)

Exercise Group.

Matrices \(\tta\) and \(\ttb\) are defined.
  1. Give the dimensions of \(\tta\) and \(\ttb\text{.}\) If the dimensions properly match, give the dimensions of \(\tta\ttb\) and \(\ttb\tta\text{.}\)
  2. Find the products \(\tta\ttb\) and \(\ttb\tta\text{,}\) if possible.
13.
\(\tta = \bbm 1\amp 2\\-1\amp 4\ebm\text{,}\) \(\ttb = \bbm 2\amp 5\\3\amp -1\ebm\)
14.
\(\tta = \bbm 3\amp 7\\2\amp 5\ebm\text{,}\) \(\ttb = \bbm 1\amp -1\\3\amp -3\ebm\)
15.
\(\tta = \bbm 3\amp -1\\2\amp 2\ebm\text{,}\) \(\ttb = \bbm 1\amp 0\amp 7\\4\amp 2\amp 9\ebm\)
16.
\(\tta = \bbm 0\amp 1\\1\amp -1\\-2\amp -4\ebm\text{,}\) \(\ttb = \bbm-2\amp 0\\3\amp 8\ebm\)
17.
\(\tta = \bbm 9\amp 4\amp 3\\9\amp -5\amp 9\ebm\text{,}\) \(\ttb = \bbm-2\amp 5\\-2\amp -1\ebm\)
18.
\(\tta = \bbm -2\amp -1\\9\amp -5\\3\amp -1\ebm\text{,}\) \(\ttb = \bbm-5\amp 6\amp -4\\0\amp 6\amp -3\ebm\)
19.
\(\tta = \bbm 2\amp 6\\6\amp 2\\5\amp -1\ebm\text{,}\) \(\ttb = \bbm-4 \amp 5 \amp 0\\-4\amp 4\amp -4\ebm\)
20.
\(\tta = \bbm -5\amp 2\\ -5\amp -2\\-5\amp -4\ebm\text{,}\) \(\ttb = \bbm 0\amp -5\amp 6\\ -5\amp -3\amp -1\ebm\)
21.
\(\tta = \bbm 8\amp -2\\ 4\amp 5\\ 2\amp -5\ebm\text{,}\) \(\ttb = \bbm -5\amp 1\amp -5\\ 8\amp 3\amp -2\ebm\)
22.
\(\tta = \bbm 1\amp 4\\ 7\amp 6\ebm\text{,}\) \(\ttb = \bbm 1\amp -1\amp -5\amp 5\\ -2\amp 1\amp 3\amp -5\ebm \)
23.
\(\tta = \bbm -1\amp 5\\ 6\amp 7\ebm\text{,}\) \(\ttb = \bbm 5\amp -3\amp -4\amp -4\\ -2\amp -5\amp -5\amp -1\ebm \)
24.
\(\tta = \bbm -1\amp 2\amp 1\\ -1\amp 2\amp -1\\ 0\amp 0\amp -2\ebm\text{,}\) \(\ttb = \bbm 0\amp 0\amp -2\\ 1\amp 2\amp -1\\ 1\amp 0\amp 0\ebm\)
25.
\(\tta = \bbm -1\amp 1\amp 1\\ -1\amp -1\amp -2\\ 1\amp 1\amp -2\ebm\text{,}\) \(\ttb = \bbm -2\amp -2\amp -2\\ 0\amp -2\amp 0\\ -2\amp 0\amp 2\ebm\)
26.
\(\tta = \bbm -4\amp 3\amp 3\\ -5\amp -1\amp -5\\ -5\amp 0\amp -1\ebm\text{,}\) \(\ttb = \bbm 0\amp 5\amp 0\\ -5\amp -4\amp 3\\ 5\amp -4\amp 3\ebm\)
27.
\(\tta = \bbm -4\amp -1\amp 3\\ 2\amp -3\amp 5\\ 1\amp 5\amp 3\ebm\text{,}\) \(\ttb = \bbm -2\amp 4\amp 3\\ -1\amp 1\amp -1\\ 4\amp 0\amp 2\ebm\)

Exercise Group.

A diagonal matrix \(\ttd\) and a matrix \(\tta\) are given. Find the products \(\ttd\tta\) and \(\tta\ttd\text{,}\) where possible.
28.
\(\ttd = \bbm -1\amp 0\amp 0\\ 0\amp 2\amp 0\\ 0\amp 0\amp 3\ebm\text{,}\) \(\tta = \bbm 1\amp 2\amp 3\\ 4\amp 5\amp 6\\ 7\amp 8\amp 9\ebm\)
29.
\(\ttd = \bbm 1\amp 1\amp 1\\ 2\amp 2\amp 2\\ -3\amp -3\amp -3\ebm\text{,}\) \(\tta = \bbm 2\amp 0\amp 0\\ 0\amp -3\amp 0\\ 0\amp 0\amp 5\ebm\)
30.
\(\ttd = \bbm 3\amp 0\\ 0\amp -1\ebm\text{,}\) \(\tta = \bbm 2\amp 4\\ 6\amp 8\ebm\)
31.
\(\ttd = \bbm 4\amp 0\\ 0\amp -3\ebm\text{,}\) \(\tta = \bbm 1\amp 2\\ 1\amp 2\ebm\)
32.
\(\ttd = \bbm d_1\amp 0\\ 0\amp d_2\ebm\text{,}\) \(\tta = \bbm a\amp b\\ c\amp d\ebm\)
33.
\(\ttd = \bbm d_1\amp 0\amp 0\\ 0\amp d_2\amp 0\\ 0\amp 0\amp d_3\ebm\text{,}\) \(\tta = \bbm a\amp b\amp c\\ d\amp e\amp f\\ g\amp h\amp i\ebm \)

Exercise Group.

A matrix \(\tta\) and a vector \(\vx\) are given. Find the product \(\tta\vx\text{.}\)
34.
\(\tta = \bbm 2\amp 3\\ 1\amp -1\ebm\text{,}\) \(\vx = \bbm 4\\ 9\ebm\)
35.
\(\tta = \bbm -1\amp 4\\ 7\amp 3\ebm\text{,}\) \(\vx = \bbm 2\\ -1\ebm\)
36.
\(\tta = \bbm 2\amp 0\amp 3\\ 1\amp 1\amp 1\\ 3\amp -1\amp 2\ebm\text{,}\) \(\vx = \bbm 1\\ 4\\ 2\ebm\)
37.
\(\tta = \bbm -2\amp 0\amp 3\\ 1\amp 1\amp -2\\ 4\amp 2\amp -1\ebm\text{,}\) \(\vx = \bbm 4\\ 3\\ 1\ebm \)
38.
\(\tta = \bbm 1\amp 2\amp 3\\ 1\amp 0\amp 2\\ 2\amp 3\amp 1\ebm\text{,}\) \(\vx = \bbm x_1\\ x_2\\ x_3\ebm\)
39.
\(\tta = \bbm 2\amp -1\\ 4\amp 3\ebm\text{,}\) \(\vx = \bbm x_1\\ x_2\ebm\)

40.

Let \(\tta = \bbm 0 \amp 1\\1 \amp 0\ebm\text{.}\) Find \(\tta^2\) and \(\tta^3\text{.}\)

41.

Let \(\tta = \bbm 2 \amp 0\\0 \amp 3\ebm\text{.}\) Find \(\tta^2\) and \(\tta^3\text{.}\)

42.

Let \(\tta = \bbm -1 \amp 0 \amp 0\\0\amp 3\amp 0\\0\amp 0\amp 5\ebm\text{.}\) Find \(\tta^2\) and \(\tta^3\text{.}\)

43.

Let \(\tta = \bbm 0 \amp 1 \amp 0\\0\amp 0\amp 1\\1\amp 0\amp 0\ebm\text{.}\) Find \(\tta^2\) and \(\tta^3\text{.}\)

44.

Let \(\tta = \bbm 0 \amp 0 \amp 1\\0\amp 0\amp 0\\0\amp 1\amp 0\ebm\text{.}\) Find \(\tta^2\) and \(\tta^3\text{.}\)

45.

In the text we state that \((\tta+\ttb)^2 \neq \tta^2+2\tta\ttb+\ttb^2\text{.}\) We investigate that claim here.
  1. Let \(\tta = \bbm 5\amp 3\\ -3\amp -2\ebm\) and let \(\ttb = \bbm -5 \amp -5\ -2 \amp 1\ebm\text{.}\) Compute \(\tta+\ttb\text{.}\)
  2. Find \((\tta+\ttb)^2\) by using your answer from (a).
  3. Compute \(\tta^2+2\tta\ttb+\ttb^2\text{.}\)
  4. Are the results from (a) and (b) the same?
  5. Carefully expand the expression
    \begin{equation*} (\tta+\ttb)^2 = (\tta+\ttb)(\tta+\ttb) \end{equation*}
    and show why this is not equal to \(\tta^2+2\tta\ttb+\ttb^2\text{.}\)