KEMBAR78
MATH-224 - LectureNotes 4 | PDF | Matrix (Mathematics) | Numerical Analysis
0% found this document useful (0 votes)
51 views32 pages

MATH-224 - LectureNotes 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views32 pages

MATH-224 - LectureNotes 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

MATH-224

LINEAR ALGEBRA AND FURTHER CALCULUS

Lecture 4: Solutions of Linear Systems of Equations by


Elementary Row Operations, Inverse Matrix Method, and
Cramer’s Rule

Course Lecturers: Dr. M. Maliyoni & Mr. B. Malipa

Applied Studies Department, MUST

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 1 / 32


Lesson Outcomes

By the end of this lesson, you should be able to:


Write matrices in reduced row echelon form using elementary row
operations.
Compute the inverse of an n × n matrix (i.e. square matrix of any
order)
Solve linear systems of equations using inverse matrix method.
Compute solutions of linear systems of equations using Cramer’s rule.

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 2 / 32


Introduction

We present to you the fourth lecture of this course and the last
lecture of the first topic, Matrices.
In the previous lecture, you learnt about the adjoint of an n × n
matrix, inverse of an n × n matrix, and systems of linear equations.
In this lecture, we will discuss solutions of linear systems of equations
by elementary row operations, inverse matrix method and Cramer’s
rule.
Please ensure that you have a scientific calculator which will be used
at some point in this course.

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 3 / 32


Elementary Row Operations
We begin with the definition of a special type of matrix that can be used
to carry out an elementary row operation by matrix multiplication.
Definition
An n × n matrix is called an elementary matrix if it can be obtained from
the identity matrix In by performing a single elementary row operation.

Example
Elementary Matrices and Row operations
Listed below are four elementary matrices and the operations that produce
them.

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 4 / 32


Solutions of Linear Systems of Equations by Elementary
row Operations
Using Row or Column Reduction
(i) Consider the following two equations; ax + by = m and cx + dy = n.
(ii) All the information contained in these equations may be summarized
in the augmented matrix
 
a b m
.
c d n

The vertical bar is used to separate the coefficients of the original


unknowns from the right hand side.
(iii) The idea behind this method (Gaussian elimination) is to reduce the
augmented matrix to a matrix of the form
 
1 0 k
0 1 l
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 5 / 32
How do we reduce the augmented matrix
We can do this by using row operations. The following are the three row
operations;
Interchange of two rows.
Multiply a row by a non-zero number.
Add a multiple of one row to a different row.
When a row operation is performed on a matrix, the resulting matrix
represents a system of equations equivalent to the system represented by
the original matrix.

This can be demonstrated in the following example.


Example
Consider the following augmented matrix
 
1 2 3
4 -1 2

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 6 / 32


Suppose that we want to apply a row operation to this matrix that results
in a matrix whose entry in row 2, column 1 is 0. The row operation is;
Multiply each entry in row 1 by −4 and add the result to the
corresponding entries in row 2.
We can represent the row operation in the statement above by

R2 = −4r1 + r2

Applying this row operation on the above augmented matrix, we have


     
1 2 3 1 2 3 1 2 3
→ =
4 -1 2 -4(1)+4 -4(2)-1 -4(3)+2 0 -9 -10

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 7 / 32


Example
Apply
 the row operation −3r1 + r2 to the augmented matrix
1 -2 2
3 -5 9

Solution

     
1 -2 2 1 -2 3 1 -2 2
→ =
3 -5 9 -3(1)+3 -3(-2)-5 -3(2)+9 0 1 3

For us now to solve a system of linear equations using row operations, we


use row operations on the augmented matrix of the system to obtain a
matrix in row echelon form.

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 8 / 32


A matrix is in row echelon form when the following three conditions are
satisfied:
(a) The entry in row 1 and column 1 is 1, and only 0’s appear below it.
(b) The first nonzero entry in each row after the first is a 1, only 0’s
appear below it, and the 1 appears to the right of the first nonzero
entry in any row above.
(c) Any rows that contain 0’s to the left of the vertical bar appear at the
bottom.
If in addition, the leading 1 in each row is the only non zero element in its
column, the matrix is called a reduced row echelon matrix.

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 9 / 32


Solution to a system of m equations in n unknowns(variables)
(a) Write down the augmented matrix.
(b) Use elementary row operations to reduce to row echelon form/reduced
row echelon form.
(c) Each non-zero has a leading 1 and to each leading 1 corresponds a
basic variable (use back-substitution to get your solutions).

If the augmented matrix is a row echelon form, then the type of solving
the system of equations is called Gaussian elimination. If the augmented
matrix is reduced row echelon form, then the method is called
Gauss-Jordan elimination.

Let us now consider the two individual cases of the above methods:
Case 1
If [A|B] has a row of the form (0, 0, 0, 0|bj ) where bj 6= 0, the reduced
system then the original system has no solutions. The equations are said
to be inconsistent.
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 10 / 32
Case 2
If [A|B] has no such rows, the equations are consistent and have solutions:

(i) If the number of basic variables n is equal to r where r is the rank of


a matrix(number of non-zero rows in echelon matrix), then there is a
unique solution.
(ii) If the number of basic variables n is greater than r where r is the
rank of matrix (number of non-zero rows in echelon matrix, there are
infinitely many solutions, since some variables can be given arbitrary
value.

Example
Solve the following simultaneous equations by elementary row operation
method
(a) 4x + 5y = 2 and 2x + 3y = 0
(b) 8x + 5y + 11z = 30, −x − 4y + 2z = 3 and 2x − y + 5z = 12

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 11 / 32


Solution
(a)

4x + 5y = 2
2x + 3y = 0

Its
 augmented
 matrix is
4 5 2
2 3 0
 
1 5/4 1/2 r1
4 → r1
2 3 0
 
1 5/4 1/2
−2r1 + r2 → r2
0 1/2 -1
 
1 5/4 1/2
2r2 → r2
0 1 -2

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 12 / 32


The matrix is now said to be in echelon form and it is equivalent to the
system
5 1
x + y = · · · (i)
4 2
y = −2 · · · (ii)

Substituting −2 for y in (1) we get

5 1
x+ × (−2) =
4 2
1 5
x= +
2 2
x =3

Therefore x = 3 and y = −2

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 13 / 32


 
1 5/4 1/2
We can also reduce to reduced row echelon form as
0 1/2 -1
follows
 
1 0 3
− 45 r2 + r1 → r1
0 1 -2
The matrix is now said to be in echelon form. Its equivalent to the system
is

x = 3 · · · (i)
y = −2 · · · (ii)

(b)

8x + 5y + 11z = 30
−x − 4y + 2z = 3
2x − y + 5z = 12

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 14 / 32


The
 augmented matrix
 is
8 5 11 30
 -1 -4 2 3 
2 -1 5 12
 
-1 -4 2 3
 8 5 11 30  r1 ↔ r2
2 -1 5 12
 
1 4 -2 -3
 8 5 11 30  −r1 → r2
2 -1 5 12
 
1 4 -2 -3
 0 -27 27 54  −8r1 + r2 → r2 and −2r1 + r3 → r3
0 -9 9 18

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 15 / 32


 
1 4 -2 -3
1
 0 1 -1 -2  − 27 r2 → r2
0 -9 9 18
 
1 4 -2 -3
 0 1 -1 -2  9r2 + r3 → r3
0 0 0 0
This is equivalent to the system of equations

x + 4y − 2z = −3 · · · (1)
y − z = −2 · · · (2)

The system has infinitely many solutions because the last row has 0’s. Let
z =s
Substituting s for z in (2) we get,

y − s = −2
y = −2 + s

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 16 / 32


Substituting s for z and −2 + s in (1) we have

x + 4(−2 + s) − 2s = −3
x = −4(−2 + s) + 2s − 3
x = 5 − 2s

Therefore, the solutions are

x = 5 − 2s, y = −2 + s and z = s or
     
x 5 −2
y  = −2 + s  1 
z 0 1

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 17 / 32


Solutions of Linear Systems of Equations by Inverse Matrix
Method
Definition
The inverse matrix method uses the inverse of a matrix to help solve a
system of equations, of the form Ax = b. By pre-multiplying both sides of
this equation by A−1 we get the following:

A−1 (Ax) = A−1 b

(A−1 A)x = A−1 b


or alternatively

x = A−1 b (since A−1 A = I and I x = x)

So by calculating the inverse of the matrix and multiplying this by the


vector b we can find the solution to the system of equations directly. And
adj(A)
from earlier we found that the inverse is given by: A−1 = det(A)
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 18 / 32
Example
Solve the following simultaneous equations using the inverse of matrix
method.

4x + 5y = 2
2x + 3y = 0

Solution
In matrix form, we can rewrite the simultaneous equations as
    
4 5 x 2
=
2 3 y 0
   −1  
x 4 5 2
=⇒ =
y 2 3 0
   
4 5 2
Let A = and b = .
2 3 0
So, |A| = 12 − 10 = 2.
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 19 / 32
But
 
−1 1 c −b
A =
|A| −c d
  3
− 52
 
1 3 −5
= = 2
2 −2 4 −1 2

And
 
x
= A−1 b
y
 3
− 52 2
 
= 2
−1 2 0
   
3+0 3
= =
−2 + 0 −2

Therefore, x = 3 and y = −2.


(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 20 / 32
Example
Solve the following system of equations using the inverse matrix.

2x + y − 3z = −4
4x − 2y + z = 9
3x + 5y − 2z = 5

Solution
In
 matrix form,
 wecan rewrite
 the system of equations as
2 1 −3 x −4
4 −2 1  y  =  9 
3 5 −2 z 5
   
2 1 −3 −4
Hence, A = 4 −2
 1 and b =
  9
3 5 −2 5

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 21 / 32


|A| = 2(4 − 5) − 1(−8 − 3) − 3(20 + 6)
= 2(−1) − 1(−11) − 3(26)
= −2 + 11 − 78
= −69 (The inverse exists since |A| =
6 0)

Now, the cofactors of A are


−2 1
C11 = (−1)1+1 = +1(4 − 5) = −1
5 −2
4 1
C12 = (−1)1+2 = −1(−8 − 3) = 11
3 −2
4 −2
C13 = (−1)1+3 = +1(20 + 6) = 26
3 5

C21 = −13, C22 = 5, C23 = −7


C31 = −5, C32 = −14, C33 = −8
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 22 / 32
 
−1 11 26
Therefore, the matrix of co-factors is −13 5 −7 .
−5 −14 −8
 
−1 −13 −5
This means that the Adjoint of A is  11 5 −14 . But
26 −7 −8

adj(A)
A−1 =
det(A)
 
−1 −13 −5
1 
= 11 5 −14
87
26 −7 −8
 −1 −13 −5 
−69 −69 −69
 
−14 
 11 5

=
 −69 −69 −69 
 
26 −7 −8
−69 −59 −69

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 23 / 32


Now,

x = A−1 b
 −1 −13 −5 
−69 −69 −69  
  −4
−14  
 11 5

=
 −69 −69 −69  9
  5
26 −7 −8
−69 −59 −69
−1
× −4 + −13 ×9+ −5
×5
 
−69 −69 69
 
−14
 11 5

 −69 × −4 +
= −69 ×9+ −69 × 5

 
26 −7 −8
−69 × −4 + −69 ×9+ −69 ×5
 
2
= 1
3

Therefore, x = 2, y = 1 and z = 3
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 24 / 32
Solutions of Linear Systems of Equations by Cramer’s rule
Method

Cramer’s rule is an interesting application of determinants for solving


systems of linear equations. This rule can be used to calculate solutions of
simultaneous equations. This method is primarily useful only when the
matrix is of small order and it is a square matrix.
Definition
Let A be an n × n matrix. The system of equations

AX = B

has a unique solution if and only if det(A) 6= 0. The solution can be


calculated in that case as follows. Let Ak be the matrix obtained by
replacing column k of A by the column matrix B. Then

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 25 / 32


detA1
x1 =
det(A)
detA2
x2 =
det(A)
..
.
detAn
xn =
det(A)

Example
Solve the following equations simultaneously by Cramers rule;

3x + y = 1
x + 2y = 2

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 26 / 32


Solution
In matrix
   form,
  we  have
3 1 x 1
=
1 2 y 2
   
3 1 1
So A = , So |A| = 6 − 1 = 5, B =
1 2 2
 
1 1
A1 = , det(A1 ) = 2 − 2 = 0
2 2
 
3 1
A2 = , det(A2 ) = 6 − 1 = 5
1 2
|A1 | 0
x = = =0
|A| 5
|A2 | 5
y = = =1
|A| 5

Therefore, x = 0 and y = 1

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 27 / 32


Remark
Note that matrices A1 and A2 in the above example are obtained as
follows:
A1 : Replace the first column of matrix A with
 the column of entries
1
on the right side of the system, that is, but keep the second
2
column of matrix A as it is.
A2 : Replace the second column of matrix A with the column of
entries on the right side of the system but keep the first column of
matrix A as it is.

This way of writing the matrices (when using Cramer’s rule) applies to any
n × n matrix as shown in the next Example.

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 28 / 32


Example
Solve the following simultaneous equations using Cramer’s rule method.

2x + y − 3z = −4
4x − 2y + z = 9
3x + 5y − 2z = 5

Solution
In
 matrix form,
 wecan rewrite
 the simultaneous equations as
2 1 −3 x −4
4 −2 1  y  =  9 
3 5 −2 z 5
   
2 1 −3 −4
Hence A = 4 −2
 1 and b =
  9
3 5 −2 5

|A| = 2(4 − 5) − 1(−8 − 3) − 3(20 + 6)


= 2(−1) − 1(−11) − 3(26) = −2 + 11 − 78 = −69
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 29 / 32
 
−4 1 −3
A1 =  9 −2 1  and
5 5 −2
|A1 | = −4(4 − 5) − 1(−18 − 5) − 3(45 + 10). So |A1 | = −138
 
2 −4 −3
A2 = 4 9 1  and
3 5 −2
|A2 | = 2(−18 − 5) + 4(−8 − 3) − 3(20 − 27). So |A2 | = −69
 
2 1 −4
A3 = A = 4 −2 9  and
3 5 5
|A3 | = 2(−10 − 45) − 1(20 − 27) − 4(20 + 6). So |A3 | = −207

But
detA1 −138
x= =
detA −69
(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 30 / 32
Conclusion

(a) In this lesson, we have learnt how we can solve systems of linear
equations using the following methods:
Row operations.
Inverse matrix, and
Cramer’s rule.
(b) In case you have questions about this lesson, please do not hesitate to
ask us using the forum on this platform and we will be glad to address
them.
(c) It is our hope that you found this lesson interesting. The next activity
before starting the second topic which is ‘Vector Calculus’ is a Tutorial
which we are going to give you towards the end of this week.
(d) We wish you the best of luck. Stay safe. COVID-19 is real!

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 31 / 32


END OF LECTURE 4

THANK YOU!

(Maliyoni & Malipa, MUST) MATH-224 Lecture 4 2019/2020 Academic Year 32 / 32

You might also like