<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# Matrix Multiplication

## Multiply rows by columns in different matrices

Estimated13 minsto complete
%
Progress
Practice Matrix Multiplication

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated13 minsto complete
%
Multiplying Two Matrices

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

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

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?

### Multiplying Two Matrices

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{align*}\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}\end{align*}

Let's multiply the following matrices.

1.
\begin{align*}\begin{bmatrix} 2 & 3\\ -1 & 5 \end{bmatrix}\cdot\begin{bmatrix} -6 & 0\\ 4 & 1 \end{bmatrix}\end{align*}

By following the rule given above, we get:

\begin{align*}\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}\end{align*}

1.
\begin{align*}\begin{bmatrix} -1 & 3\\ 7 & 0\\ 4 & -2 \end{bmatrix}\cdot\begin{bmatrix} 5 & 8\\ -1 & 2 \end{bmatrix}\end{align*}

In order to multiply these two matrices we need to extend the pattern given in the guidance to apply to a \begin{align*}3\times2\end{align*} matrix and a \begin{align*}2\times2\end{align*} 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 introduced later. All matrix multiplication problems in this section 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{align*}\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}\end{align*}

1.
\begin{align*}\begin{bmatrix} 3 & -7 & 1\\ 2 & 8 & -5 \end{bmatrix}\cdot\begin{bmatrix} 2\\ 0\\ 9 \end{bmatrix}\end{align*}

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 problem. Multiply the matrices row by column to get:

\begin{align*}\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}\end{align*}

### Examples

#### Example 1

Earlier, you were asked to find the student that had the correct matrix.

When the two matrices are multiplied, the resulting matrix is:

\begin{align*}\begin{bmatrix} -7\\ 8 \end{bmatrix}\end{align*}

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.

#### Example 2

Multiply the following matrices.

\begin{align*}\begin{bmatrix} -4 & 1\\ 5 & -3 \end{bmatrix}\cdot\begin{bmatrix} 2\\ -1 \end{bmatrix}\end{align*}

\begin{align*}\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}\end{align*}

#### Example 3

Multiply the following matrices.
\begin{align*}\begin{bmatrix} -3\\ 2\\ 5 \end{bmatrix}\cdot\begin{bmatrix} -2 & -1 & 4 \end{bmatrix}\end{align*}

\begin{align*}\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}\end{align*}

#### Example 4

Multiply the following matrices.
\begin{align*}\begin{bmatrix} 5 & -2 \end{bmatrix} \cdot \begin{bmatrix} 1 & 4\\ -3 & -7 \end{bmatrix}\end{align*}

\begin{align*}\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}\end{align*}

### Review

Multiply the matrices together.

1. .
\begin{align*}\begin{bmatrix} 2 & -1\\ 0 & 3 \end{bmatrix}\cdot\begin{bmatrix} -4 & 3\\ 2 & 5 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -2 & 7 \end{bmatrix}\cdot\begin{bmatrix} 1 & -4\\ 5 & 3 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -3 & 2\\ 5 & -4\\ -1 & 6 \end{bmatrix}\cdot\begin{bmatrix} -1 & 3\\ 4 & -2 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -8 & 1\\ 3 & 5 \end{bmatrix}\cdot\begin{bmatrix} -4\\ 7 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -1\\ 4\\ 8 \end{bmatrix}\cdot\begin{bmatrix} 2 & -3 & 6 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -5 & 1 \end{bmatrix}\cdot\begin{bmatrix} -9 & 3 & 0\\ 2 & -1 & 6 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 4 & -1\\ 5 & 3 \end{bmatrix}\cdot\begin{bmatrix} 2\\ 6 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -2 & 4 & 7 \end{bmatrix}\cdot\begin{bmatrix} 3\\ -1\\ 5 \end{bmatrix}\end{align*}
1. .
\begin{align*}\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}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 1 & -2 & 4 \end{bmatrix}\cdot\begin{bmatrix} -3 & 1 & 2\\ 5 & -1 & 6\\ 1 & 2 & -7 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 6 & 11\\ 1 & 2 \end{bmatrix}\cdot\begin{bmatrix} 2 & -11\\ -1 & 6 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -4 & 5 & 7\\ 1 & 2 & -3\\ 9 & -6 & 8 \end{bmatrix}\cdot\begin{bmatrix} 1\\ 2\\ -1 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -2 & -1 & 3\end{bmatrix}\cdot\begin{bmatrix} -4\\ 5\\ -8 \end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} -10 \end{bmatrix}\cdot\begin{bmatrix} 15\end{bmatrix}\end{align*}
1. .

\begin{align*}\begin{bmatrix} 2 & 4 \\ -1 & -2 \\ 7 & -12 \end{bmatrix}\cdot\begin{bmatrix} 5\\ -3\end{bmatrix}\end{align*}

To see the Review answers, open this PDF file and look for section 4.4.

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes