# Matrix Multiplication: Product of Two Matrices

Matrix multiplication is the “messy type” because you will need to follow a certain set of procedures in order to get it right. This is the “messy type” because the process is more involved. However, you will realize later after going through the procedure and some examples that the steps required are manageable. Don’t worry, I will help you with this!

But first, we need to ensure that the two matrices are “allowed” to be multiplied together. Otherwise, the given two matrices are “incompatible” to be multiplied. If this is the case, we say that the solution is undefined.

## Matrix to Matrix Multiplication a.k.a “Messy Type”

**Always remember this!**

In order for matrix multiplication to work, the **number of columns** of the left matrix MUST EQUAL to the **number of rows** of the right matrix.

Suppose we are given the matrices A and B, find AB (do matrix multiplication, if applicable). Determine which one is the left and right matrices based on their location. It is a very important step.

To determine if I can multiply the two given matrices, I need to pay attention to the number of columns of matrix A and the number of rows of matrix B. If they are equal, then I can proceed with Matrix Multiplication. Otherwise, I will conclude that the answer is undefined!

Because **Matrix A has the number of columns of 2**, and **Matrix B has the number of rows of 3**, and they are not equal **(2 â‰ 3)**, I conclude that AB = **undefined**.Â That means their product can’t be found.

### Examples of Matrix Multiplication a.k.a. “Messy Type”

**Directions**: Given the following matrices, perform the indicated operation.

**Example 1**: Calculate, if possible, the product of B and E.

In order for matrices B and E to have a product, the number of columns of left matrix B **must equal **the number of rows of right matrix E.

**Matrix B (left)**

number of columns = 3

**Matrix E (right)**

number of rows = 3

Since this is the case, then it is okay to multiply them together. Now, these are the steps:

**Step 1:** Place them side by side.

**Step 2:** Multiply the rows of B into the columns of EÂ by multiplying the corresponding elements of each row to each element of the column, andÂ then add them together.

**Please watch the animated solution carefully.**

If you have no patience watching the animated solution above on how to perform matrix multiplication, you can view the regular solution I have included below.

**Example 2**: Calculate, if possible, the product of E and F.

Check first if the product of the two matrices existsÂ by making sure that the number of columns of left matrix E **equals** the number of rows of right matrix F.

**Matrix E (left)**

number of columns = 2

**Matrix F (right)**

number of rows = 2

This is wonderful since the **number of columns of matrix **E **equals the number of rows of matrix **F. This means the product of EF is defined so we can go ahead and perform matrix multiplication. See below for the animated step-by-step solution ofÂ matrix multiplication.

**Example 3**: Calculate, if possible, the product of F and E.

In our previous example, we have successfully obtained the product of EF. This time around, we want to find if we can find the product of E[latex] and [latex]F, in that order.

Just to remind you, real numbers are commutative under multiplication operation which means that the order of multiplication does not affect the final product. For instance...

So the big question becomes, does it work also in matrix multiplication?

Let's check if the number of columns of matrix F equals the number of rows of matrix E.

**Matrix F (left)**

number of columns = 2

**Matrix E (right)**

number of rows = 3

Obviously, the number of columns of Matrix F **does not equal** the number of rows of Matrix E. The implication is that the product of FE cannot be calculated, and therefore undefined!

In general, matrix multiplication is not commutative.

**Example 4**: Calculate, if possible, the product of AE.

The standard way to describe the size or dimension of a matrix is to...

(state number of rows) **x** (state number of columns)

...read as "the number of rows by the number of columns".

3 **x **3 (three by three matrix)

3 **x **2 (three by two matrix)

Since the **number of columns of matrix A** equals the **number of rows of matrix E** then we conclude that the product of AE is defined.

Let's work it out. See the animated solution below.

**Example 5**: Calculate, if possible, the product of E and A.

3 **x **2 (three by two matrix)

3 **x **3 (three by three matrix)

Obviously, the number of columns of matrix E **does not equal** the number of columns of matrix A. Therefore, the product of EA cannot be calculated, or undefined.

**Example 6**: Calculate, if possible, the product of D and F.

Since the number of columns of matrix D **equals** the number of rows of matrix F, the product of DF is defined.

**Example 7**: What is the product of **matrix C** when multiplied by itself?

This is rather simple. We will simply multiply matrix C by matrix C which can be written as CC or {C^2}. In other words, we are squaring matrix C.

We need to be cautious here. Notice that only a square matrix can be squared. Just to remind you, a square matrix is a matrix where the number of its row is equal to the number of its column.

I will leave it to you to verify that the solution below is correct. For math problems such as this, although tedious, I always recommend doing it by hand using a pencil and paper.

**You might also be interested in:**