Skip to main content

Section 2.2 Matrix Multiplication

Last section, we learned how to add and subtract matrices of the same size and how to multiply a matrix of any size by a number. In this section, we learn how to multiply two matrices together when their sizes allow for multiplication.

Subsection Prepare

Matrices of the same size are added by adding corresponding entries together, but we do not multiply matrices by multiplying corresponding entries together. This is confusing at first, but there are very good reasons for defining matrix multiplication differently. Unfortunately, most of those reasons do not become understandable until much, much later.
To start, two matrices can be multiplied together only if the number of columns in the first matrix equals the number of rows in the second matrix. This means that a \(2\times 3\) matrix can be multiplied by a \(3\times 1\) matrix, or a \(3\times 2\) matrix, or a \(3\times 3\) or \(3\times 4\) etc. matrix, but a \(2\times 3\) matrix cannot be multiplied by another \(2\times 3\) matrix.
That’s already pretty surprising, so let’s check our understanding.

Activity 2.2.1.

Define matrices \(A\text{,}\) \(B\text{,}\) and \(C\) by
\begin{align*} A\amp = \begin{bmatrix} 1 \amp 2 \amp 3 \\ -1 \amp 0 \amp 4 \end{bmatrix} \amp B\amp = \begin{bmatrix} -3 \amp 2 \amp -3 \\ 2 \amp 2 \amp 0 \end{bmatrix} \amp C\amp = \begin{bmatrix} 1 \amp 2 \\ 3 \amp 4 \end{bmatrix} \end{align*}
(a)
Can matrix \(A\) be multiplied by matrix \(B\text{?}\) In other words, is \(AB\) defined?
  • No, because the first matrix, \(A\text{,}\) has \(3\) columns, but the second matrix, \(B\text{,}\) does not have \(3\) rows.
  • Correct! The first matrix, \(A\text{,}\) has \(3\) columns, but the second matrix, \(B\text{,}\) has \(2\) rows.
(b)
Can matrix \(C\) be multiplied by matrix \(A\text{?}\) In other words, is \(CA\) defined?
  • Correct! The first matrix, \(C\text{,}\) has \(2\) columns, and the second matrix, \(A\text{,}\) has \(2\) rows.
  • The first matrix, \(A\text{,}\) has \(2\) columns, and the second matrix, \(C\text{,}\) has \(2\) rows. These are equal.
(c)
Can matrix \(A\) be multiplied by matrix \(C\text{?}\) In other words, is \(AC\) defined?
  • No, because the first matrix, \(A\text{,}\) has \(3\) columns, but the second matrix, \(C\text{,}\) does not have \(3\) rows.
  • Correct! The first matrix, \(A\text{,}\) has \(3\) columns, but the second matrix, \(C\text{,}\) has \(2\) rows.
(d)
Consider the two statements below.
  1. \(A^2\) is defined.
  2. \(C^2\) is defined.
Which of the following choices is correct?
  • Both statements are true.
  • \(A^2\) is the same as \(A\cdot A\text{.}\) The first matrix, \(A\text{,}\) has \(3\) columns, but the second matrix, \(A\text{,}\) does not have \(3\) rows.
  • 1. is true but 2. is false
  • \(A^2\) is the same as \(A\cdot A\text{.}\) The first matrix, \(A\text{,}\) has \(3\) columns, but the second matrix, \(A\text{,}\) does not have \(3\) rows.
  • 1. is false and 2. is true
  • Correct! Any square matrix can be multiplied by itself, since the number of columns equals the number of rows.
  • Both statements are false.
  • Any square matrix can be multiplied by itself, since the number of columns equals the number of rows.
To begin to understand why the number of columns of the first matrix must equal the number of rows of the second matrix, we demonstrate how to multiply a \(3\times 2\) matrix by a \(2\times 1\) matrix.

Example 2.2.2. Multiplying on the right by a column matrix.

