Do you want to learn the multiplication of matrices step by step? Next I’m going to explain how to make the product of matrices, with exercises solved step by step.

Unlike with numbers, which we can multiply any of them, we cannot multiply any matrix.

[announcement_b30 id=4]

Índice de Contenidos

## How to multiply matrices. Matrices product

To multiply two matrices, a very important condition must be met:

The number of columns in the first matrix must be equal to the number of rows in the second matrix. [/box]

To define the dimensions of an array, 2×2, 3×3, 3×2… the first dimension refers to the rows of the array and the second dimension to the columns:

Therefore, if we have a matrix A of m rows and n columns, we can only multiply it by a matrix B that has n rows and p columns (same number of columns of A, same number of rows of B):

The resulting matrix will have the same number of rows as A and the same number of columns as B.

Anyway, you don’t have to learn this by heart to know how to multiply matrices. You just have to keep in mind that you can’t multiply any matrix. They must always fulfill the previous condition and that the resulting matrix will have different dimensions to the two matrices that are multiplied.

## Matrices product. Solved exercises

Let’s see how the matrix product is performed with one exercise.

### Exercise 1

Let matrices A and B be as follows:

Multiply AxB.

First of all, can AxB be multiplied?

We have to look at the columns of A and the rows of B. Matrix A has 3 columns and matrix B has 3 rows. They are the same and can therefore be multiplied.

To multiply two matrices, we must multiply each row of the first matrix by each column of the second matrix.

box]Rows are multiplied by columns[/box]

Let’s see it step by step.

First we multiply the first row of A by the first column of B. A scalar product is made, that is, the elements of the row and the column are multiplied and their results are added as follows:

The first element of the row by the first element of the column…

…more…

the second element of the row by the second element of the column…

…more…

…the third element of the row by the third element of the column.

This operation, which is the result of multiplying the first row by the first column, will form the first element of the first row of the resulting matrix:

We continue multiplying the first row of A by the second column of B. We multiply each element of the row by each element of the column (first by first, second by second and third by third) and the operation will form the second element of the first row of the resulting matrix:

So far we have multiplied the first row of A by all the columns of B. With your results, we have formed the first row of the resulting matrix.

We repeat the same with the second row of A, multiplying it by each of B’s columns.

We continue with the second row of A by the first column of B, whose result will form the first element of the second row:

And to finish we multiply the second row of A by the second column of B, to form the second element of the second row:

Now we have multiplied all the rows of A by all the columns of B and it only remains to perform the operations we have left in each element:

Note that the dimensions of the resulting matrix are different from A and B (it has the same rows as A and the same columns as B).

[announcement_b30 id=4]

### Exercise 2

Calculate the possible products between the following matrices:

What we are asked in this exercise is to multiply the matrices that can be multiplied. To do this, the number of columns in the first matrix must be equal to the number of rows in the second matrix.

Let’s start with matrix A, which has 3 columns. We can multiply this matrix by the matrices that have 3 rows. First, we can multiply it by the same matrix A, which also has 3 rows.

We make the product of matrices of A.A=.

We multiply rows by columns:

And we operate:

Matrix B also has 3 rows, so we can multiply A.B=.

We multiply rows by columns and operate:

We continue with matrix B which has 1 column. We can multiply it by any matrix that has 1 row, but in this case we don’t have any, since matrix A has 3 rows, matrix B itself has 3 rows and matrix C has 2 rows. Therefore, matrix B cannot be multiplied by any matrix.

Finally we are going to see the possible products of matrices with the shade C. Matrix C has 3 columns, so we can multiply it by matrices that have 3 rows.

Matrix A has 3 rows, so we multiply C.A:

We multiply rows by columns:

And we operate:

Matrix C can also be multiplied by matrix B, which has 3 rows:

We multiply rows by columns and operate:

Now that you know how to multiply matrices, let’s look at the properties of the square matrices product.

[ad_b30 id=4]

## Properties of square matrix multiplication

1- The product of square matrices fulfills the associative property

2- The neutral element is the matrix identity

Any matrix multiplied by the identity matrix will result in the same matrix. The matrix identity is as if it were 1 for the numbers.

3- The multiplication of matrices is not commutative in general.

As a general rule, the multiplication of A by B does not have the same result as B by A.

There may be the case that A.B=B.A, but it is not normal.

4- It is distributive with respect to the sum

5- The product of two non-null matrices can be a null matrix.

For example:

6- Given a square matrix A, there will not always be an inverse matrix that complies: