Solve Systems with Three Variables

We will further our study of systems of linear equations in this section by adding a variable. A linear function with three variables is similar to one with two, but the algebra used to solve them can get complex quickly. In this section, you will verify whether an ordered triple is a solution to a linear system with three variables and learn how to use elimination to find a solution.

Solving Systems of Three Equations in Three Variables

Learning Objectives

In this section, you will:

  • Solve systems of three equations in three variables.
  • Identify inconsistent systems of equations containing three variables.
  • Express the solution of a system of dependent equations containing three variables.


John received an inheritance of $12,000 that he divided into three parts and invested in three ways: in a money-market fund paying 3% annual interest; in municipal bonds paying 4% annual interest; and in mutual funds paying 7% annual interest. John invested $4,000 more in municipal funds than in municipal bonds. He earned $670 in interest the first year. How much did John invest in each type of fund?

Understanding the correct approach to setting up problems such as this one makes finding a solution a matter of following a pattern. We will solve this and similar problems involving three equations and three variables in this section. Doing so uses similar techniques as those used to solve systems of two equations in two variables. However, finding solutions to systems of three equations requires a bit more organization and a touch of visual gymnastics.


Solving Systems of Three Equations in Three Variables

In order to solve systems of equations in three variables, known as three-by-three systems, the primary tool we will be using is called Gaussian elimination, named after the prolific German mathematician Karl Friedrich Gauss. While there is no definitive order in which operations are to be performed, there are specific guidelines as to what type of moves can be made. We may number the equations to keep track of the steps we apply. The goal is to eliminate one variable at a time to achieve upper triangular form, the ideal form for a three-by-three system because it allows for straightforward back-substitution to find a solution (x,y,z), which we call an ordered triple. A system in upper triangular form looks like the following:

Ax+By+Cz=D

Ey+Fz=G

Hz=K

The third equation can be solved for z, and then we back-substitute to find y and x. To write the system in upper triangular form, we can perform the following operations:

  1. Interchange the order of any two equations.
  2. Multiply both sides of an equation by a nonzero constant.
  3. Add a nonzero multiple of one equation to another equation.

The solution set to a three-by-three system is an ordered triple \{(x,y,z)\}. Graphically, the ordered triple defines the point that is the intersection of three planes in space. You can visualize such an intersection by imagining any corner in a rectangular room. A corner is defined by three planes: two adjoining walls and the floor (or ceiling). Any point where two walls and the floor meet represents the intersection of three planes.


Number of Possible Solutions

Figure 2 and Figure 3 illustrate possible solution scenarios for three-by-three systems.

  • Systems that have a single solution are those which, after elimination, result in a solution set consisting of an ordered triple \{(x,y,z)\}. Graphically, the ordered triple defines a point that is the intersection of three planes in space.
  • Systems that have an infinite number of solutions are those which, after elimination, result in an expression that is always true, such as 0=0. Graphically, an infinite number of solutions represents a line or coincident plane that serves as the intersection of three planes in space.
  • Systems that have no solution are those that, after elimination, result in a statement that is a contradiction, such as 3=0. Graphically, a system with no solution is represented by three planes with no point in common.


Figure 2 (a)Three planes intersect at a single point, representing a three-by-three system with a single solution. (b) Three planes intersect in a line, representing a three-by-three system with infinite solutions.


Figure 3 All three figures represent three-by-three systems with no solution. (a) The three planes intersect with each other, but not at a common point. (b) Two of the planes are parallel and intersect with the third plane, but not with each other. (c) All three planes are parallel, so there is no point of intersection.


Example 1

Determining Whether an Ordered Triple Is a Solution to a System

Determine whether the ordered triple (3,−2,1) is a solution to the system.

x+y+z=2

6x−4y+5z=31

5x+2y+2z=13

Solution
We will check each equation by substituting in the values of the ordered triple for x,y, and z.

x+y+z=2

(3)+(−2)+(1)=2 True

6x−4y+5z=31

6(3)−4(−2)+5(1)=31

18+8+5=31 True

5x+2y+2z=13

5(3)+2(−2)+2(1)=13

15−4+2=13 True