Suppose we have the matrices \(A\) and \(B\) below:
\begin{equation*} A = \left[\begin{array}{rr} -2 \amp 3 \\ 0 \amp 2 \\ 3 \amp 1 \\ \end{array}\right],~~~ B = \left[\begin{array}{r} 2 \\ 3 \\ \end{array}\right]\text{.} \end{equation*}
Their product is defined by multiplying the first column of \(A\) by the first number in \(B\text{,}\) and multiplying the second column of \(A\) by the second number in \(B\text{,}\) and adding the results.
\begin{equation*} \begin{aligned} AB = \left[\begin{array}{rr} -2 \amp 3 \\ 0 \amp 2 \\ 3 \amp 1 \\ \end{array}\right] \left[\begin{array}{r} 2 \\ 3 \\ \end{array}\right] {}={} \amp \left[\begin{array}{r} -2 \\ 0 \\ 3 \\ \end{array}\right]2 + \left[\begin{array}{r} 3 \\ 2 \\ 1 \\ \end{array}\right]3 \\ \\ {}={} \amp \left[\begin{array}{r} -2\cdot 2 \\ 0\cdot 2 \\ 3\cdot 2 \\ \end{array}\right] + \left[\begin{array}{r} 3\cdot 3 \\ 2\cdot 3 \\ 1\cdot 3 \\ \end{array}\right] \\ \\ {}={} \amp \left[\begin{array}{r} 5 \\ 6 \\ 9 \\ \end{array}\right]. \\ \end{aligned} \end{equation*}
If we look at the first entry, we see it came from
\begin{equation*} -2\cdot 2 + 3 \cdot 3\text{,} \end{equation*}
and we note that the first row of \(A\) is \(\begin{bmatrix} -2 \amp 3 \end{bmatrix}\text{.}\) Looking at the second entry of \(AB\) we have
\begin{equation*} 0\cdot 2 + 2 \cdot 3\text{,} \end{equation*}
and the second row of \(A\) is \(\begin{bmatrix} 0 \amp 2 \end{bmatrix}\text{.}\) The third entry of \(AB\) is
\begin{equation*} 3\cdot 2 + 1 \cdot 3\text{,} \end{equation*}
and the third row of \(A\) is \(\begin{bmatrix} 3 \amp 1 \end{bmatrix}\text{.}\)
This means that we can view matrix multiplication entry-wise as multiplying the numbers in a row of the first matrix by the numbers in a column of the second matrix and adding them up.
Note that in ExampleΒ 2.2.2 the matrix \(A\) has two columns and so we needed \(B\) to contain two numbers in its column, which means \(B\) has two rows. On the other hand, since \(A\) has three rows, the result of multiplying a column of \(A\) by a number still has three rows, and adding matrices keeps the size the same, which is why the product \(AB\) has three rows.
This generalizes to when the second matrix of the product has more columns than \(1\text{.}\) The product \(AB\) is defined when \(A\) is an \(m\times n\) matrix and \(B\) is an \(n\times r\) matrix, and the matrix \(AB\) will have size \(m\times r\text{.}\)
\begin{equation*} (\underbrace{m\times \overbrace{n) \times (n}^{\mathclap{\text{these inner dimensions must match}}} \times r}_{\mathclap{\text{final dimensions are the outer dimensions}}}) \end{equation*}
Let’s see this in action in an example.

Example 2.2.3. Matrix Multiplication, More than One Column.

Let’s calculate
\begin{equation*} \left[\begin{array}{cc} 1\amp 2\\3\amp 4 \end{array} \right]\left[\begin{array}{ccc} 3\amp -1\amp 0\\1\amp 2\amp -1 \end{array} \right]\text{.} \end{equation*}
Since the first matrix has \(2\) columns and the second matrix has \(2\) rows, this multiplication can be performed. The product will be a \(2\times 3\) matrix because the first matrix has \(2\) rows and the second matrix has \(3\) columns.
We form a \(2\times 3\) matrix
\begin{equation*} \left[\begin{array}{ccc} m_{11} \amp m_{12} \amp m_{13}\\m_{21} \amp m_{22} \amp m_{23} \end{array} \right]\text{,} \end{equation*}
and we will now calculate the value of each of the entries.
The entry \(m_{11}\) is in the first row and first column, so we use the first row of the first matrix and the first column of the second matrix, multiply corresponding number entries and add them up. Thus
\begin{equation*} m_{11} = \left[\begin{array}{cc} 1\amp 2 \end{array} \right]\left[\begin{array}{c} 3\\1 \end{array} \right] = 1\cdot 3+2 \cdot 1 = 5\text{.} \end{equation*}
We now know that the product looks like
\begin{equation*} \left[\begin{array}{ccc} 5 \amp m_{12} \amp m_{13}\\m_{21} \amp m_{22} \amp m_{23} \end{array} \right]\text{.} \end{equation*}
Moving to the next entry to the right \(m_{12}\text{,}\) we still use the first row of the first matrix, now with the second column of the second matrix, giving us
\begin{equation*} m_{12} = \left[\begin{array}{cc} 1\amp 2 \end{array} \right]\left[\begin{array}{c} -1\\2 \end{array} \right] = 1\cdot(-1)+2\cdot 2 = 3\text{.} \end{equation*}
Finishing the first row with \(m_{13}\text{,}\) we use the first row of the first matrix and the third column of the second matrix and obtain
\begin{equation*} m_{13} = \left[\begin{array}{cc} 1\amp 2 \end{array} \right]\left[\begin{array}{c} 0\\-1 \end{array} \right] = 1\cdot 0+2\cdot (-1) = -2\text{.} \end{equation*}
So far we have
\begin{equation*} \left[\begin{array}{ccc} 5 \amp 3 \amp -2\\m_{21} \amp m_{22} \amp m_{23} \end{array} \right]\text{.} \end{equation*}
To compute the second row, we use the second row of the first matrix with the first, then second, and finally third columns of the second matrix. We calculate
\begin{align*} m_{21}\amp = \left[\begin{array}{cc} 3\amp 4 \end{array} \right]\left[\begin{array}{c} 3\\1 \end{array} \right] = 13 \\ m_{22} \amp = \left[\begin{array}{cc} 3\amp 4 \end{array} \right]\left[\begin{array}{c} -1\\2 \end{array} \right] = 5 \\ m_{23}\amp = \left[\begin{array}{cc} 3\amp 4 \end{array} \right]\left[\begin{array}{c} 0\\-1 \end{array} \right] = -4 \text{.} \end{align*}
Putting it all together, we have
\begin{equation*} \left[\begin{array}{cc} 1\amp 2\\3\amp 4 \end{array} \right]\left[\begin{array}{ccc} 1\amp -1\amp 0\\2\amp 2\amp -1 \end{array} \right] = \left[\begin{array}{ccc} 5 \amp 3 \amp -2\\13 \amp 5 \amp -4 \end{array} \right]\text{.} \end{equation*}
Let’s check to see that we understand how to compute the entries of a product of two matrices.

