Although calculating inverses is usually complicated, you'll find out a universal algorithm to find them and also a general expression for it in terms of a lot of determinants.
To develop the algorithm, you'll need the elementary row operations that you already handle really well. Actually, the elemental matrices will be the building blocks. So let's not wait any longer, and go there!
Elementary matrices
As you know, applying an elementary row operation to a matrix is exactly the same as applying that operation to the identity (which is easy), forming a new matrix and then taking the product . For this reason, is called elementary.
To find the inverse of a matrix, you are going to multiply a bunch of elementary matrices. For now, the first thing to note about any elementary matrix is that it's always invertible. Moreover, you can easily calculate its inverse.
Take, for example, the elementary matrix resulting from swapping the first two rows from the identity matrix . If you swap the rows again, you retrieve the identity matrix. But this is equivalent to premultiplying by the elementary matrix that swaps these rows, which in this particular case is precisely . This means that the inverse of is itself, which you can easily check:
In general, the inverse of any elementary matrix is in fact the elementary matrix that applies the same elementary operation, but in the "inverse" direction. That is when the operation is:
- To multiply a row by a number , the inverse is to multiply the same line by .
- To add a scalar multiple from one line to another, the inverse is simply to subtract the same scalar multiple from the first line to the second.
- To exchange two rows, its inverse is itself.
For example, if you obtained the elementary matrix from the identity by multiplying a row by , then it is enough to multiply that same row by to recover the identity. So, if is the elementary matrix of this last operation, then and by the same reasoning . Thus .
You're almost done. The last thing you must know is that products and inverses get along well.
If and are invertible, then is also invertible, and its inverse is:
Proof
You only have to check out the definition of the inverse matrix. On one hand:And on the other hand:
How to find the inverse
Let's put all your work together:
Let be a square matrix of size . Then is invertible if and only if its reduced row echelon form is the identity. That is, if there exists elementary matrices such that:In this case, the inverse of is:
Proof
If , then by multiplying both sides by the left by it's clear that Therefore, by multiplying by by the right, . Thus, is invertible, and .
For the rest of the proof, you need the following lemma:
Let be an invertible matrix and be elementary matrices.
If the matrix defined as is in row-echelon form, then all of the entries of its main diagonal are different from zero.
Proof
Suppose that there is an entry in the main diagonal of T which is zero.
That is, there is some such that .
Recall that is in row-echelon form. Think about the rows that are below the I-th one. They must have their first non--zero entry to the right of the I-th position. But as T is square, this causes the last row can't have a non-zero entry. Thus the last row of T is the zero vector.
Now, take any square matrix . What does the last row of TC look like? As the last row of is zero, the last row of is the zero vector. In consequence, cannot be the identity matrix . So that isn't the inverse of . Finally, as is an arbitrary square matrix, this result holds for every square matrix. Thus cannot be invertible, which is a contradiction.
Great, let's now assume that if is invertible, first put it into a row-echelon form by applying some elementary row operations. By the lemma, all of the entries in the main diagonal of the matrix are non-zero. Then, by applying some more elementary row operations, you can convert all these entries in 's. After that, you can easily continue applying elementary row operations in order to transform into 's all of the entries out of the diagonal. Hence the reduced row echelon form of is .
Let's say that the total number of elementary row operations needed was . Then there exist elementary matrices such that . Hence by, as is invertible, .
Although it may not seem so at first sight, this result gives us an infallible algorithm to find the inverse of any invertible matrix:
- Find the reduced row echelon form of .
- If the result is the identity, you can move forward, otherwise is not invertible.
- Save all the elementary matrices used in the previous process.
- Then is the product of these elementary matrices in the reverse order in which they were used. That is .
But wait a minute. The product is the same as . This means that the operations that are applied to in order to transform it into then have to be applied again to in the same order to convert it into . So, why not apply the operations at the same time on both matrices?
First, join the two matrices into an augmented one by putting to the right of :After that, start applying elementary row operations to the big matrix in order to row reduce – this means that every operation applied to is immediately applied to . At the end, when on the left has become , on the right will have become :
For example, the inverse of the matrix is . Our method establishes that first of all, you have to build the augmented matrix and apply operations till is converted into and at that moment the original will be . You can visualize it in the following way:
Better let's see the method in action!
An invertible matrix
Suppose you want to find the inverse of the following matrix:
The first step is to define the bigger matrix:
Now compute the reduced row echelon form of . You can start by interchanging the two rows:
Now, subtract two times the first row from the second one:
Now divide the second row by :
Finally, subtract times the second row from the first one:
You've just transformed into . So, the desired inverse is:
The inverse in terms of determinants
The determinant is a really versatile tool, and you can even use it to build the inverse of a matrix . The first step is to build a new matrix with all the possible cofactors of :
Then you only have to transpose it and divide every entry by the determinant of the original matrix. The whole process is the following:
If is invertible, then:
Proof
As always, proofs are optional. In this case, you should be familiarized with the properties of the determinant.
First, let's denote . The strategy is to get every entry of . You know that . Let . On one hand, by the matrix product properties, the -th column of is the product between and the -th column of , that is . On the other hand, as , the -th column of is just the -th column of which is simply . Thus:Nice! This is a simple system of linear equations with unknown vector , so you can apply the Cramer's Rule, to get every entry of . Then, for every :
Here comes the important part. Look at the numerator. It is the determinant of a matrix whose -th column is the vector . That's a column with a bunch of zeros. Actually, all its entries are zero, except the -th which is . Therefore, you can expand the determinant along this column, which means that only one term will survive:
But the minor of matrix is exactly the minor of matrix because in both cases, removing the -th row or the -th column, the result is exactly the same (after all, both matrices are the same except for the -th column, which is exactly the one you removed!). Thus
Finally, by the definition of the transpose, is the entry of
As a simple but curious example, you can use this formula to find the inverse of any invertible matrix of size . After easily computing all the possible cofactors of any matrix , you get that . Thus:
Let's apply it to the matrix whose inverse you have already calculated, . Then . Hence:
This is exactly the same result as before! You didn't need to apply row operations or other cumbersome operations to calculate it! Nice.
Conclusion
- Every elementary matrix is invertible, and its inverse is also elementary.
-
The product of invertible matrices and is also invertible, and .
-
is invertible if and only if its reduced row echelon form is . In this case, its inverse is the result of applying on exactly the same elementary row operations that you used to transform into .
-
When the matrix is invertible, . Where is the matrix of cofactors of .
-
For any invertible matrix , its inverse is obtained by simply switching the entries in the main diagonal, changing the signs for the other entries, and finally dividing every entry by the determinant, .