The inverse
One nice way of solving
occured if we can find some matrix
such that
. In this case, we first multiply both sides by
on the left
to get
and the solution is simply given as
. (Since
, of course!) Now we study when it can be done and how the matrix
can then be found.
We will later show that the equation
or a similar reversed equation
is possible only when
is a square matrix. Further, it will come out that either of the two implies the other and then the two answers
must agree!
For our algorithm, it is easier to solve
. We think of this as
equations, where we replace the right hand side
by each of its column.
Now comes a simple but important observation. Our method of solving equations depended on choosing pivots from the left hand side coefficients only, while the operations were carried out on both the sides together. This means that if we have several right hand sides, we may as well augment all of them together, provided we remember not to take pivots from them. The final solutions can then be read off at the end separately.
Thus to solve
, we take the augmented matrix (
|
) and start the reduction process. We had done this earlier for a different purpose anyway, so there is nothing new involved! For example:
> A:=matrix(3,3,[1,2,1,-2,3,1,3,1,1]);M:=augment(A,eye(3));
> M1:=addrow(M,1,2,2):M2:=addrow(M1,1,3,-3);
> M3:=addrow(M2,2,3,5/7);
> M4:=multrow(M3,3,7);
> M5:=addrow(M4,3,2,-3):M6:=addrow(M5,3,1,-1);
> M7:=multrow(M6,2,1/7);
> M8:=addrow(M7,2,1,-2);
The desired answer appears in place of
. We extract it and verify that it does the right thing!
> F:=submatrix(M8,1..3,4..6);
> check:=evalm(F&*A),evalm(A&*F);
Of course, there are Maple shortcuts. We can apply the inverse command or use a simple algebraic inverse.
> inverse(A),evalm(A^(-1));
Note that we have a free result as a consequence.
We know that the change from
to
was also effected by multiplying by the matrix
on the left. This is because, the product of the elementary matrices was automatically stored in
. BY observing
, we see that
. Thus, we have proved that
gives
also!
>