Activity 2.2.4. Entries in Matrix Multiplication.

Example 2.2.5. Another Matrix Multiplication.

Calculate
\begin{equation*} \left[\begin{array}{cc} -1\amp 0 \amp 3\\2 \amp 1 \amp -2 \end{array} \right]\left[\begin{array}{cc} 1\amp -1\\2 \amp 1 \\ 0 \amp 3 \end{array} \right]\text{.} \end{equation*}
Solution.
Since the first matrix has \(3\) columns and the second matrix has \(3\) rows, this multiplication can be performed. The product will be a \(2\times 2\) matrix because the first matrix has \(2\) rows and the second matrix has \(2\) columns.
We form a \(2\times 2\) matrix
\begin{equation*} \left[\begin{array}{cc} m_{11} \amp m_{12} \\m_{21} \amp m_{22} \end{array} \right]\text{,} \end{equation*}
and we will now calculate the value of each of the entries.
The entry \(m_{11}\) is in the first row and first column, so we use the first row of the first matrix and the first column of the second matrix, multiply corresponding number entries and add them up. Thus
\begin{equation*} m_{11} = \left[\begin{array}{ccc} -1\amp 0 \amp 3 \end{array} \right]\left[\begin{array}{c} 1\\2 \\ 0 \end{array} \right] = -1\cdot 1+0 \cdot 2 + 3\cdot 0 = -1\text{.} \end{equation*}
We now know that the product looks like
\begin{equation*} \left[\begin{array}{cc} -1 \amp m_{12} \\m_{21} \amp m_{22} \end{array} \right]\text{.} \end{equation*}
Moving to the next entry to the right \(m_{12}\text{,}\) we still use the first row of the first matrix, now with the second column of the second matrix, giving us
\begin{equation*} m_{12} = \left[\begin{array}{ccc} -1\amp 0 \amp 3 \end{array} \right]\left[\begin{array}{c} -1\\1 \\ 3 \end{array} \right] = -1\cdot(-1)+0\cdot 1 + 3\cdot 3 = 10\text{.} \end{equation*}
So far we have
\begin{equation*} \left[\begin{array}{cc} -1 \amp 10 \\m_{21} \amp m_{22} \end{array} \right]\text{.} \end{equation*}
To compute \(m_{21}\text{,}\) we use the second row of the first matrix with the first column of the second matrix, and calculate
\begin{equation*} m_{21} = \left[\begin{array}{ccc} 2\amp 1 \amp -2 \end{array} \right]\left[\begin{array}{c} 1\\2 \\ 0 \end{array} \right] = 2\cdot 1+1\cdot 2 + -2\cdot 0 = 4\text{.} \end{equation*}
To compute \(m_{22}\text{,}\) we use the second row of the first matrix with the second column of the second matrix, and calculate
\begin{equation*} m_{22} = \left[\begin{array}{ccc} 2\amp 1 \amp -2 \end{array} \right]\left[\begin{array}{c} -1\\1 \\ 3 \end{array} \right] = 2\cdot(-1)+1\cdot 1 + -2\cdot 3 = -7\text{.} \end{equation*}
Putting it all together, we have
\begin{equation*} \left[\begin{array}{cc} -1\amp 0 \amp 3\\2 \amp 1 \amp -2 \end{array} \right]\left[\begin{array}{cc} 1\amp -1\\2 \amp 1 \\ 0 \amp 3 \end{array} \right] = \left[\begin{array}{cc} -1 \amp 10 \\4\amp -7 \end{array} \right]\text{.} \end{equation*}
Matrix multiplication is a lot more complicated than addition or multiplication by a number, but it turns out to be very useful and connected to solving linear systems.

