HOME

David Terr
Ph.D. Math, UC Berkeley

 

Home >> Pre-Calculus >> 7. Systems of Equations and Inequalities

>> 7.2. Systems of Linear Equations in Three Variables

 

7.1. Systems of Linear Equations in Two Variables

In Section P.9 we briefly explained how to solve linear equations in two or more variables. For two variables, we used two methods, substitution and cross-multiplication. In this section, we elaborate on these methods and describe a more systematic way to solve these systems.

Let us look back at the example we gave in Section P.9, which asked us to solve the following system of linear equations:

3x + 4y = 11
2x + 3y = 8

To simplify the problem, we may represent this system of linear equations by an array of numbers, known as a matrix. We will have much more to say about matrices in the following chapter, but for now, just think of them as a shorthand notation for representing a system of linear equations, such as the one above. We write down the coefficents of x, y, and the constant term of each equation in the corresponding row of the matrix and separate the column on the right with a partition. Thus, our system of equations is now represented by the following matrix:

equations matrix 1

Let us concentrate on Solution 2 from that section, which applied cross-multiplication. Recall that we multiplied the first equation by 2 and the second equation by 3 and then subtracted the first equation from the second in order to eliminate x. We will do that again, this time using our matrix notation. Multiplying the first equation (corresponding to the first row of the matrix) by 2 yields the following matrix:

equations matrix 2

Now multiplying the second equation (corresponding to the second row of the matrix) by -3 yields the following:

equations matrix 3

Subtracting the first row, corresponding to the second equation, from the second yields the following:

equations matrix 4

Note that we now have a row of the matrix starting on the left with a zero and a one. This is exactly what we need in order to solve for the second variable, y. To better see what is going on, we rewrite this matrix as a system of linear equations as follows:

6x + 8y = 22
0x + 1y = 2

Note that the second equations simplifies to y = 2. Thus, we have solved for y. Now we could substitute this value for y into the first equation to solve for x as we did in Section P.9, but there is a better way to solve for x, continuing with the method we are using. Subtracting eight times the second row of the last matrix we wrote down from the first yields the following matrix:

equations matrix 5

Our final operation, which will yield x, is to divide the first equation by 6, resulting in the matrix

equations matrix 6

Now note that we have a one and a zero in the first row. This means we have solved for the first variable, x, as well. The nice thing about representing our equations this way is that now me can merely read off the solutions to both variables by looking at the right column, consisting of a 1 followed by a 2. This means the solution to our system of equations is x = 1; y = 2.

Note that we have performed the first two of the following three kinds of operations on the matrix rows:

  1. Multiplying (or dividing) a row by a nonzero constant.
  2. Adding or subtracting a multiple of a row to another row.
  3. Swapping a pair of rows (in this case, just the first and second row).

These are in fact the only allowed operations on matrix rows. These three operations are known as elementary row operations. We will have more to say about them in the following chapter.

The strategy for solving arbitary systems of two linear equations in two variables is now clear. We first represent our system of linear equations as a matrix. Then we apply elementary row operations one at a time until we arrive at a matrix with the first row starting with 1 followed by 0 and the second with 0 followed by 1. Finally, we read off the solutions to the variables in the rightmost column.

It should be noted that there is no "right way" to apply elementary row operations - the strategy is just to do whatever works. There are some good strategies to follow, however. You may have noticed that we have been trying to get 1's in the leading column, because these can be later used as pivots to clear the corresponding entries in the other rows.

Let us try a few more examples.

 

Example 1: Solve the following system of linear equations:

7x + 12y = 9
15x - 8y = 53

Once again, we start by writing this system of equations as a matrix, obtaining the following:

example 1 matrix 1

Multiplying the first row by 2 yields the following:

example 1 matrix 2

Now subtracting the first row from the second yields

example 1 matrix 3

Subtracting 14 times the second row from the first now yields

example 1 matrix 4

Dividing the first equation by 472 now yields

example 1 matrix 5

Adding 32 times the second equation to the first yields

example 1 matrix 6

Finally, swapping the first and second rows yields

example 1 matrix 7

Now we are done, so we read off the solutions, namely x = 3; y = -1.

 

 

 

Example 2: Solve the following system of linear equations:

3x + 5y = 18
5x - 4y = 23

Solution: Our initial matrix looks as follows:

example 2 matrix 1

Multiplying the first row by 2 yields

example 2 matrix 2

Subtracting the second row from the first now yields

example 2 matrix 3

Subtracting five times the first row from the second yields

example 2 matrix 4

Dividing the second row by -74 yields

example 2 matrix 5

Finally, subtracting 14 times the second row from the first yields

example 2 matrix 6

From this completed matrix, we read of the solution: x = 187 / 37; y = 21 / 37.

 

All the examples we have seen thus far have a unique solution, but this is not always the case. Some systems of linear equations have no solutions. These systems are said to be inconsistent. Other systems have an infinite family of solutions. These systems are said to be dependent. The systems we have looked at thus far, with a single unique solution, are said to be independent. As it turns out, these are the only possibilities for any system of any number of linear equations. They always yield either no solutions, a single solution, or an infinite family of solutions. As we will see in Section 7.4, however, systems of nonlinear equations may have a finite number of solutions but more than one.

Below are two more examples of systems of two linear equations in two variables, one inconsistent and the other dependent.

 

Example 3: Solve the following system of linear equations:

2x + y = 6
6x + 3y = 20

Solution: We begin as before with a matrix, which looks as follows:

example 3 matrix 1

Next we multiply the first row by 3, resulting in the following matrix:

example 3 matrix 2

Next we subtract the first equation from the second, resulting in the following:

example 3 matrix 3

Now let us rewrite this matrix as a system of linear equations. We have

6x + 3y = 18
0x + 0y = 2

But when simplified, the second equation yields 0 = 2. How could we arrive at a false conclusion? The only way this can happen in mathematics is if we start with a false set of assumptions. Implicit in our initial set of equations was the assumption that they had a solution. Now we see that that assumption was false. In other words, this system of linear equations can has no solutions, i.e. it is inconsistent.

 

Example 3: Solve the following system of linear equations:

2x + y = 6
6x + 3y = 18

Note that this example is almost the same as the previous one, the only difference being the constant term on the right side of the second equation.

Solution: We begin as before, this time with the following matrix:

example 4 matrix 1

Once again, we multiply the first row by 3, resulting in the following matrix:

example 4 matrix 2

Next we subtract the first row from the second, yielding

example 4 matrix 3

Note that now we have a complete row of zeros, corresponding to the equation 0 = 0. While not inconsistent, this equation adds no information to our system, so we can ignore it from now on.

Our final step is to divide the first equation by 6, yielding the matrix

example 4 matrix 4

This is the best we can do with this system of equations. It is impossible to solve explicitly for x, since we can never make the second entry in the first row equal zero by applying the elementary row operations. Converting the first row back to an equation, we get the following:

x + 1/2 y = 3.

We see that we cannot solve explicitly for x, but that x depends on the second variable y. For this reason, our system is said to be dependent. The general solution is as follows:

x = 3 - 1/2 y
y = y

Thus, we have solved for both variables in terms of y.

 

Home >> Pre-Calculus >> 7. Systems of Equations and Inequalities

>> 7.2. Systems of Linear Equations in Three Variables