Systems of Linear Equations

Systems of Linear Equations DEFINITION: A linear equation in the variables x1 , . . . , xn is an equation that can be written in the form a1 x1 + . . ...
Author: Neil Long
37 downloads 4 Views 4MB Size
Systems of Linear Equations DEFINITION: A linear equation in the variables x1 , . . . , xn is an equation that can be written in the form a1 x1 + . . . + an xn = b, where a1 , . . . , an and b are constants, x1 , . . . , xn are variables. EXAMPLE: The equation 2x1 + x2 − 7x3 =



5

is linear. The equation 3x1 x2 + 2x23 = 1 is NOT linear. DEFINITION: A system of linear equations (or a linear system) is a collection of one or more linear equations. EXAMPLE:

  3x1 + 2x2 + 7x3 − x4 = 6 x1 + x2 − x3 + x4 = 1  4x1 + 3x2 + 6x3 = 8

Solving a Linear System in Two Variables EXAMPLE: Solve the following system of linear equations:  x1 −2x2 = −1 −x1 +3x2 = 3 Solution: We have

 

x1 −2x2 = −1 −x1 +3x2 = 3 ⇓

x1 −2x2 = −1 x2 = 2 



x1 = 3 x2 = 2

1

EXAMPLE: Solve the system of equations.

Solution: Begin by solving for in Equation 1.

Next, substitute this expression for y into Equation 2 and solve the resulting single-variable equation for x.

Finally, you can solve for by back-substituting x = 3 into the equation y = 4 − x, to obtain

The solution is the ordered pair (3, 1). You can check this solution as follows.

2

EXAMPLE: Solve the system of equations.

Solution: You can eliminate the y-terms by adding the two equations.

So, x =

3 12 = . By back-substituting into Equation 1, you can solve for y. 8 2

The solution is



 3 1 , − . You can check the solution algebraically by substituting into the original system. 2 4

3

EXAMPLE: Find all solutions of the system   2x + y = 1 

3x + 4y = 14

Solution 1(Substitution Method): We solve for y in the first equation. 2x + y = 1

y = 1 − 2x

⇐⇒

Now we substitute for y in the second equation and solve for x: 3x + 4y = 14 3x + 4(1 − 2x) = 14 3x + 4 − 8x = 14 −5x = 10 x = −2 Finally, we back-substitute x = −2 into the equation y = 1 − 2x: y = 1 − 2(−2) = 5 Solution 2(Elimination Method): We have    2x + y = 1  8x + 4y = 4 ⇐⇒   3x + 4y = 14 3x + 4y = 14

⇐⇒

  5x = −10 

3x + 4y = 14

⇐⇒

Next we substitute x = −2 into the equation 3x + 4y = 14: 3(−2) + 4y = 14

⇐⇒

−6 + 4y = 14

4

⇐⇒

4y = 20

⇐⇒

  x = −2 

3x + 4y = 14

y=5

EXAMPLE: Find all solutions of the system   2x + 3y = −4 

5x − 7y = 1

Solution 1(Substitution Method): We solve for x in the first equation. 2x + 3y = −4

⇐⇒

2x = −4 − 3y

x=−

⇐⇒

4 + 3y 2

Now we substitute for x in the second equation and solve for y: 5x − 7y = 1 −5

4 + 3y − 7y = 1 2

−5(4 + 3y) − 14y = 2 −20 − 15y − 14y = 2 −29y = 22 y=− Finally, we back-substitute y = −

22 29

4 + 3y 22 into the equation x = − : 29 2  4 + 3 − 22 25 29 x=− =− 2 29

Solution 2(Elimination Method): On the one hand, we have    10x + 15y = −20  2x + 3y = −4 =⇒ ⇐⇒   10x − 14y = 2 5x − 7y = 1 On the other hand, we have   2x + 3y = −4 

5x − 7y = 1

⇐⇒

  14x + 21y = −28 

=⇒

15x − 21y = 3

EXAMPLE: Find all solutions of the system  3 1 7    −5x + 2y = 2    1x + 4y = 3 3 5 2

5

29y = −22

⇐⇒

y=−

22 29

29x = −25

⇐⇒

x=−

25 29

EXAMPLE: Find all solutions of the system  1 7 3    −5x + 2y = 2    1x + 4y = 3 3 5 2

Solution (Elimination Method): We have   1 7 3    −5x + 2y = 2  −6x + 5y = 35 ⇐⇒    10x + 24y = 45  1x + 4y = 3 3 5 2 On the one hand, we have    −6x + 5y = 35  −30x + 25y = 175 ⇐⇒ =⇒ 97y = 310   10x + 24y = 45 30x + 72y = 135 On the other hand, we have   −6x + 5y = 35 ⇐⇒  10x + 24y = 45

  −144x + 120y = 840 