Reading Questions Reading Questions

1. Sizes of Matrix Products.
2. Addition versus Multiplication.
3. Reflection.
(a)
    How confident do you feel with the material you just read about?
  • 1.
    Not at all confident or didn’t do the reading.
  • 2.
    Not very confident.
  • 3.
    Somewhat confident.
  • 4.
    Mostly confident.
  • 5.
    Confident so far and ready to engage more deeply.
(b)
If you’re not fully confident, what additional information would you need to become more confident? What is confusing you?
If you are confident, ask a β€œwhat if?” or extension question.

Worksheet Participate

1. Is Matrix Multiplication Commutative in General?

Consider the matrices
\begin{align*} A\amp=\begin{bmatrix} 1 \amp 2 \amp 3 \end{bmatrix} \amp B\amp= \begin{bmatrix} 2 \\ -3 \\4 \end{bmatrix}\text{.} \end{align*}
(c)
We are used to multiplication of numbers being commutative, that is, that the order in which we multiply numbers together does not matter, \(xy=yx\) for all numbers \(x\) and \(y\text{.}\) What do your answers above mean for the commutativity of matrix multiplication in general?

2. Diagonal Matrices and the Identity Matrix.

Consider the matrices
\begin{align*} A\amp=\begin{bmatrix} 2 \amp 0 \amp 0 \\ 0 \amp -1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \amp B\amp= \begin{bmatrix} 1 \amp 3 \amp 0 \\ 2 \amp 2 \amp -1 \\ 3 \amp 1 \amp -2 \\ \end{bmatrix}\text{.} \end{align*}
(b)
Examine the rows of \(AB\) and the rows of \(B\text{.}\) What do you notice about the diagonal entries of \(A\) and the effect of multiplying \(B\) by \(A\) on the left?
(c)
Examine the columns of \(BA\) and the columns of \(B\text{.}\) What do you notice about the diagonal entries of \(A\) and the effect of multiplying \(B\) by \(A\) on the right?
(d)
The number \(1\) is called the multiplicative identity because multiplying any number \(x\) by \(1\) equals the same number you started with, \(1\cdot x = x\cdot 1 = x\text{.}\) Given an \(n\times n\) matrix \(X\text{,}\) what is the identity matrix, that is, the matrix \(I\) such that multiplying on both the left and the right leaves \(X\) unchanged, \(I\cdot X=X\cdot I = X\text{?}\)

3. Properties of Zero and Cancellation.

Define
\begin{align*} A\amp=\begin{bmatrix} 1 \amp 2 \\ -2 \amp -4 \\ \end{bmatrix} \amp B\amp= \begin{bmatrix} 2 \amp -4 \\-1 \amp 2 \\ \end{bmatrix} \amp C\amp=\begin{bmatrix} 3 \amp 0 \\ 1 \amp 3 \end{bmatrix} \amp D\amp= \begin{bmatrix} 1 \amp 2 \\ 2 \amp 2 \end{bmatrix} \end{align*}
(a)
With numbers, we know that if \(ab=0\text{,}\) then either \(a = 0\) or \(b=0\text{.}\)
Compute \(AB\text{.}\) With matrices, if \(AB = 0\text{,}\) is it necessarily true that either \(A=0\) or \(B=0\text{?}\)
(b)
When we are dealing with numbers, we know that if \(a\neq 0\) and \(ac = ad\text{,}\) then \(c=d\text{.}\)
Compute both \(AC\) and \(AD\text{.}\) With matrices, if \(A\neq \mathbf{0}\) and \(AC = AD\text{,}\) is it necessarily true that \(C=D\text{?}\)

4. Is Matrix Multiplication Associative? Distributive?

Consider the matrices
\begin{align*} A\amp=\begin{bmatrix} 1 \amp 2 \\ 3 \amp -2 \\ \end{bmatrix} \amp B\amp= \begin{bmatrix} 0 \amp 4 \\ 2 \amp -1 \\ \end{bmatrix} \amp C\amp= \begin{bmatrix} -1 \amp 3 \\ 4 \amp 3 \end{bmatrix}\text{.} \end{align*}
Here is a sage cell to perform (or check) the required computations.
(a)
Compute \(AB\) and then \((AB)C\text{,}\) and record your answers.
(c)
What does this suggest about the associativity of matrix multiplication?
(d)
Compute \(B+C\) and then \(A(B+C)\) and record your answers.
(f)
What does this suggest about the distributive property of matrix multiplication?

