Calculation of the inverse matrix by the Gauss-Jordan method and by determinants. Exercises solved.

I will now explain how to calculate the inverse matrix using the two methods that can be calculated, both by the Gauss-Jordan method and by determinants, with exercises resolved step by step.

What is the inverse or inverse matrix of an matrix?

The inverse matrix is the one that when multiplied by the original matrix, the result is the matrix identity:

inverse of a matrix

The inverse matrix does not always exist. For an inverse matrix to exist, its determinant has to be different from zero:

inverse matrix

Before you know how to calculate the inverse of an array, you must be very clear about the operations you can perform with the rows of an array.

Elementary operations in any matrix

Within an array, we can perform operations with its rows and the array will not be affected. Each time we perform an operation with the rows of an array, we will have an array equivalent to the previous one.

These are the operations we can do with the rows:

1- Swap rows or columns with each other

We can exchange one row for another at our convenience:

inverse matrix gauss jordan

i and j correspond to the row numbers in the matrix.

2- Multiply or divide a row by a number other than zero

We can multiply or divide the row we want by the number we want. That number can be either an integer or a fraction;

inverse matrix gauss method

3- Add two rows i and j, multiplied by any two numbers and the result take them to row i or to row j

Rows can be added and subtracted, multiplied by any number and the result put in the row that suits us.

gauss jordan inverse

Later on, we will apply these elementary operations to calculate the inverse and you will better understand how they work.

How to calculate the inverse matrix. Gauss-Jordan method

The Gauss-Jordan method allows us to calculate the inverse of a matrix by performing elementary operations between its rows.

inverse matrix by gauss

In the same matrix divided into two parts, in the left part is placed the matrix to which we want to calculate its inverse and in the right part is placed the matrix identity:

inverse matrix gauss jordan method

Running elementary operations between the rows of this matrix, we have to make sure that on the left side we have the matrix identity. Once we get it, the matrix we have on the right side will be the inverse matrix:

inverse matrix by the gauss jordan method

Example of calculation of the inverse of a matrix by Gauss step by step

We are going to calculate the inverse of a 3×3 dimensional matrix using the Gauss-Jordan method, step by step.

Many times, if you are not clear about the objective you want to achieve when you perform operations between rows, calculating the inverse matrix can become a labyrinth from which we will not know how to get out.

That’s why I’m going to explain to you the elementary operations that you have to perform so that the inverse is calculated almost directly

We are going to see it very slowly: Calculate the inverse matrix of the following matrix:

inverse matrix by gauss method

First, we place in the same matrix, matrix A in the left part and inverse matrix I in the right part:

gauss method jordan inverse matrix

And is left:

gauss method inverse matrix

Now we are going to start with the elementary operations between the rows. Remember that we have to get the matrix identity on the left side.

Where do we start?

The first thing we want to achieve is that in the first element of the first column there is a 1:

How to calculate the inverse matrix

In this case we already have it, so we don’t have to do anything. If you didn’t have it, then you have several ways to get it: dividing the first row by the number we have, exchanging it for another row that has one, adding or subtracting another row multiplied by another number…

Remember that the elements of an array can also be fractions.

Once we have 1 in the first element of the first column, the next step is to get the elements that are below 1 in that first column to be 0:

inverse by gauss jordan

The third element is already a 0, but the second is not. To get it I’m going to add row 1 to row 2 and the result I’m going to leave in row 2:

inverse of an array

Rows 1 and 3 remain the same. The matrix we have left is:

gauss jordan matrices

We already have the first column ready.

We continue with the second column. Now, we have to get the second element of the second column to be a 1:

gauss jordan method

I could divide the second row by 2 and I would have it, but in row 3, I have a 1, so it’s easier to swap row 2 for row 3:

matrix gauss jordan

And we are left:

gauss jordan

The next thing we have to achieve is that both the first element and the third element of the second column are 0:

gauss jordan paso a paso

The first element is already a 0, so we don’t have to do anything. To get 2 to be a 0, I’m going to subtract row 2 twice from row 3:

gauss method inverse jordan
I take advantage of the fact that in row 2 I have a 1. Having a 1, I only have to multiply that row by the number that suits me, in this case a 2, and subtract it from the row in which I want to have the result (this is another of the objectives of having 1 in the previous step).

We have left:

how to get the inverse matrix

We already have 2 columns like the ones in the identity matrix. Let’s go for the third column:

We have to get the third element of the third column to be a 1:

inverse matrix calculation

We have a -1, so to get a 1, I’m going to multiply row 3 by -1:

calculate inverse matrix

And we have left:

calculate the inverse of an array

The next step is to make the elements above 1 0:

gauss

The first element is already a 0 and to get the second element to be a 0, I’m going to subtract row 1 twice from row 2 and I’m going to leave the result in row 2:

calculation of inverse matrices

Again I have taken advantage of 1.

We are left:

Calculation of the inverse of an array

At this point, we have the matrix identity on the left side, which means that on the right side we have the inverse matrix:

inverse matrix

inverse matiz

Therefore, the inverse matrix of A is:

invert matrix

Checking the inverse calculation

We are going to check that we have calculated the inverse matrix correctly. To know if it is OK, we have to multiply the original matrix by the inverse matrix and the result must give the matrix identity:

matrices metodo gauss

We perform the multiplication of A matrices by its inverse:

inverse matrix gaus method

calculate inverse

Y effectively, the result of multiplication is the matrix identity, so the inverse is well calculated.

How to calculate the inverse of a matrix by determinants

To calculate the inverse matrix using determinants we will use the following formula:

inverse matrix for determinants

The reverse matrix of an A matrix is equal to the attached matrix of its transposed matrix, divided by its determinant.

Thus said, it seems a little messy but let’s see it step by step with an example:

Resolved exercise on how to calculate the inverse matrix with determinants

Calculate the inverse matrix of the following matrix A:

We solve power and determinants of order 2:

inverse matrix calculation

Y we continue to operate.

calculate the inverse of a matrix

inverse matrix calculation

The determinant of A is equal to 3, therefore it is different from 0 and therefore the inverse matrix exists and we can continue calculating.

The next step is to get the matrix transposed from A.

To get the matrix transposed from A, we just have to exchange the rows for the columns and we have:

determinant inverse matrix

Y now we are going to calculate the attached matrix of this transposed matrix.

To calculate the attached matrix, we obtain the attachments of each of the elements of the matrix and replace them with the original elements.

We are going to calculate them from left to right, row by row.

Attachment of 5:

How to calculate the inverse matrix

Attachment of 1:

inverse matrix

Attachment of 2:

inverse matrix with determinants

Attachment de 3:

How to find the inverse of a matrix

Attachment of 4:

inverse matrix formula

Attachment of 0:

how to calculate inverse matrix

Attachment of -1:

inverse of a determinant matrix

Attachment of 2:

the inverse of a matrix

Attachment of -1:

How to get the inverse of a matrix

Once we have all the attachments of all the elements, we form the attached matrix substituting the original elements with their attachments and we are left with:

calculate inverse matrix

We already have everything we need to calculate the inverse matrix, so we replace in the formula, both the determinant and the attached matrix of the matrix transposed:

how to calculate the inverse of a matrix

inverse of a matrix with determinants

Multiply the fraction for each of the elements of the matrix and simplify the elements that can:

formula inverse matrix

And this is the inverse matrix of matrix A.