50x + 120y = 225

=⇒

−194x = 615

⇐⇒

⇐⇒

y=

310 97

x=−

615 194

EXAMPLE: Solve the system of linear equations

Solution: Because the coefficients in this system have two decimal places, you can begin by multiplying each equation by 100 to produce a system with integer coefficients.

Now, to obtain coefficients that differ only by sign, multiply revised Equation 1 by 3 and multiply revised equation 2 by -2.

So, you can conclude that y = the following.

−322 = 14. Back-substitution this value into revised Equation 2 produces −23

6

EXAMPLE: Find all solutions of the system   x+y =1 

Answer: No solution.

x+y =2

EXAMPLE: Find all solutions of the system   3x − 2y = 4 

Solution: We have

−6x + 4y = 7

  3x − 2y = 4

⇐⇒

   3x − 2y = 4

  3x − 2y = − 7 2 It follows that the system has no solution (inconsistent). 

−6x + 4y = 7

EXAMPLE: Find all solutions of the system   x+y =1 

x+y =1

Answer: The system has infinitely many solutions (dependent). EXAMPLE: Find all solutions of the system   8x − 2y = −4 Solution: We have



  8x − 2y = −4 

−4x + y = 2

−4x + y = 2

⇐⇒

  8x − 2y = −4 

8x − 2y = −4

It follows that the system has infinitely many solutions (dependent).

7

Larger Systems of Linear Equations EXAMPLE: Solve the system of linear equations.

Solution: From Equation 3, you know the value z. To solve for y, substitute z = 2 into Equation 2 to obtain

Finally, substitute y = −1 and z = 2 into Equation 1 to obtain

The solution is x = 1, y = −1 and z = 2. EXAMPLE: Solve the system of linear equations.

Solution: Because the leading coefficient of the first equation is 1, you can begin by saving the x at the upper left and eliminating the other x-terms from the first column.

Now that all but the first x have been eliminated from the first column, go to work on the second column. (You need to eliminate y from the third equation.)

Finally, you need a coefficient of 1 for z in the third equation.

This is the same system that was solved in Example 1. As in that example, you can conclude that the solution is x = 1, y = −1, and z = 2. 8

EXAMPLE: Find all solutions of the system  2x − y + 3z = 1   x − 2y + z = 1   2x − 3y − z = 2

Solution (Elimination Method): We have   2x − y + 3z = 1 2x − y + 3z = 1     2x − 4y + 2z = 2 x − 2y + z = 1 ⇐⇒     2x − 3y − z = 2 2x − 3y − z = 2

therefore

 2x − y + 3z = 1   −12y − 4z = 4   10y = −3 so

 2x − y + 3z = 1     −12y − 4z = 4 ⇐⇒     y=−3 10

 2x − y + 3z = 1   −3y − z = 1 ⇐⇒   −2y − 4z = 1

 2x − y + 3z = 1   −12y − 4z = 4 ⇐⇒   −2y − 4z = 1

 2x − y + 3z = 1        3 − 4z = 4 −12 − ⇐⇒ 10      y=−3 10

     3 1   2x − − +3 − =1    10 10  1 z = −  10      y=−3 10

EXAMPLE: Solve the system of linear equations.

⇐⇒

 1  x=    2  1 z=−  10     y=−3 10

  2x − y + 3z = 1     1 z=− ⇐⇒ 10    3   y=− 10

Solution:

Because 0 = −2 is false statement, you can conclude that this system is inconsistent and so has no solution. Moreover, because this system is equivalent to the original system, you can conclude that the original system also has no solution. 9

EXAMPLE: Solve the system of linear equations.

Solution:

