<meta http-equiv="refresh" content="1; url=/nojavascript/">

# Matrix Multiplication

%
Progress
Progress
%
Multiplying Two Matrices

Mr. Hwan writes the following matrices on the board and asks his students to multiply them.

$\begin{bmatrix}-3 & 1\\2 & 0 \end{bmatrix}\cdot\begin{bmatrix}4\\-1 \end{bmatrix}$

When they are done multiplying, Mr. Hwan asks, "What element is in the first row, second column of your answer?"

Wanda says that because the two matrices do not have the same dimensions they can't be multiplied. Therefore, there is no answer.

Xavier says that the product is a 2 x 1 matrix so there is no element in the first row, second column.

Zach says that the element requested is 8.

Who is correct?

### Guidance

To multiply matrices together we will be multiplying each element in each row of the first matrix by each element in each column in the second matrix. Each of these products will be added together to get the result for a particular row and column as shown below.

$\begin{bmatrix}\color{red}{a} & \color{red}{b}\\c & d \end{bmatrix} \cdot \begin{bmatrix}\color{red}{e} & f\\\color{red}{g} & h \end{bmatrix} = \begin{bmatrix}\color{red}{ae}+\color{red}{bg} & af+bh\\ce+dg & cf+dh \end{bmatrix}$

#### Example A

Multiply the matrices: $\begin{bmatrix}2 & 3\\-1 & 5 \end{bmatrix}\cdot\begin{bmatrix}-6 & 0\\4 & 1 \end{bmatrix}$

Solution:

By following the rule given above, we get:

$\begin{bmatrix}2(-6)+3(4) & 2(0)+3(1)\\-1(-6)+5(4) & -1(0)+5(1) \end{bmatrix} = \begin{bmatrix}-12+12 & 0+3\\6+20 & 0+5 \end{bmatrix} = \begin{bmatrix}0 & 3\\26 & 5 \end{bmatrix}$

#### Example B

Multiply the matrices: $\begin{bmatrix}-1 & 3\\7 & 0\\4 & -2 \end{bmatrix}\cdot\begin{bmatrix}5 & 8\\-1 & 2 \end{bmatrix}$

Solution:

In order to multiply these two matrices we need to extend the pattern given in the guidance to apply to a $3\times2$ matrix and a $2\times2$ matrix. It is important to note that matrices do not need to have the same dimensions in order to multiply them together. However, there are limitations that will be explored in the next topic. All matrix multiplication problems in this topic are possible.

Now, let’s multiply each of the rows in the first matrix by each of the columns in the second matrix to get:

$\begin{bmatrix}-1 & 3\\7 & 0\\4 & -2 \end{bmatrix}\cdot\begin{bmatrix}5 & 8\\-1 & 2 \end{bmatrix} = \begin{bmatrix}-1(5)+3(-1) & -1(8)+3(2)\\7(5)+0(-1) & 7(8)+0(2)\\4(5)+-2(-1) & 4(8)+-2(2) \end{bmatrix} = \begin{bmatrix}-5-3 & -8+6\\35+0 & 56+0\\20+2 & 32-4 \end{bmatrix} = \begin{bmatrix}-8 & -2\\35 & 56\\22 & 28 \end{bmatrix}$

#### Example C

Multiply the matrices: $\begin{bmatrix}3 & -7 & 1\\2 & 8 & -5 \end{bmatrix}\cdot\begin{bmatrix}2\\0\\9 \end{bmatrix}$

Solution:

Sometimes, not only are the matrices different dimensions, but the result has dimensions other than either of the original matrices as is the case in this example. Multiply the matrices row by column to get:

$\begin{bmatrix}3 & -7 & 1\\2 & 8 & -5\end{bmatrix}\cdot\begin{bmatrix}2\\0\\9\end{bmatrix} = \begin{bmatrix}3(2)+-7(0)+1(9) & 2(2)+8(0)+-5(9)\end{bmatrix} = \begin{bmatrix}6+0+9 & 4+0-45\end{bmatrix} = \begin{bmatrix}15 & -41\end{bmatrix}$

Intro Problem Revisit When the two matrixes are multiplied, the resulting matrix is:

$\begin{bmatrix}-7\\8 \end{bmatrix}$

The matrices can be multiplied, but there is no first row, second column in the resulting matrix. The element 8 is in the second row, first column. Therefore Xavier is right.

### Guided Practice

Multiply the matrices together.

1. $\begin{bmatrix}-4 & 1\\5 & -3 \end{bmatrix}\cdot\begin{bmatrix}2\\-1 \end{bmatrix}$

2. $\begin{bmatrix}-3\\2\\5 \end{bmatrix}\cdot\begin{bmatrix}-2 & -1 & 4 \end{bmatrix}$

3. $\begin{bmatrix}5 & -2 \end{bmatrix} \cdot \begin{bmatrix}1 & 4\\-3 & -7 \end{bmatrix}$

1. $\begin{bmatrix}-4 & 1\\5 & -3 \end{bmatrix}\cdot\begin{bmatrix}2\\-1 \end{bmatrix} = \begin{bmatrix}-4(2)+1(-1)\\5(2)+-3(-1) \end{bmatrix} = \begin{bmatrix}-8-1\\10+3 \end{bmatrix} = \begin{bmatrix}-9\\13 \end{bmatrix}$

2. $\begin{bmatrix}-3\\2\\5 \end{bmatrix}\cdot\begin{bmatrix}-2 & -1 & 4 \end{bmatrix} = \begin{bmatrix}-3(-2) & -3(-1) & -3(4)\\2(-2) & 2(-1) & 2(4)\\5(-2) & 5(-1) & 5(4) \end{bmatrix} = \begin{bmatrix}6 & 3 & -12\\-4 & -2 & 8\\-10 & -5 & 20 \end{bmatrix}$

3. $\begin{bmatrix}5 & -2 \end{bmatrix}\cdot\begin{bmatrix}1 & 4\\-3 & -7 \end{bmatrix} = \begin{bmatrix}5(1)+-2(-3) & 5(4)+-2(-7) \end{bmatrix} = \begin{bmatrix}5+6 & 20+14 \end{bmatrix} = \begin{bmatrix}11 & 34 \end{bmatrix}$

### Explore More

Multiply the matrices together.

1. .
$\begin{bmatrix}2 & -1\\0 & 3 \end{bmatrix}\cdot\begin{bmatrix}-4 & 3\\2 & 5 \end{bmatrix}$
1. .
$\begin{bmatrix}-2 & 7 \end{bmatrix}\cdot\begin{bmatrix}1 & -4\\5 & 3 \end{bmatrix}$
1. .
$\begin{bmatrix}-3 & 2\\5 & -4\\-1 & 6 \end{bmatrix}\cdot\begin{bmatrix}-1 & 3\\4 & -2 \end{bmatrix}$
1. .
$\begin{bmatrix}-8 & 1\\3 & 5 \end{bmatrix}\cdot\begin{bmatrix}-4\\7 \end{bmatrix}$
1. .
$\begin{bmatrix}-1\\4\\8 \end{bmatrix}\cdot\begin{bmatrix}2 & -3 & 6 \end{bmatrix}$
1. .
$\begin{bmatrix}-5 & 1 \end{bmatrix}\cdot\begin{bmatrix}-9 & 3 & 0\\2 & -1 & 6 \end{bmatrix}$
1. .
$\begin{bmatrix}4 & -1\\5 & 3 \end{bmatrix}\cdot\begin{bmatrix}2\\6 \end{bmatrix}$
1. .
$\begin{bmatrix}-2 & 4 & 7 \end{bmatrix}\cdot\begin{bmatrix}3\\-1\\5 \end{bmatrix}$
1. .
$\begin{bmatrix}-1 & 2 & -4\\5 & 3 & 1\\-5 & 2 & -1 \end{bmatrix}\cdot\begin{bmatrix}2 & -3 & 5\\6 & 2 & 1\\-4 & 1 & 0 \end{bmatrix}$
1. .
$\begin{bmatrix}1 & -2 & 4 \end{bmatrix}\cdot\begin{bmatrix}-3 & 1 & 2\\5 & -1 & 6\\1 & 2 & -7 \end{bmatrix}$
1. .
$\begin{bmatrix}6 & 11\\1 & 2 \end{bmatrix}\cdot\begin{bmatrix}2 & -11\\-1 & 6 \end{bmatrix}$
1. .
$\begin{bmatrix}-4 & 5 & 7\\1 & 2 & -3\\9 & -6 & 8 \end{bmatrix}\cdot\begin{bmatrix}1\\2\\-1 \end{bmatrix}$
1. .
$\begin{bmatrix}-2 & -1 & 3\end{bmatrix}\cdot\begin{bmatrix}-4\\5\\-8 \end{bmatrix}$
1. .
$\begin{bmatrix}-10 \end{bmatrix}\cdot\begin{bmatrix}15\end{bmatrix}$
1. .
$\begin{bmatrix}2 & 4 \\-1 & -2 \\7 & -12 \end{bmatrix}\cdot\begin{bmatrix}5\\-3\end{bmatrix}$