Solving a system of linear equations Math 304

advertisement
Solving a system of linear equations
An example
Solve the system of simultaneous equations
Math 304
x x + x = 9
2x + 3x + 10x = 3
3x
5x
16x = 5
Geometric interpretation: nd the intersection points of three
planes in three-dimensional space R .
Linear Algebra
Harold P. Boas
boas@tamu.edu
1
2
3
1
2
3
1
2
3
3
In principle, there might be no solution (parallel planes) or
exactly one solution (the planes intersect in one point) or
innitely many solutions (the planes intersect in a line).
May 30, 2006
Solution strategy: replace the system by a simpler equivalent
system with the same solution(s).
Solving a system of linear equations
Solving a system of linear equations
An example
An example
x
2x
3x
1
1
1
x
+ 3x
5x
2
2
2
x
+ 10x
16x
+
3
=
9
3
=
3
3
=
5
Add 2 times the rst equation to the second equation to get the
equivalent system
x
1
3x1
x
x
5x
2
2
2
x
+ 12x
16x
+
3
=
9
3
=
21
3
=
5
x
1
3x1
x
x
5x
2
2
2
x
+ 12x
16x
+
3
=
9
3
=
21
3
=
5
Add 3 times the rst equation to the third equation to get the
equivalent system
x
1
x
x
2x
2
2
2
x
+ 12x
19x
+
3
=
9
3
=
21
3
=
32
Solving a system of linear equations
Solving a system of linear equations
An example
An example
x
x
x
2x
1
2
2
2
x
+ 12x
19x
+
3
=
9
3
=
21
3
=
32
Add 2 times the second equation to the third equation to get the
equivalent system
x
1
x
x
2
2
x
+ 12x
5x
+
3
=
9
3
=
21
3
=
10
x
1
x
x
2
2
x
+ 12x
5x
+
3
=
9
3
=
21
3
=
10
Divide the third equation by 5 to get the equivalent system
x
1
x
x
2
2
x
+ 12x
x
+
3
=
9
3
=
21
3
=
2
Solving a system of linear equations
Solving a system of linear equations
An example
An example
x
1
x
x
2
2
x
+ 12x
x
+
3
=
9
3
=
21
3
=
2
Take the value x3 = 2 from the third equation and back
substitute in the second equation to get x2 = 3.
Then back substitute in the rst equation to get x1 = 4.
Thus our system of equations has a unique solution
(x1 ; x2 ; x3 ) = (4; 3; 2).
Final check: verify that the values (x1 ; x2 ; x3 ) = (4; 3; 2) do
work in all three of the original equations
x
2x
3x
It checks; we are done.
1
1
1
x
+ 3x
5x
2
2
2
x
+ 10x
16x
+
3
=
9
3
=
3
3
=
5
Solving a system of linear equations
Solving a system of linear equations
Reinterpretation
Reinterpretation
In the preceding calculation, the variables x1 , x2 , x3 acted
essentially as placeholders. Instead of working with the system
x
2x
3x
1
1
1
x
+ 3x
5x
2
2
2
x
+ 10x
16x
+
3
=
9
3
=
3
3
=
5
we could work with the coefcient matrix
0
@
1
2
3
1
3
5
1
10
16
1
9
3A
5
The allowed elementary row operations on matrices are:
I add a multiple of a row to another row
I multiply (or divide) a row by a nonzero number
I interchange two rows
The process of using these operations to reduce a matrix to
echelon (stair-step) form is called Gaussian elimination.
An example of Gaussian elimination
An example of Gaussian elimination
Exercise 5(l) on page 26
Exercise 5(l) on page 26
Solve
x
2x
x
5x
1
1
1
1
3x2 +
x
+ x
x
+ 4x
2x
8x + 2x
3
=
1
2
3
=
2
2
3
=
1
2
3
=
5
The corresponding matrix is
0
1
B2
B
@1
5
3
1
4
8
1
1 1
1 2C
C
2 1A
25
0
1
1
1
0
1
B2
B
@1
5
3
1
4
8
1 1
1 2C
R
C 2
A
21
25
1
B0
2R1
!B
@1
5
1
B
R3 R1 B0
! @0
5
3
7
7
8
1 1
3 0C
R4
C
3 0A
25
1
B
0
5R1
!B
@0
0
1
B
R3 R2 B0
!
R4 R2 @0
0
3
7
0
0
1
1 1
C
B
3 0C R2 =7 B0
! @0
0 0A
00
0
0
0
3
7
4
8
0
0
3
7
7
7
3
1
0
0
1
1 1
3 0C
C
2 1A
25
1
1 1
3 0C
C
3 0A
30
1
1 1
3 0C
7 C
0 0A
00
An example of Gaussian elimination
An example of Gaussian elimination
Exercise 5(l) on page 26
Exercise 5(l) on page 26
0
1
B0
B
@0
0
3
1
0
0
0
1
1
B0
B
@0
0
1 1
3 0C
7 C
0 0A
00
Interpretation:
The variable x3 is a free variable whose value can be
prescribed arbitrarily; then the values of x1 and x2 are
determined. The original system of equations has innitely
many solutions.
To write the solutions, it is convenient to do an extra step to
bring the system to reduced row echelon form (Gauss-Jordan
reduction).
An example of Gaussian elimination
Exercise 5(l) on page 26
In the computer program MATLAB, the following code
produces the reduced row echelon form of the preceding
example:
Remark:
format rat;
A=[1 -3 1 1; 2 1 -1 2; 1 4 -2 1; 5 -8 2 5];
rref(A)
MATLAB's output is:
1
0
0
0
0
1
0
0
-2/7
-3/7
0
0
0
0
1
0
3
1
0
0
1
1 1
3 0C
R1 +3R2
7 C
!
0 0A
00
0
1
B0
B
@0
0
Now you can read off the solution
x
x
x
1
2
3
=
=
1+
3
7
x
2
7
x
3
3
arbitrary
The solution set represents a line in R 3 .
0
1
0
0
1
1
0C
C
7
0 0A
0 0
2
7
3
Download