This result means that Equation 3 depends on Equations 1 and 2 in the sense that it gives us no additional information about the variables. So, the original system is equivalent to the system ( x + y − 3z = −1 y−z =0

In the last equation, solve for y in terms of z to obtain y = z. Back-substituting y = z in the first equation produces x = 2z − 1. Finally, letting z = a, where a is a real number, the solutions to the given system are all of the form x = 2a − 1, y = a, and z = a

So, every ordered triple of the form (2a − 1, a, a) is a solution of the system.

10

The Augmented Matrix of a Linear System We can write a system of linear equations as a matrix, called the augmented matrix of the system, by writing only the coefficients and constants that appear in the equations. Here is an example.

The next Example demonstrates the elementary row operations described above. EXAMPLE: (a) Add −2 times the first row of the original matrix to the third row.

(b) Multiply the first row of the original matrix by

1 . 2

(c) Interchange the first and second rows of the original matrix.

11

EXAMPLE: Solve the system of linear equations.  x − y + 3z = 4   x + 2y − 2z = 10   3x − y + 5z = 14

Solution: Our goal is to eliminate the x-term from the second equation and the x- and y-terms from the third equation. For comparison, we write both the system of equations and its augmented matrix.

Now we use back-substitution to find that z =3

y − 2z = 1

x − y + 3z = 4

y − 2(3) = 1

x − 7 + 3(3) = 4

y−6 =1

x+2 =4

y =7

x=2

The solution is (2, 7, 3). EXAMPLE: Solve the system of linear equations.  x − 2y + 3z = 9   −x + 3y + z = −2   2x − 5y + 5z = 17

12

EXAMPLE: Solve the system of linear equations.  x − 2y + 3z = 9   −x + 3y + z = −2   2x − 5y + 5z = 17

Solution:

Now we use back-substitution to find that z =2

y + 4z = 7

x − 2y + 3z = 9

y + 4(2) = 7

x − 2(−1) + 3(2) = 9

y+8 =7

x+8 =9

y = −1 The solution is (1, −1, 2).

13

x=1

EXAMPLE: Show that the following system has no solutions.  x − 3y + 2z = 12   2x − 5y + 5z = 14   x − 2y + 3z = 20

Solution: We have

Now if we translate the last row back into equation form, we get 0x + 0y + 0z = 1, or 0 = 1, which is false. No matter what values we pick for x, y, and z, the last equation will never be a true statement. This means the system has no solution. EXAMPLE: Show that the following system has infinitely many solutions.  −3x − 5y + 36z = 10   −x + 7z = 5   x + y − 10z = −4 Solution: We have

The third row corresponds to the equation 0 = 0. This equation is always true, no matter what values are used for x, y, and z. The complete solution of this system will be discussed in the next section.

14

Gaussian Elimination In general, to solve a system of linear equations using its augmented matrix, we use elementary row operations to arrive at a matrix in a certain form. This form is described in the following box.

In the following matrices the first matrix is in reduced row-echelon form, but the second one is just in row-echelon form. The third matrix is not in row-echelon form. The entries in red are the leading entries.

15

EXAMPLE: Solve the system of linear equations using Gaussian elimination.  4x + 8y − 4z = 4   3x + 8y + 5z = −11   −2x + y + 12z = −17

Solution: We first write the augmented matrix of the system, and then use elementary row operations to put it in row-echelon form.

We now have an equivalent matrix in row-echelon form, and the corresponding system of equations is  x + 2y − z = 1   y + 4z = −7   z = −2

We use back-substitution to solve the system.

So the solution of the system is (−3, 1, −2). 16

Gauss-Jordan Elimination If we put the augmented matrix of a linear system in reduced row-echelon form, then we don’t need to back-substitute to solve the system. To put a matrix in reduced row-echelon form, we use the following steps. • Use the elementary row operations to put the matrix in row-echelon form. • Obtain zeros above each leading entry by adding multiples of the row containing that entry to the rows above it. Begin with the last leading entry and work up.

The following matrices are in reduced row-echelon form.

Using the reduced row-echelon form to solve a system is called Gauss-Jordan elimination. We illustrate this process in the next example. EXAMPLE: Solve the system of linear equations, using Gauss-Jordan elimination.    4x + 8y − 4z = 4 3x + 8y + 5z = −11   −2x + y + 12z = −17 Solution: In the previous Example we used Gaussian elimination on the augmented matrix of this system to arrive at an equivalent matrix in row-echelon form. We continue using elementary row operations on the last matrix in that Example to arrive at an equivalent matrix in reduced row-echelon form.

Wenow have an equivalent matrix in reduced row-echelon form, and the corresponding system of equations   x = −3 y = 1 . Hence we immediately arrive at the solution (−3, 1, −2). is   z = −2 17

Inconsistent and Dependent Systems

The matrices below, all in row-echelon form, illustrate the three cases described in the box.

EXAMPLE: Solve the system.  x − 3y + 2z = 12   2x − 5y + 5z = 14   x − 2y + 3z = 20

Solution: We transform the system into row-echelon form.

This last matrix is in row-echelon form, so we can stop the Gaussian elimination process. Now if we translate the last row back into equation form, we get 0x + 0y + 0z = 1, or 0 = 1, which is false. No matter what values we pick for x, y, and z, the last equation will never be a true statement. This means the system has no solution. 18

EXAMPLE: Find the complete solution of the system.  −3x − 5y + 36z = 10   −x + 7z = 5   x + y − 10z = −4

Solution: We transform the system into reduced row-echelon form.

The third row corresponds to the equation 0 = 0. This equation is always true, no matter what values are used for x, y, and z. Since the equation adds no new information about the variables, we can drop it from the system. So the last matrix corresponds to the system

Now we solve for the leading variables x and y in terms of the non-leading variable z:

To obtain the complete solution, we let t represent any real number, and we express x, y, and z in terms of t:  x = 7t − 5   y = 3t + 1   z=t

We can also write the solution as the ordered triple (7t − 5, 3t + 1, t), where t is any real number. EXAMPLE: Find the complete solution of the system.  x + 2y − 3z − 4w = 10   x + 3y − 3z − 4w = 15   2x + 2y − 6z − 8w = 10 19

EXAMPLE: Find the complete solution of the system.  x + 2y − 3z − 4w = 10   x + 3y − 3z − 4w = 15   2x + 2y − 6z − 8w = 10

Solution: We transform the system into reduced row-echelon form.

This is in reduced row-echelon form. Since the last row represents the equation 0 = 0, we may discard it. So the last matrix corresponds to the system

To obtain the complete solution, we solve for the leading variables x and y in terms of the non-leading variables z and w, and we let z and w be any real numbers. Thus, the complete solution is  x = 3s + 4t      y=5  z=s     w=t

where s and t are any real numbers. We can also express the answer as the ordered quadruple (3s+4t, 5, s, t).

20

Appendix EXAMPLE: Solve the system of linear equations.

Solution: To put this in triangular form, we begin by eliminating the x-terms from the second equation and the third equation.

Now we eliminate the y-term from the third equation.

The new third equation is true, but it gives us no new information, so we can drop it from the system. Only two equations are left. We can use them to solve for x and y in terms of z, but z can take on any value, so there are infinitely many solutions. To find the complete solution of the system we begin by solving for y in terms of z, using the new second equation.

Then we solve for x in terms of z, using the first equation.

To describe the complete solution, we let t represent any real number. The solution is x = −3t y = 2t + 2 z=t We can also write this as the ordered triple (−3t, 2t + 2, t). 21

EXAMPLE: Solve the system. (

3x1 + 4x2 = 1 x1 − 2x2 = 7

Solution: We start by writing the augmented matrix corresponding to system: " # 3 4 1 1

–2

7

To get a 1 in the upper left corner, we interchange R1 and R2 :

To get a 0 in the lower left corner, we multiply R1 by −3 and add to R2 — this changes R2 but not R1 . Some people find it useful to write (−3R1 outside the matrix to help reduce errors in arithmetic, as shown:

To get a 1 in the second row, second column, we multiply R2 by

1 : 10

To get a 0 in the first row, second column, we multiply R2 by 2 and add the result to R1 — this changes R1 but not R2 :

We have accomplished our objective. The last matrix is the augmented matrix for the system ( x1 = 3 x2 = 5

The preceding process may be written more compactly as follows:

22

EXAMPLE: Solve by Gauss-Jordan elimination:  2x − 2x2 + x3 = 3   1 3x1 + x2 − x3 = 7   x1 − 3x2 + 2x3 = 0

Solution: Write the augmented matrix and follow the steps indicated at the right.

The solution to this system is x1 = 2, x2 = 0, x3 = −1.

23

EXAMPLE: Solve the system. (

2x1 + 6x2 = −3

x1 + 3x2 = 2

Solution:

This is the augmented matrix of the system (

x1 + 3x2 = 2 0 = −7

The second equation is not satisfied by any ordered pair of real numbers. Therefore the original system is inconsistent and has no solution. EXAMPLE: Solve by Gauss-Jordan elimination:  2x − 4x2 + x3 = −4   1 4x1 − 8x2 + 7x3 = 2   −2x1 + 4x2 − 3x3 = 5 Solution:

The system has no solution. 24

EXAMPLE: Solve by Gauss-Jordan elimination:  3x + 6x2 − 9x3 = 15   1 2x1 + 4x2 − 6x3 = 10   −2x1 − 3x2 + 4x3 = −6

Solution:

Note that the leftmost variable in each equation appears in one and only one equation. We solve for the leftmost variables x1 and x2 in terms of the remaining variable, x3 : ( x1 = −x3 − 3 x2 = 2x3 + 4

If we let x3 = t, then for any real number t,  x = −t − 3   1 x2 = 2t + 4   x+3=t

One can check that (−t − 3, 2t + 4, t) is a solution of the original system for any real number t. 25

EXAMPLE: Find the complete solution of the system.  y + z − 2w = −3      x + 2y − z = 2  2x + 4y + z − 3w = −2     x − 4y − 7z − w = −19 Solution:

The matrix is now in row-echelon form, and the corresponding system is  x + 2y − z = 2      y + z − 2w = −3  z − w = −2     w=3

Using back-substitution, you can determine that the solution is x = −1, y = 2, z = 1, and w = 3.

26