Summary.

  • Matrix multiplication can be performed only when the number of columns in the first matrix equals the number of rows in the second matrix.
  • If matrix multiplication can be performed, the entries come from multiplying rows of the first matrix by columns of the second matrix. We multiply the corresponding numbers and add them up to get one entry of the product.
  • Some properties of multiplication of numbers also hold for multiplication of matrices, and some don’t. Perhaps the most surprising or important of these properties is that matrix multiplication is not commutative in general.

Subsection Practice

Exercise 2.2.1. Properties of Matrix Multiplication.

Enter T or F depending on whether the statement is true or false. (You must enter T or F -- True and False will not work.)
  1. If A is a square matrix such that \(A^2\) equals the 0 matrix, then A must equal the 0 matrix.
  2. If A has size \(m \times n\) and B has size \(n \times r\text{,}\) then AB has size \(m \times r\text{.}\)
  3. If A has size \(5 \times 4\) and B has size \(4 \times 3\text{,}\) then the 3rd row, 2nd column entry of AB is obtained by multiplying the 3rd column of A by the 2nd row of B.

Exercise 2.2.2. Matrix Multiplication Commutativity.

Give an example of two \(2 \times 2\) matrices \(A\) and \(B\) such that \(AB \ne BA\text{.}\)
\(A =\) (2Β Γ—Β 2 array)
\(B =\) (2Β Γ—Β 2 array)

Exercise 2.2.3. More Commutativity.

Give an example of two \(2 \times 2\) matrices \(A\) and \(B\text{,}\) neither of which is the zero matrix or the identity matrix, such that \(AB = BA\text{.}\)
\(A =\) (2Β Γ—Β 2 array)
\(B =\) (2Β Γ—Β 2 array)

Exercise 2.2.4. Multiplying Matrices.

Many programming languages, including Python and Sage, use a list of lists to enter matrices. We use that notation in this problem instead of the usual array answer box notation to avoid giving away information about the size of the matrix or whether such a matrix exists at all.
Let
\begin{equation*} A = \left[\begin{array}{cc} 4 \amp 5\cr -2 \amp -1 \end{array}\right], \end{equation*}
\begin{equation*} B = \left[\begin{array}{cc} -2 \amp 2\cr -5 \amp 2\cr -1 \amp 3 \end{array}\right], \end{equation*}
\begin{equation*} C = \left[\begin{array}{ccc} -3 \amp -1 \amp -1\cr -4 \amp 3 \amp 1 \end{array}\right]. \end{equation*}
If possible, compute the following. If an answer does not exist, enter DNE.
\(ACB =\)
\(ABC =\)

Exercise 2.2.5. More Multiplying Matrices.

Determine the value(s) of \(x\) such that
\(\left[\begin{array}{ccc} x \amp 2 \amp 1\cr \end{array}\right] \left[\begin{array}{ccc} 1 \amp -4 \amp -1\cr -4 \amp -2 \amp 0\cr -1 \amp -10 \amp 2 \end{array}\right] \left[\begin{array}{c} x\cr -1\cr 5\cr \end{array}\right] = [0]\)
\(x\) =
Note: If there is more than one value separate them by commas.

Exercises Additional Practice

1.

We explore whether or not \(( A+ B)^2 = A^2+2 A B+ B^2\text{.}\)
(a)
Let \(A = \left[\begin{array}{cc} 5\amp 3\\ -3\amp -2 \end{array} \right]\) and let \(B = \left[\begin{array}{cc} -5\amp -5\\ -2\amp 1 \end{array} \right]\text{.}\) Compute \(A+ B\text{.}\)
Answer.
\(\left[\begin{array}{cc} 0\amp -2\\-5\amp -1 \end{array} \right]\)
(b)
Find \(( A+ B)^2\) by using your answer from the first part.
Answer.
\(\left[\begin{array}{cc} 10\amp 2\\ 5\amp 11 \end{array} \right]\)
(e)
Carefully expand the expression \(( A+ B)^2 = ( A+ B)( A+ B)\) and show why this is not equal to \(A^2+2 A B+ B^2\text{.}\)
Answer.
\(( A+ B)( A + B) = A A + A B + B A + B B = A^2+ A B+ B A+ B^2\text{.}\)

Exercise Group.

