How do you multiply a (3×3) matrix by a (3×2) matrix?

In order to multiply a (3×3) matrix by a (3×2) matrix, you must first ensure that the number of columns in the first matrix is equal to the number of rows in the second matrix. Then, the resulting matrix will have the same number of rows as the first matrix and the same number of columns as the second matrix. Each element in the resulting matrix is calculated by multiplying the corresponding row in the first matrix by the corresponding column in the second matrix and adding the products together. This process is repeated for each element in the resulting matrix until all elements have been calculated. The resulting matrix is the product of the two original matrices.

Matrix Multiplication: (3×3) by (3×2)


This tutorial shows how to multiply a 3×3 matrix with a 3×2 matrix.
 

Introduction

Suppose we have a 3×3 matrix A, which has 3 rows and 3 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.super_short2 {
max-width: 250px;
margin: 5px auto;
color: blue;
}

A =
  A11 A12 A13  
A21 A22 A23
A31 A32 A33

Suppose we also have a 3×2 matrix B, which has 3 rows and 2 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short2 {
max-width: 250px;
margin: 5px auto;
color: red;
}

B =
  B11 B12  
B21 B22
B31 B32

To multiply matrix A by matrix B, we use the following formula:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.long{
margin: 5px auto;
color: #000000;
}
.red {
color: red;
}
.blue {
color: blue;
}

A x B =
  A11*B11+A12*B21+A13*B31 A11*B12+A12*B22+A13*B32  
A21*B11+A22*B21+A23*B31 A21*B12+A22*B22+A23*B32
A31*B11+A32*B21+A33*B31 A31*B12+A32*B22+A33*B32

This results in a 3×2 matrix.

The following examples illustrate how to multiply a 3×3 matrix with a 3×2 matrix using real numbers.

Example 1

Suppose we have a 3×3 matrix C, which has 3 rows and 3 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.ex3_3 {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

C =
  -3 5 4  
1 2 3
-1 0 2

Suppose we also have a 3×2 matrix D, which has 3 rows and 2 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

D =
  2 1  
5 1
0 -1

Here is how to multiply matrix C by matrix D:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.medium {
max-width: 500px;
margin: 5px auto;
color: #000000;
}
.red {
color: red;
}
.blue {
color: blue;
}

C x D =
  -3*2 + 5*5 + 4*0 -3*1 + 5*1 + 4*-1  
1*2 + 2*5 + 3*0 1*1 + 2*1 + 3*-1
-1*2 + 0*5 + 2*0 -1*1 + 0*1 + 2*-1

This results in the following 3×2 matrix:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

C x D =
  19 -2  
12 0
-2 -3

Example 2

Suppose we have a 3×3 matrix E, which has 3 rows and 3 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.ex3_3 {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

E =
  2 8 1  
3 3 0
0 1 2

Suppose we also have a 3×2 matrix F, which has 3 rows and 2 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

F =
  -2 -2  
3 1
4 10

Here is how to multiply matrix E by matrix F:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.medium {
max-width: 500px;
margin: 5px auto;
color: #000000;
}
.red {
color: red;
}
.blue {
color: blue;
}

E x F =
  2*-2 + 8*3 + 1*4 2*-2 + 8*1 + 1*10  
3*-2 + 3*3 + 0*4 3*-2 + 3*1 + 0*10
0*-2 + 1*3 + 2*4 0*-2 + 1*1 + 2*10

This results in the following 3×2 matrix:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

E x F =
  24 14  
3 -3
11 21

Example 3

Suppose we have a 3×3 matrix G, which has 3 rows and 3 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.ex3_3 {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

G =
  -1 0 0  
7 1 0
2 4 6

Suppose we also have a 3×2 matrix H, which has 3 rows and 2 columns:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

H =
  4 5  
9 2
0 1

Here is how to multiply matrix G by matrix H:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.medium {
max-width: 500px;
margin: 5px auto;
color: #000000;
}
.red {
color: red;
}
.blue {
color: blue;
}

G x H =
  -1*4 + 0*9 + 0*0 -1*5 + 0*2 + 0*1  
7*4 + 1*9 + 0*0 7*5 + 1*2 + 0*1
2*4 + 4*9 + 6*0 2*5 + 4*2 + 6*1

This results in the following 3×2 matrix:

table {
border-collapse: collapse;
border-spacing: 0;
padding: 0;
}
td.tdleft {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-left: solid 1px #000;
width: 5px;
padding: 0;
}
td.tdreg {
padding: 2px 1px;
text-align: center;
border-bottom: solid 1px #fff;
}
td.tdright {
border-top: solid 1px #000;
border-bottom: solid 1px #000;
border-right: solid 1px #000;
width: 5px;
padding: 0;
}
.short {
max-width: 250px;
margin: 5px auto;
color: #000000;
}

G x H =
  -4 -5  
37 37
44 24

Additional Resources

The following tutorials explain how to perform other common matrix multiplications:

x