Math 22 Fall 2004
Linear Algebra with Applications
The Inverse of a Matrix
October 11, 2004
Load the packages for doing Linear Algebra
> | with(Student[LinearAlgebra]): |
Warning, the protected name `.` has been redefined and unprotected
Define a matrix we want to invert
> | A := <<0, 3, -1>|<2, -2, 0>|<1, -5, 1>>; |
Augment it with the identical matrix
> | A_I := <A | IdentityMatrix(3)>; |
Perform row reductions to transform A into
the Reduced Echelon Form (that is, the identity matrix).
> | A_I := SwapRows(A_I, 1, 3); |
> | A_I := AddRow(A_I, 2, 1, 3); |
> | A_I := AddRow(A_I, 3, 2, 1); |
> | A_I := MultiplyRow(A_I, 3, -1):
A_I := MultiplyRow(A_I, 2, -1/2): A_I := MultiplyRow(A_I, 1, -1); |
> | A_I := AddRow(A_I, 2, 3, -1):
A_I := AddRow(A_I, 1, 3, 1); |
Now the last 3 columns should form the inverse matrix of A
> | A_Inverse := LinearAlgebra[DeleteColumn](A_I, [1 .. 3]); |
Let's check our answer
> | A.A_Inverse, A_Inverse.A; |
> |