In the following exercises, matrices \(A\) and \(B\) are defined. Give the dimensions of \(A\) and \(B\text{.}\) If the dimensions properly match, give the dimensions of \(A B\) and \(B A\text{.}\) Find the products \(A B\) and \(B A\text{,}\) if possible.
2.
\(A = \left[\begin{array}{cc} 1\amp 2\\-1\amp 4 \end{array} \right] \quad B = \left[\begin{array}{cc} 2\amp 5\\3\amp -1 \end{array} \right]\)
Answer.
\(A B=\left[\begin{array}{cc} 8\amp 3\\10\amp -9 \end{array} \right]\)
\(B A=\left[\begin{array}{cc} -3\amp 24\\4\amp 2 \end{array} \right]\)
3.
\(A = \left[\begin{array}{cc} 3\amp 7\\2\amp 5 \end{array} \right] \quad B = \left[\begin{array}{cc} 1\amp -1\\3\amp -3 \end{array} \right]\)
Answer.
\(A B=\left[\begin{array}{cc} 24\amp -24\\17\amp -17 \end{array} \right]\)
\(B A=\left[\begin{array}{cc} 1\amp 2\\3\amp 6 \end{array} \right]\)
4.
\(A = \left[\begin{array}{cc} 3\amp -1\\2\amp 2 \end{array} \right] \quad B = \left[\begin{array}{ccc} 1\amp 0\amp 7\\4\amp 2\amp 9 \end{array} \right]\)
Answer.
\(A B=\left[\begin{array}{ccc} -1\amp -2\amp 12\\10\amp 4\amp 32 \end{array} \right]\)
\(B A\) is not possible.
5.
\(A = \left[\begin{array}{cc} 0\amp 1\\1\amp -1\\-2\amp -4 \end{array} \right] \quad B = \left[\begin{array}{cc} -2\amp 0\\3\amp 8 \end{array} \right]\)
Answer.
\(A B=\left[\begin{array}{cc} 3\amp 8\\-5\amp -8\\-8\amp -32 \end{array} \right]\)
\(B A\) is not possible.
6.
\(A = \left[\begin{array}{ccc} 9\amp 4\amp 3\\9\amp -5\amp 9 \end{array} \right] \quad B = \left[\begin{array}{cc} -2\amp 5\\-2\amp -1 \end{array} \right]\)
Answer.
\(A B\) is not possible.
\(B A = \left[\begin{array}{ccc} 27\amp -33\amp 39\\-27\amp -3\amp -15 \end{array} \right]\)
7.
\(A = \left[\begin{array}{cc} -2\amp -1\\9\amp -5\\3\amp -1 \end{array} \right] \quad B = \left[\begin{array}{ccc} -5\amp 6\amp -4\\0\amp 6\amp -3 \end{array} \right]\)
Answer.
\(A B =\left[\begin{array}{ccc} 10\amp -18\amp 11\\-45\amp 24\amp -21\\-15\amp 12\amp -9 \end{array} \right]\)
\(B A = \left[\begin{array}{cc} 52 \amp -21\\45\amp -27 \end{array} \right]\)
8.
\(A = \left[\begin{array}{cc} 2\amp 6\\6\amp 2\\5\amp -1 \end{array} \right] \quad B = \left[\begin{array}{ccc} -4\amp 5\amp 0\\-4\amp 4\amp -4 \end{array} \right]\)
Answer.
\(A B =\left[\begin{array}{ccc} -32\amp 34\amp -24\\-32\amp 38\amp -8\\-16\amp 21\amp 4 \end{array} \right]\)
\(B A = \left[\begin{array}{cc} 22\amp -14\\-4\amp -12 \end{array} \right]\)
9.
\(A = \left[\begin{array}{cc} -5\amp 2\\ -5\amp -2 \\ -5\amp -4 \end{array} \right] \quad B = \left[\begin{array}{ccc} 0\amp -5\amp 6\\ -5\amp -3\amp -1 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{ccc} -10\amp 19\amp -32\\ 10\amp 31\amp -28 \\ 20\amp 37\amp -26 \end{array} \right]\)
\(B A = \left[\begin{array}{cc} -5\amp -14\\ 45\amp 0 \end{array} \right]\)
10.
\(A = \left[\begin{array}{cc} 8\amp -2\\ 4\amp 5 \\ 2\amp -5 \end{array} \right] \quad B = \left[\begin{array}{ccc} -5\amp 1\amp -5\\ 8\amp 3\amp -2 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{ccc} -56\amp 2\amp -36\\ 20\amp 19\amp -30 \\ -50\amp -13\amp 0 \end{array} \right]\)
\(B A = \left[\begin{array}{cc} -46\amp 40\\ 72\amp 9 \end{array} \right]\)
11.
\(A = \left[\begin{array}{cc} 1\amp 4\\ 7\amp 6 \end{array} \right] \quad B = \left[\begin{array}{cccc} 1\amp -1\amp -5\amp 5\\ -2\amp 1\amp 3\amp -5 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{cccc} -7\amp 3\amp 7\amp -15\\ -5\amp -1\amp -17\amp 5 \end{array} \right]\)
\(B A\) is not possible.
12.
\(A = \left[\begin{array}{cc} -1\amp 5\\ 6\amp 7 \end{array} \right] \quad B = \left[\begin{array}{cccc} 5\amp -3\amp -4\amp -4\\ -2\amp -5\amp -5\amp -1 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{cccc} -15\amp -22\amp -21\amp -1\\ 16\amp -53\amp -59\amp -31 \end{array} \right]\)
\(B A\) is not possible.
13.
\(A = \left[\begin{array}{ccc} -1\amp 2\amp 1\\ -1\amp 2\amp -1 \\ 0\amp 0\amp -2 \end{array} \right] \quad B = \left[\begin{array}{ccc} 0\amp 0\amp -2\\ 1\amp 2\amp -1 \\ 1\amp 0\amp 0 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{ccc} 3\amp 4\amp 0\\ 1\amp 4\amp 0 \\ -2\amp 0\amp 0 \end{array} \right]\)
\(B A = \left[\begin{array}{ccc} 0\amp 0\amp 4\\ -3\amp 6\amp 1 \\ -1\amp 2\amp 1 \end{array} \right]\)
14.
\(A = \left[\begin{array}{ccc} -1\amp 1\amp 1\\ -1\amp -1\amp -2 \\ 1\amp 1\amp -2 \end{array} \right] \quad B = \left[\begin{array}{ccc} -2\amp -2\amp -2\\ 0\amp -2\amp 0 \\ -2\amp 0\amp 2 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{ccc} 0\amp 0\amp 4\\ 6\amp 4\amp -2 \\ 2\amp -4\amp -6 \end{array} \right]\)
\(B A = \left[\begin{array}{ccc} 2\amp -2\amp 6\\ 2\amp 2\amp 4 \\ 4\amp 0\amp -6 \end{array} \right]\)
15.
\(A = \left[\begin{array}{ccc} -4\amp 3\amp 3\\ -5\amp -1\amp -5 \\ -5\amp 0\amp -1 \end{array} \right] \quad B = \left[\begin{array}{ccc} 0\amp 5\amp 0\\ -5\amp -4\amp 3 \\ 5\amp -4\amp 3 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{ccc} 0\amp -44\amp 18\\ -20\amp -1\amp -18 \\ -5\amp -21\amp -3 \end{array} \right]\)
\(B A = \left[\begin{array}{ccc} -25\amp -5\amp -25\\ 25\amp -11\amp 2 \\ -15\amp 19\amp 32 \end{array} \right]\)
16.
\(A = \left[\begin{array}{ccc} -4\amp -1\amp 3\\ 2\amp -3\amp 5 \\ 1\amp 5\amp 3 \end{array} \right] \quad B = \left[\begin{array}{ccc} -2\amp 4\amp 3\\ -1\amp 1\amp -1 \\ 4\amp 0\amp 2 \end{array} \right]\)
Answer.
\(A B = \left[\begin{array}{ccc} 21\amp -17\amp -5\\ 19\amp 5\amp 19 \\ 5\amp 9\amp 4 \end{array} \right]\)
\(B A = \left[\begin{array}{ccc} 19\amp 5\amp 23\\ 5\amp -7\amp -1 \\ -14\amp 6\amp 18 \end{array} \right]\)