The ordered triple (3,−2,1) is indeed a solution to the system.


How To

Given a linear system of three equations, solve for three unknowns.

  1. Pick any pair of equations and solve for one variable.
  2. Pick another pair of equations and solve for the same variable.
  3. You have created a system of two equations in two unknowns. Solve the resulting two-by-two system.
  4. Back-substitute known variables into any one of the original equations and solve for the missing variable.


Example 2

Solving a System of Three Equations in Three Variables by Elimination

Find a solution to the following system:

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

−x+3y−z=−6 (2)

2x−5y+5z=17 (3)

Solution

There will always be several choices as to where to begin, but the most obvious first step here is to eliminate x by adding equations (1) and (2).

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

−x+3y−z=−6 (2)

y+2z=3 (3)

The second step is multiplying equation (1) by −2 and adding the result to equation (3). These two steps will eliminate the variable x.

−2x+4y−6z=−18 (1) multiplied by−2

2x−5y+5z=17 (3)

−y−z=−1 (5)

In equations (4) and (5), we have created a new two-by-two system. We can solve for z by adding the two equations.

y+2z=3 (4)

−y−z=−1 (5)

z=2 (6)

Choosing one equation from each new system, we obtain the upper triangular form:

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

y+2z=3 (2)

z=2 (6)

Next, we back-substitute z=2 into equation (4) and solve for y.

y+2(2)=3

y+4=3

y=−1

Finally, we can back-substitute z=2 and y=−1 into equation (1). This will yield the solution for x.

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

x+2+6=9

x=1

The solution is the ordered triple (1,−1,2). See Figure 4.

Figure 4

Figure 4

Example 3

Solving a Real-World Problem Using a System of Three Equations in Three Variables

In the problem posed at the beginning of the section, John invested his inheritance of $12,000 in three different funds: part in a money-market fund paying 3% interest annually; part in municipal bonds paying 4% annually; and the rest in mutual funds paying 7% annually. John invested $4,000 more in mutual funds than he invested in municipal bonds. The total interest earned in one year was $670. How much did he invest in each type of fund?

Solution
To solve this problem, we use all of the information given and set up three equations. First, we assign a variable to each of the three investment amounts:

x = amount invested in money-market fund

y = amount invested in municipal bonds

z = amount invested in mutual funds

The first equation indicates that the sum of the three principal amounts is $12,000.

x+y+z=12,000

We form the second equation according to the information that John invested $4,000 more in mutual funds than he invested in municipal bonds.

z=y+4,000

The third equation shows that the total amount of interest earned from each fund equals $670.

0.03x+0.04y+0.07z=670

Then, we write the three equations as a system.

x+y+z=12,000

−y+z=4,000

2.03x+0.04y+0.07z=670

To make the calculations simpler, we can multiply the third equation by 100. Thus,

x+y+z=12,000 (1)

−y+z=4,000 (2)

3x+4y+7z=67,000 (3)

Step 1. Interchange equation (2) and equation (3) so that the two equations with three variables will line up.

x+y+z=12,000

3x+4y+7z=67,000

−y+z=4,000

Step 2. Multiply equation (1) by −3 and add to equation (2). Write the result as row 2.

x+y+z=12,000

y+4z=31,000

−y+z=4,000

Step 3. Add equation (2) to equation (3) and write the result as equation (3).

x+y+z=12,000

y+4z=31,000

5z=35,000

Step 4. Solve for z in equation (3). Back-substitute that value in equation (2) and solve for y. Then, back-substitute the values for z and y into equation (1) and solve for x.

5z=35,000
z=7,000

y+4(7,000)=31,000\
y=3,000

x+3,000+7,000=12,000
x=2,000

John invested $2,000 in a money-market fund, $3,000 in municipal bonds, and $7,000 in mutual funds.


Try It #1

Solve the system of equations in three variables.

2x+y−2z=−1

3x−3y−z=5

x−2y+3z=6


Source: Rice University, https://openstax.org/books/college-algebra/pages/7-2-systems-of-linear-equations-three-variables
Creative Commons License This work is licensed under a Creative Commons Attribution 4.0 License.