Inverse of a Matrix
We would like to know when given a nxn matrix A we can find an nxn matrix B such that
AB=BA = I where I is the nxn identity. From the last lecture we can take the determinate of both side to tell us which matrices will have a B.
det(AB) = det(A)*det(B) = det(I) = 1. We know that det(I) = 1 since it is a diagonal matrix with all ones one the diagonal and the product of n ones is still 1. Since the det(A) and the det(B) when multiplied together must be 1 neither determinate can be equal to zero. A matrix with non-zero determinate is called a nonsingular matrix. This means that any matrix with a non-zero determinate will have a matrix B such that AB=BA = I. The matrix B is called the inverse of A and written as
. We do not write it as
since division of matrices is not defined. Unless the matrix is a 2x2 matrix we usually will not take the determinate before trying to find the inverse as will be illustrated shortly. However, if we are looking at 2x2 matrices we can quickly check to see if the matrix is non-singular.
and we see that the determinate is 2-4=-2 so it will have an inverse.
I claim that
and a quick check shows that
=
= I .
So how did we arrive at the answer. There are two way to arrive at the answer. The first one we present is not the way that we will find the inverse of a 2x2 matrix but we are going to present it for the sake of completeness.
| > |
I2:=DiagonalMatrix(<1,1>); |
We can now motivate why we are looking at the augmented matrix.
(A|I) = (
|
) = ( I |
)
What we will do is apply Gauss-Jordan to the augmented matrix and try to turn A into the identity. The identity matrix should then be turned into the inverse.
| > |
AI1:=addrow(AI,1,2,-2); |
| > |
AI3:=addrow(AI2,2,1,-1); |
| > |
AI4:=mulrow(AI3,1,1/2); |
| > |
Ainv:=submatrix(AI4,1..2,3..4); |
We will now look at a 3x3 matrix . This time the matrix a will be created by columns
| > |
A:=<<1,0,1>|<1,2,0>|<1,1,1>>; |
| > |
I3:=DiagonalMatrix(<1,1,1>); |
| > |
AI31:=addrow(AI3,1,3,-1); |
| > |
AI32:=addrow(AI31,2,3,1/2); |
| > |
AI33:=mulrow(AI32,3,2); |
| > |
AI34:=addrow(addrow(AI33,3,2,-1),3,1,-1); |
| > |
AI35:=mulrow(AI34,2,1/2); |
| > |
AI36:=addrow(AI35,2,1,-1); |
We can check you answer
| > |
InvA:=submatrix(AI36,1..3,4..6); |
This is the method recommended for any matrix higher then a 2x2 matrix. Now we are going to study another method which works for any size matrix. The process takes a little longer and you have a lot to think about when the size is bigger than a 2x2.
Fist we need some new notation. The Minor or an element of a matrix say the (2,3) element is the
determinate of the submatrix obtain by deleting the 2nd row and 3rd column of the matrix.
For A above then
= det(
) =-1, and the cofactor is a signed minor.
=
so we have that
= (-1)*(-1) = 1 .(The 2+3 in the power of -1 is obtained from the cofactor position. The inverse can then be obtained as the transpose of the
Cofactor matrix multiplied by
. For a 2x2 matrix we can calculate the inverse by interchanging the elements on the diagonal, changing the sign of the non-diagonal elements and multiplying by 1/det(A). We will first work find the inverse using the above discussion. This is too long to do when looking at a 2x2. We will look at how to do it the easy way right after the following discussion.
Let us look how to find the inverse the short way. Interchange the diagonal elements and change the sign of the other two elements and divide by the determinate of the matrix. This short cut only works for 2x2 matrices and not for 3x3 and higher.
| > |
IB:=(1/det(B))*<<1,-2>|<-4,3>>; |
Again so you get it down , the inverse of B was found by interchanging the diagonal elements, changing the sign of the non-diagonal elements and multiplying by 1/det(B). We did not need the cofactors. This is not true when we look a matrices of higher order.
Now we will look at how to find the inverse of the above 3x3 matrix by using the adjoint method which is the one we just described.
Let us return to the 3x3 matrix we discussed earlier and find its inverse using the adjoint method
| > |
A:=<<1,0,1>|<1,2,0>|<1,1,1>>; |
Since I used C above for the coefactor matrix for a 2x2 I will need to alter the name here and use Co insteat of C
We will now find the minor and cofactor of each element.
| > |
M[1,1]:=Determinant(<<2,0>|<1,1>>); |
| > |
Co[1,1]:=(-1)^(1+1)*M[1,1]; |
| > |
M[1,2]:=Determinant(<<0,1>|<1,1>>); |
| > |
Co[1,2]:=(-1)^(1+2)*M[1,2]; |
| > |
M[1,3]:=Determinant(<<0,1>|<2,0>>); |
| > |
Co[1,3]:=(-1)^(1+3)*M[1,3]; |
| > |
M[2,1]:=Determinant(<<1,0>|<1,1>>); |
| > |
Co[2,1]:=(-1)^(1+2)*M[2,1]; |
| > |
M[2,2]:=Determinant(<<1,1>|<1,1>>); |
| > |
Co[2,2]:=(-1)^(2+1)*M[2,2]; |
| > |
M[2,3]:=Determinant(<<1,1>|<1,0>>); |
| > |
Co[2,3]:=(-1)^(2+3)*M[2,3]; |
| > |
M[3,1]:=Determinant(<<1,2>|<1,1>>); |
| > |
Co[3,1]:=eval((-1)^(3+1)*M[3,1]); |
| > |
M[3,2]:=Determinant(<<1,0>|<1,1>>); |
| > |
Co[3,2]:=(-1)^(3+2)*M[3,2]; |
| > |
M[3,3]:=Determinant(<<1,0>|<1,2>>); |
| > |
Co[3,3]:=(-1)^(3+3)*M[3,3]; |
 |
(1.1) |
| > |
Co:=<<Co[1,1],Co[2,1],Co[3,1]>|<Co[1,2],Co[2,2],Co[3,2]>|<Co[1,3],Co[2,3],Co[3,3]>>; |
You can use the delcol and delrow commands found in you Maple portion of you text. For a 3x3 I found it just as easy to write out the matrices. Next we will look at a 4x4 example and use the adjoint command found in Maple to find the inverse.
| > |
AA:=<<1,0,1,1>|<0,0,1,0>|<1,1,1,0>|<1,0,0,2>>; |
| > |
AI:=(1/DAA)*Adjoint(AA); |
The recommended way of finding the above matrix is to adjoin the identity to the original matrix and do Gauss-Jordan to the augmented matrix . In the with(LinearAlgebra) package there is a command for the identity matrix
 |
(1.3) |
 |
(1.4) |
| > |
GJAAaug:=gaussjord(AAaug); |
 |
(1.5) |
| > |
AI:=delcols(GJAAaug,1..4); |
 |
(1.6) |
The last way is the best way to find the inverse if you are working out the step by pencil and paper.
Exercises
Hand in the following problems by handing in a hard copy in class or by e-mailing me your Maple worksheet. Problems due on September 22, 2008
Exercise 1.7.23 (work this problem by the adjoint method and by adjoining the 2x2 identity and doing Guass-Jordan to the augmented matrix), Exercise 1.7.18, Exercise 1.7.19, Exercise 17.27 (work the three problems by adjoining the 3x3 identity or the 4x4 idendity to the matrix (depending on the size of the origional matrix) and carrying out Gauss-Jordan. You should not use the gaussjord command but do the steps using addrow and swaprow commands). .
Problems due on September 24, 2008
Exercise 1.7.27 (Find the cofactor of each element of the matrix and then use this to build the adjoint matrix. Use the det() command to find the determinate of the matrix. Finally, find the inverse of the matrix. Exercise 1.7.39 (the correct model can be found in the answer section where the model was developed. Use the inverse of find the answer. ) Exercise 1.7.41, Exercise 1.7.42.