Exercise Group.

In the following exercises, a diagonal matrix \(D\) and a matrix \(A\) are given. Find the products \(DA\) and \(AD\text{,}\) where possible.
17.
\(D= \left[\begin{array}{cc} 3\amp 0\\ 0\amp -1 \end{array} \right]\)
\(A = \left[\begin{array}{cc} 2\amp 4\\ 6\amp 8 \end{array} \right]\)
Answer.
\(AD= \left[\begin{array}{cc} 6\amp -4\\ 18\amp -8 \end{array} \right]\)
\(DA = \left[\begin{array}{cc} 6\amp 12\\ -6\amp -8 \end{array} \right]\)
18.
\(D= \left[\begin{array}{cc} 4\amp 0\\ 0\amp -3 \end{array} \right]\)
\(A = \left[\begin{array}{cc} 1\amp 2\\ 1\amp 2 \end{array} \right]\)
Answer.
\(AD= \left[\begin{array}{cc} 4\amp -6\\ 4\amp -6 \end{array} \right]\)
\(DA = \left[\begin{array}{cc} 4\amp 8\\ -3\amp -6 \end{array} \right]\)
19.
\(D= \left[\begin{array}{ccc} -1\amp 0\amp 0\\ 0\amp 2\amp 0 \\ 0\amp 0\amp 3 \end{array} \right]\)
\(A = \left[\begin{array}{ccc} 1\amp 2\amp 3\\ 4\amp 5\amp 6 \\ 7\amp 8\amp 9 \end{array} \right]\)
Answer.
\(AD= \left[\begin{array}{ccc} -1\amp 4\amp 9\\ -4\amp 10\amp 18 \\ -7\amp 16\amp 27 \end{array} \right]\)
\(DA = \left[\begin{array}{ccc} -1\amp -2\amp -3\\ 8\amp 10\amp 12 \\ 21\amp 24\amp 27 \end{array} \right]\)
20.
\(A = \left[\begin{array}{ccc} 1\amp 1\amp 1\\ 2\amp 2\amp 2 \\ -3\amp -3\amp -3 \end{array} \right]\)
\(D = \left[\begin{array}{ccc} 2\amp 0\amp 0\\ 0\amp -3\amp 0 \\ 0\amp 0\amp 5 \end{array} \right]\)
Answer.
\(DA= \left[\begin{array}{ccc} 2\amp 2\amp 2\\ -6\amp -6\amp -6 \\ -15\amp -15\amp -15 \end{array} \right]\)
\(AD = \left[\begin{array}{ccc} 2\amp -3\amp 5\\ 4\amp -6\amp 10 \\ -6\amp 9\amp -15 \end{array} \right]\)
21.
\(D = \left[\begin{array}{cc} d_1\amp 0\\ 0\amp d_2 \end{array} \right]\)
\(A = \left[\begin{array}{cc} a\amp b\\ c\amp d \end{array} \right]\)
Answer.
\(DA= \left[\begin{array}{cc} d_1a\amp d_1b\\ d_2c\amp d_2d \end{array} \right]\)
\(AD = \left[\begin{array}{cc} d_1a\amp d_2b\\ d_1c\amp d_2d \end{array} \right]\)
22.
\(D = \left[\begin{array}{ccc} d_1\amp 0\amp 0\\ 0\amp d_2\amp 0 \\ 0\amp 0\amp d_3 \end{array} \right]\)
\(A = \left[\begin{array}{ccc} a\amp b\amp c\\ d\amp e\amp f \\ g\amp h\amp i \end{array} \right]\)
Answer.
\(DA= \left[\begin{array}{ccc} d_1a\amp d_1b\amp d_1c\\ d_2d\amp d_2e\amp d_2f \\ d_3g\amp d_3h\amp d_3i \end{array} \right]\)\ \(AD = \left[\begin{array}{ccc} d_1a\amp d_2b\amp d_3c\\ d_1d\amp d_2e\amp d_3f \\ d_1g\amp d_2h\amp d_3i \end{array} \right]\)

