# 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:

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:

B =
 B11 B12 B21 B22 B31 B32

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

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:

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:

D =
 2 1 5 1 0 -1

Here is how to multiply matrix C by matrix D:

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:

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:

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:

F =
 -2 -2 3 1 4 10

Here is how to multiply matrix E by matrix F:

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:

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:

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:

H =
 4 5 9 2 0 1

Here is how to multiply matrix G by matrix H:

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:

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