



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An algorithm for solving matrix equations ax = b and finding the inverse of a square matrix a. It includes an example of finding the inverse of a 3x3 matrix.
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!
Suppose we have 2 given matrices A and B, and we’d like to find a matrix X such that
Note, that B should not be a square matrix, for example in case of a linear system B is a matrix
with only 1 column, and X is a matrix with 1 column as well. Suppose matrix A is invertible,
i.e. there exists an inverse A
− 1
. So, we can multiply both parts of the equation (1) by A
− 1
from the left side. We’ll get: A
− 1 · AX = A
− 1 B =⇒ (A
− 1 A)X = A
− 1 B =⇒ X = A
− 1 B. So,
the solution of this equation in case when A is invertible is
− 1 B. (2)
Now let’s suppose we need to find the inverse of any square matrix A. If matrix X is an
inverse for A then it satisfies the following equation: AX = I, where I is an identity matrix.
It is a special case of the equation (1). So we see, that finding an inverse is a special case of
solving the matrix equation (1).
We’ll provide an algorithm of solving the general case of matrix equation (1).
Algorithm of solving the equation AX = B.
Step 1 Construct the augmented matrix from A and B writing the matrix B to the right of
matrix A, i.e. if
a 11 a 12... a 1 n
a 21 a 22... a 2 n
an 1 an 2... ann
, and B =
b 11 b 12... b 1 m
b 21 b 22... b 2 m
bn 1 bn 2... bnm
then augmented matrix is
a 11 a 12... a 1 n
∣ b 11 b 12... b 1 m
a 21 a 22... a 2 n
∣ b 21 b 22...^ b 2 m
an 1 an 2... ann
∣ bn 1 bn 2...^ bnm
Step 2 Perform elementary row operations to reduce the matrix A in the left side of the
augmented matrix to its RREF. (But perform elementary row operations with whole
rows of (A|B)!) If we get a zero-row in A-half of the matrix (A|B), then the matrix A is
not invertible, and we should stop our algorithm. Otherwise, the RREF of the matrix A
will be equal to I (we will prove this fact in the next part). So, by the end of this step
we’ll have a matrix I in the left half of the augmented matrix. Than the matrix from the
right half will be A
− 1 B.
In case of finding the inverse, we should use augmented matrix of the form (A|I), and after
reducing A to its RREF, which in case of invertible matrix should be equal to I, we’ll get A
− 1
in the right half of the augmented matrix.
Example 1.1. Let’s find the inverse of the following matrix
The augmented matrix will be
Now, subtract the 1st line from the 1nd one and the 3rd one. We’ll have:
Then we should subtract the 2nd row from the 3rd and we’ll reduce the left side of augmented
matrix to REF (not RREF yet!):
Example 1.3. Consider the equation
It was shown before that matrix
is not invertible, and so this equation has no solution.
To proceed we’ll need to see what happens with the matrix if we reduce it to its RREF by
elementary row operations. Applying an elementary row operation is equivalent to multiplying
by the appropriate type of special matrices. So, suppose we applied s elementary row operations
with corresponding matrices E 1 , E 2 ,... , Es to the matrix A. After the first operation we get
E 1 A, after the second — E 2 (E 1 A), etc., and after applying all of them the result will be
Es(Es− 1 (· · · E 2 (E 1 A) · · · )).
Moreover, we’ll need the following lemma.
Lemma 1.4. If A and B are invertible matrices of the same size, then AB is invertible and
− 1 = B
− 1 A
− 1 .
Proof. It is sufficient to check that (AB) · (B
− 1 A
− 1 ) = I. It is true, since
− 1 A
− 1 ) = A(BB
− 1 )A
− 1 = AIA
− 1 = AA
− 1 = I.
From this lemma it follows that if A 1 , A 2 ,... , An are invertible matrices of the same size,
then their product A 1 A 2 · · · An is invertible and (A 1 A 2 · · · An)
− 1 = A
− 1 n A
− 1 n− 1 · · ·^ A
− 1
Another fact we will state in the following lemma:
Lemma 1.5. The matrices of the elementary row operations are invertible.
Proof. Using the notations from the previous lecture we can specify the inverses for the matrices,
corresponding to elementary row operations:
− 1 ij =^ Pij^ ;^ (5)
Qi(c)
− 1 = Qi
c
(I + cIij )
− 1 = I − cIij. (7)
It is easy to check that these identities are correct.
Now we’re ready to prove that the algorithm gives us the solution to the equation AX = B
in case if A is invertible. We’ll state this result as the following lemma.
Lemma 1.6. 1. If the square matrix A is invertible, then its RREF is the identity matrix.
if its RREF is identity matrix, then this algorithm gives us A
− 1 B in the right half of the
augmented matrix.
So, this lemma tells us that in case of the invertible matrix A the algorithm will not stop
since we’ll not get zero rows and finally we’ll get identity matrix in the left part of the augmented
matrix, and it will give us the correct solution of the equation (1) in the right half.
Proof of part 1. Suppose A is invertible, and its RREF is equal to some matrix B (which is in
its own RREF). Then there exist matrices of elementary row operations E 1 , E 2 ,... , Es such
that Es... E 2 E 1 A = B. Since A is invertible and Ei’s are invertible, B is also invertible. But if
B 6 = I then B has a zero row, and B is not invertible, which contradicts with what we proved
before (that B is invertible). So, B = I.
Proof of part 2. So, by applying elementary row operations to the augmented matrix, we mul-
tiply its parts by matrices of elementary row operations, i.e. during this algorithm we multiply
A and B by elementary matrices E 1 , E 2 ,... , Es. So, by the end of our algorithm augmented
matrix has the following form:
(Es... E 2 E 1 A|Es... E 2 E 1 B) = (I|C).
So, we have that (Es · · · E 2 E 1 )A = I, so that (Es · · · E 2 E 1 ) = A
− 1 , and so C = (Es · · · E 2 E 1 )B =
− 1 B – what we wanted to get.