23.

Let \(A = \left[\begin{array}{cc} 0\amp 1\\1\amp 0 \end{array} \right]\text{.}\) Find \(A^2\) and \(A^3\text{.}\)
Answer.
\(A^2 = \left[\begin{array}{cc} 1\amp 0\\0\amp 1 \end{array} \right]\text{;}\) \(A^3 = \left[\begin{array}{cc} 0\amp 1\\1\amp 0 \end{array} \right]\)

24.

Let \(A = \left[\begin{array}{cc} 2\amp 0\\0\amp 3 \end{array} \right]\text{.}\) Find \(A^2\) and \(A^3\text{.}\)
Answer.
\(A^2 = \left[\begin{array}{cc} 4\amp 0\\0\amp 9 \end{array} \right]\text{;}\) \(A^3 = \left[\begin{array}{cc} 8\amp 0\\0\amp 27 \end{array} \right]\)

25.

Let \(A = \left[\begin{array}{ccc} -1\amp 0\amp 0\\0\amp 3\amp 0\\0\amp 0\amp 5 \end{array} \right]\text{.}\) Find \(A^2\) and \(A^3\text{.}\)
Answer.
\(A^2 = \left[\begin{array}{ccc} 1\amp 0\amp 0\\0\amp 9\amp 0\\0\amp 0\amp 25 \end{array} \right]\text{;}\) \(A^3 = \left[\begin{array}{ccc} -1\amp 0\amp 0\\0\amp 27\amp 0\\0\amp 0\amp 125 \end{array} \right]\)

26.

Let \(A = \left[\begin{array}{ccc} 0\amp 1\amp 0\\0\amp 0\amp 1\\1\amp 0\amp 0 \end{array} \right]\text{.}\) Find \(A^2\) and \(A^3\text{.}\)
Answer.
\(A^2 = \left[\begin{array}{ccc} 0\amp 0\amp 1\\1\amp 0\amp 0\\0\amp 1\amp 0 \end{array} \right]\text{;}\) \(A^3 = \left[\begin{array}{ccc} 1\amp 0\amp 0\\0\amp 1\amp 0\\0\amp 0\amp 1 \end{array} \right]\)

27.

Let \(A = \left[\begin{array}{ccc} 0\amp 0\amp 1\\0\amp 0\amp 0\\0\amp 1\amp 0 \end{array} \right]\text{.}\) Find \(A^2\) and \(A^3\text{.}\)
Answer.
\(A^2 = \left[\begin{array}{ccc} 0\amp 1\amp 0\\0\amp 0\amp 0\\0\amp 0\amp 0 \end{array} \right]\text{;}\) \(A^3 = \left[\begin{array}{ccc} 0\amp 0\amp 0\\0\amp 0\amp 0\\0\amp 0\amp 0 \end{array} \right]\)