Algebra 2Functions and Linear Systems3 of 3
Functions and Linear Systems · 3

Systems of Linear Equations in Three Variables

For a system of three linear equations in xx, yy, and zz, a solution is a point (x,y,z)(x, y, z) that makes all three equations true at once.

1

Equations as Planes in 3D Space

In two variables, an equation like x+y=5\eqone{x + y = 5} leaves one free choice. Picking xx fixes y=5−xy = 5 - x, so its solutions form a line with slope −1-1. With three variables, an equation like x+y+z=6\eqone{x + y + z = 6} leaves two free choices: we can pick both xx and yy freely on the flat floor, and the equation fixes the height zz, creating a flat surface in 3D space called a plane.

Equations as Planes in 3D Space
x+y=5\eqone{x + y = 5}
11
22
33
44
55
66
11
22
33
44
55
66
xx
yy

Because the equation fixes a single zz-coordinate, z=6−x−yz = 6 - x - y, for every point (x,y)(x, y) on the xx-yy floor, all the solutions together form a flat, tilted plane.

For every point on the floor, the equation fixes one z-coordinate. Together, the solution points form a flat, tilted plane.

In the single-solution configuration shown below, the second plane crosses the first in a line, and the third plane cuts that line at one point.

11 equation: a plane
(22 free choices)
22 equations: a line
(11 free choice)
33 equations: a single point
(00 free choices)
2

The Strategy: Eliminate One Variable Twice

To find that single intersection point (x,y,z)(x, y, z) with algebra, our goal is to turn a three-variable system into a two-variable system we already know how to solve.

It is easy to go in circles if we cancel one variable from the first pair of equations and a different variable from the second pair, because we still end up with all three variables. Instead, we pick one target variable and eliminate it twice using two different pairs of equations.

The Strategy: Eliminate One Variable Twice

Once we reduce the system to a staircase where one variable is solved at the bottom, we work back up one equation at a time to find the other two:

x+2y+z=9y−z=2z=1\displaystyle \begin{aligned} x \quad &+& 2y \quad &+& z \quad &=&& 9 \\ && y \quad &-& z \quad &=&& 2 \\ && && z \quad &=&& 1 \end{aligned}

Text solution:

So all three planes meet at the single point (2,3,1)(2, 3, 1).

For this staircase system, eliminating z\elim{z} from the first and second equations and from the first and third equations projects their two intersection lines straight down onto the xx-yy floor. The point (x,y)(x, y) where those floor lines cross sits right below the 3D intersection point.

Removing the height flattens two 3D crossing lines into two shadow lines on the floor that meet right under the 3D solution.
3

Solving a Three-Variable System Step by Step

Now let's solve a full system where all three variables appear in every equation:

(1)x+2y+z=9(2)2x−y+z=2(3)3x+y−2z=7\displaystyle \begin{aligned} & \eqone{(1)} & x \quad &+& 2y \quad &+& z \quad &=&& 9 \\ & \eqtwo{(2)} & 2x \quad &-& y \quad &+& z \quad &=&& 2 \\ & \eqthree{(3)} & 3x \quad &+& y \quad &-& 2z \quad &=&& 7 \end{aligned}

Before doing any algebra, look across the three columns to pick the easiest target variable to eliminate twice, and write that target at the top of your work so you don't switch variables halfway through.

Solving a Three-Variable System Step by Step
(1)    2x+2y+2z\displaystyle \eqone{(1)}\;\; \phantom{2}x + 2y + \phantom{2}z =99\displaystyle = \mathrlap{9}\phantom{9}
(2)    2x−2y+2z\displaystyle \eqtwo{(2)}\;\; 2x - \phantom{2}y + \phantom{2}z =29\displaystyle = \mathrlap{2}\phantom{9}
(3)    3x+2y−2z\displaystyle \eqthree{(3)}\;\; 3x + \phantom{2}y - 2z =79\displaystyle = \mathrlap{7}\phantom{9}
(x, y, z)\displaystyle (x,\, y,\, z) =  ?\displaystyle = \;?

Text solution:

So the three planes cross at the single point (2,3,1)(2, 3, 1). Taking five seconds to plug (2,3,1)(2, 3, 1) into (3)\eqthree{(3)} gives 3(2)+3−2(1)=73(2) + 3 - 2(1) = 7, which checks the result in Equation (3)\eqthree{(3)}.

4

Shortcuts for Missing or Isolated Variables

We don't always have to eliminate a variable twice. When one of the original equations is already missing a variable, or already has a variable by itself on one side, part of the work is already done for us:

(1)x+y+z=10(2)2x−y+z=1(3)x+y+2z=8\displaystyle \begin{aligned} & \eqone{(1)} & x \quad &+& y \quad &+& z \quad &=&& 10 \\ & \eqtwo{(2)} & 2x \quad &-& y \quad && \phantom{{}+ z} &=&& 1 \\ & \eqthree{(3)} & \phantom{x + {}} && y \quad &+& 2z \quad &=&& 8 \end{aligned}
Shortcuts for Missing or Isolated Variables
(1)    2x+2y+2z\displaystyle \eqone{(1)}\;\; \phantom{2}x + \phantom{2}y + \phantom{2}z =1010\displaystyle = \mathrlap{10}\phantom{10}
(2)    2x−2y+2x\displaystyle \eqtwo{(2)}\;\; 2x - \phantom{2}y \mathbin{\phantom{+}} \phantom{2x} =110\displaystyle = \mathrlap{1}\phantom{10}
(3)    2x+2y+2z\displaystyle \eqthree{(3)}\;\; \phantom{2x} \mathbin{\phantom{+}} \phantom{2}y + 2z =810\displaystyle = \mathrlap{8}\phantom{10}

Text solution:

We stop at two variables on purpose: this example only shows the reduction step, not the full solution.

5

No Solution and Infinitely Many Solutions

Sometimes, when we combine Equation A and Equation B, both remaining variables cancel out at once. What that tells us depends on whether the remaining numbers give a false or true statement. Let's compare two systems that differ only in the last number on the right:

(1)x+y+z=4(2)2x+2y+z=7(3)3x+3y+2z=10or 11\displaystyle \begin{aligned} & \eqone{(1)} & x \quad &+& y \quad &+& z \quad &=&& 4 \\ & \eqtwo{(2)} & 2x \quad &+& 2y \quad &+& z \quad &=&& 7 \\ & \eqthree{(3)} & 3x \quad &+& 3y \quad &+& 2z \quad &=&& 10 \\ &&&&&&&&& \text{or } 11 \end{aligned}
No Solution and Infinitely Many Solutions
(1)    2x+2y+2z\displaystyle \eqone{(1)}\;\; \phantom{2}x + \phantom{2}y + \phantom{2}z =410 or 11\displaystyle = \mathrlap{4}\phantom{10 \text{ or } 11}
(2)    2x+2y+2z\displaystyle \eqtwo{(2)}\;\; 2x + 2y + \phantom{2}z =710 or 11\displaystyle = \mathrlap{7}\phantom{10 \text{ or } 11}
(3)    3x+3y+2z\displaystyle \eqthree{(3)}\;\; 3x + 3y + 2z =10 or 1110 or 11\displaystyle = \mathrlap{10 \text{ or } 11}\phantom{10 \text{ or } 11}
(x, y, z)\displaystyle (x,\, y,\, z) =  ?\displaystyle = \;?

Text solution:

So the first system has no solution, while the second has infinitely many solutions along the line (x,3−x,1)(x, 3 - x, 1). Notice that 0=00 = 0 does not mean every point in 3D space works. For example, (0,0,0)(0, 0, 0) does not work in Equation (1)\eqone{(1)}. Only points on the line (x,3−x,1)(x, 3 - x, 1) work, such as (0,3,1)(0, 3, 1) and (5,−2,1)(5, -2, 1).

No common point
(0=10 = 1)
seen along
the lines
Shared line of solutions
(0=00 = 0)
seen along
the line

When two planes already meet along a line, a third plane either cuts across that line at a single point, runs parallel to that line so all three never meet, or passes right through the entire line.

When two planes already meet in a line, a third plane cuts that line at one point unless it runs parallel to the line or passes right through it.
6

Modeling Real Situations with Three Variables

Whenever a word problem asks for three unknown quantities, look for three separate clues in the problem so each clue gives one equation.

A movie theater sells Small ($4\$4), Medium ($6\$6), and Large ($7\$7) bags of popcorn. After one show, they sold 2020 bags in total, brought in $108\$108 in sales, and sold twice as many Small bags as Large bags. We want to find the number of Small (SS), Medium (MM), and Large (LL) bags sold.

Modeling Real Situations with Three Variables
Small\text{Small}
$4\$4
Medium\text{Medium}
$6\$6
Large\text{Large}
$7\$7
S=  ?S = \;?
M=  ?M = \;?
L=  ?L = \;?
1.1.
20 bags20 \text{ bags}
2.2.
$108\$108
3.3.
Small=\text{Small} =
2×Large2 \times \text{Large}

Text solution:

So the theater sold 88 Small bags, 88 Medium bags, and 44 Large bags of popcorn.

Key concepts

Eliminate one target variable twice (standard system)

When all three variables appear in all three equations, look down the columns for coefficients that already match or have opposite signs (like −y\elim{-y} and +y\elim{+y} in 2x−y+z=22x - \elim{y} + z = 2 and 3x+y−2z=73x + \elim{y} - 2z = 7). Eliminate that same variable from two different pairs of equations so Equations A and B have the exact same two variables, solve for those two, and plug them back in to find the third.

When not to eliminate twice
  • Missing variable: If an equation is already missing a variable, like 2x−y=12x - y = 1 (no z\elim{z}), don't eliminate twice. Keep 2x−y=12x - y = 1 as Equation A and eliminate z\elim{z} just once from the other two equations.
  • Isolated variable: If an equation already has one variable by itself, like S=2L\elim{S} = 2L or x=2y\elim{x} = 2y, skip elimination at the start and substitute that expression straight into the other two equations.
When all variables cancel out
  • Contradiction (0=10 = 1): Equations A and B disagree (such as x+y=3x + y = 3 and x+y=2x + y = 2), meaning the three planes have no solution.
  • Identity (0=00 = 0): One equation is a combination of the other two. In this example, the first two planes intersect along a line of solutions with one free choice xx: solve Equation A for yy in terms of xx (x+y=3  ⟹  y=3−xx + y = 3 \implies y = 3 - x), substitute into an original equation to find zz (z=1z = 1), and write the line as (x,3−x,1)(x, 3 - x, 1).
7

Practice

1

Solve the system:

(1)x+y+z=7(2)2x−y+z=0(3)3x+2y−z=9\displaystyle \begin{aligned} \eqone{(1)} && x + y + z &= 7 \\ \eqtwo{(2)} && 2x - y + z &= 0 \\ \eqthree{(3)} && 3x + 2y - z &= 9 \end{aligned}

Look for a column where one equation has −1-1 and the other two have +1+1, so you can eliminate that same variable twice just by adding, without multiplying first.

Eliminate z\elim{z} twice by adding (1)+(3)\eqone{(1)} + \eqthree{(3)} and (2)+(3)\eqtwo{(2)} + \eqthree{(3)}:
(1)+(3):(x+y+z)+(3x+2y−z)=7+9A:4x+3y=16(2)+(3):(2x−y+z)+(3x+2y−z)=0+9B:5x+y=9\displaystyle \begin{aligned} \eqone{(1)} + \eqthree{(3)}{:}\quad (x + y + \elim{z}) + (3x + 2y - \elim{z}) &= 7 + 9 \\ \reduced{\text{A:}}\quad 4x + 3y &= 16 \\ \eqtwo{(2)} + \eqthree{(3)}{:}\quad (2x - y + \elim{z}) + (3x + 2y - \elim{z}) &= 0 + 9 \\ \reduced{\text{B:}}\quad 5x + y &= 9 \end{aligned}
(Watch out: don't add (1)+(2)\eqone{(1)} + \eqtwo{(2)} to cancel y\elim{y} and then (2)+(3)\eqtwo{(2)} + \eqthree{(3)} to cancel z\elim{z}. That leaves 3x+2z=73x + 2z = 7 and 5x+y=95x + y = 9, which still has all three variables.)
Multiply Equation B by 33 to match +3y\elim{+3y} and subtract Equation A:
3×B:15x+3y=27(15x+3y)−(4x+3y)=27−1611x=11x=1\displaystyle \begin{aligned} 3 \times \reduced{\text{B}}{:}\quad 15x + \elim{3y} &= 27 \\ (15x + \elim{3y}) - (4x + \elim{3y}) &= 27 - 16 \\ 11x &= 11 \\ x &= 1 \end{aligned}
(Watch out: when multiplying Equation B by 33, forgetting to multiply the 99 on the right side by 33 leaves 15x+3y=915x + 3y = 9, which gives 11x=−711x = -7 and the wrong answer (−711,13411,−5011)\left(-\frac{7}{11}, \frac{134}{11}, -\frac{50}{11}\right).)
Plug x=1x = 1 into Equation B to get 5(1)+y=9  ⟹  y=45(1) + y = 9 \implies y = 4, and plug x=1,y=4x = 1, y = 4 into (1)\eqone{(1)} to get 1+4+z=7  ⟹  z=21 + 4 + z = 7 \implies z = 2.
Answer(1,4,2)(1, 4, 2)
2

Solve the system:

(1)x+2y+z=13(2)3x−y=3(3)2x−2y+3z=13\displaystyle \begin{aligned} \eqone{(1)} && x + 2y + z &= 13 \\ \eqtwo{(2)} && 3x - y &= 3 \\ \eqthree{(3)} && 2x - 2y + 3z &= 13 \end{aligned}

One equation is already missing a variable. Which variable is missing, and which pair of equations must you combine to eliminate that same variable?

Equation (2)\eqtwo{(2)} is already missing z\elim{z}, so keep it as A: 3x−y=3\reduced{\text{A: }} 3x - y = 3 and eliminate z\elim{z} once using (1)\eqone{(1)} and (3)\eqthree{(3)}:
3×(1):3x+6y+3z=393×(1)−(3):(3x+6y+3z)−(2x−2y+3z)=39−13B:x+8y=26\displaystyle \begin{aligned} 3 \times \eqone{(1)}{:}\quad 3x + 6y + \elim{3z} &= 39 \\ 3 \times \eqone{(1)} - \eqthree{(3)}{:}\quad (3x + 6y + \elim{3z}) - (2x - 2y + \elim{3z}) &= 39 - 13 \\ \reduced{\text{B:}}\quad x + 8y &= 26 \end{aligned}
(Watch out: when subtracting (2x−2y+3z)(2x - 2y + 3z), distribute the minus sign to −2y-2y so 6y−(−2y)=+8y6y - (-2y) = +8y. Subtracting 2y2y instead gives x+4y=26x + 4y = 26, which leads to the wrong answer (3813,7513,−1913)\left(\frac{38}{13}, \frac{75}{13}, -\frac{19}{13}\right).)
Multiply Equation A by 88 and add to Equation B to cancel y\elim{y}:
8×A:24x−8y=24(24x−8y)+(x+8y)=24+2625x=50x=2\displaystyle \begin{aligned} 8 \times \reduced{\text{A}}{:}\quad 24x - \elim{8y} &= 24 \\ (24x - \elim{8y}) + (x + \elim{8y}) &= 24 + 26 \\ 25x &= 50 \\ x &= 2 \end{aligned}
Plug x=2x = 2 into Equation A to get 3(2)−y=3  ⟹  y=33(2) - y = 3 \implies y = 3, and plug x=2,y=3x = 2, y = 3 into (1)\eqone{(1)} to get 2+2(3)+z=132 + 2(3) + z = 13   ⟹  \implies z=5z = 5.
Answer(2,3,5)(2, 3, 5)
3

Solve the system:

(1)x+2y+z=5(2)2x−y+z=4(3)4x+3y+3z=12\displaystyle \begin{aligned} \eqone{(1)} && x + 2y + z &= 5 \\ \eqtwo{(2)} && 2x - y + z &= 4 \\ \eqthree{(3)} && 4x + 3y + 3z &= 12 \end{aligned}

Equations (1)\eqone{(1)} and (2)\eqtwo{(2)} both have +z\elim{+z}. After subtracting them to eliminate z\elim{z} once, multiply (1)\eqone{(1)} by 33 so you can eliminate +3z\elim{+3z} in (3)\eqthree{(3)}.

Subtract (1)\eqone{(1)} from (2)\eqtwo{(2)} to eliminate z\elim{z} the first time:
(2)−(1):(2x−y+z)−(x+2y+z)=4−5A:x−3y=−1\displaystyle \begin{aligned} \eqtwo{(2)} - \eqone{(1)}{:}\quad (2x - y + \elim{z}) - (x + 2y + \elim{z}) &= 4 - 5 \\ \reduced{\text{A:}}\quad x - 3y &= -1 \end{aligned}
(Watch out: distribute the minus sign to +2y+2y in (1)\eqone{(1)} so −y−2y=−3y-y - 2y = -3y. Writing −y+2y=+y-y + 2y = +y gives x+y=−1x + y = -1, which crosses Equation B at the wrong answer (−32,12,112)\left(-\frac{3}{2}, \frac{1}{2}, \frac{11}{2}\right).)
Multiply (1)\eqone{(1)} by 33 and subtract from (3)\eqthree{(3)} to eliminate z\elim{z} a second time:
3×(1):3x+6y+3z=15(3)−3×(1):(4x+3y+3z)−(3x+6y+3z)=12−15B:x−3y=−3\displaystyle \begin{aligned} 3 \times \eqone{(1)}{:}\quad 3x + 6y + \elim{3z} &= 15 \\ \eqthree{(3)} - 3 \times \eqone{(1)}{:}\quad (4x + 3y + \elim{3z}) - (3x + 6y + \elim{3z}) &= 12 - 15 \\ \reduced{\text{B:}}\quad x - 3y &= -3 \end{aligned}
Subtracting Equation B from Equation A gives (x−3y)−(x−3y)=−1−(−3)(x - 3y) - (x - 3y) = -1 - (-3)   ⟹  \implies 0=20 = 2, a contradiction.
AnswerNo solution
4

Solve the system, and if there are infinitely many solutions, write the line of solutions in terms of xx:

(1)x+y+z=6(2)2x+2y+z=10(3)3x+3y+2z=16\displaystyle \begin{aligned} \eqone{(1)} && x + y + z &= 6 \\ \eqtwo{(2)} && 2x + 2y + z &= 10 \\ \eqthree{(3)} && 3x + 3y + 2z &= 16 \end{aligned}

Eliminate z\elim{z} from (1)\eqone{(1)} and (2)\eqtwo{(2)} and then from (1)\eqone{(1)} and (3)\eqthree{(3)}. When Equations A and B match, solve Equation A for yy in terms of xx before finding zz.

Eliminate z\elim{z} twice using (2)−(1)\eqtwo{(2)} - \eqone{(1)} and (3)−2×(1)\eqthree{(3)} - 2 \times \eqone{(1)}:
(2)−(1):(2x+2y+z)−(x+y+z)=10−6A:x+y=4(3)−2×(1):(3x+3y+2z)−(2x+2y+2z)=16−12B:x+y=4\displaystyle \begin{aligned} \eqtwo{(2)} - \eqone{(1)}{:}\quad (2x + 2y + \elim{z}) - (x + y + \elim{z}) &= 10 - 6 \\ \reduced{\text{A:}}\quad x + y &= 4 \\ \eqthree{(3)} - 2 \times \eqone{(1)}{:}\quad (3x + 3y + \elim{2z}) - (2x + 2y + \elim{2z}) &= 16 - 12 \\ \reduced{\text{B:}}\quad x + y &= 4 \end{aligned}
Subtracting Equation B from Equation A gives 0=00 = 0, so the three planes meet along a single line with one free choice xx. Solving Equation A for yy gives y=4−xy = 4 - x, and substituting into (1)\eqone{(1)} gives zz:
x+(4−x)+z=64+z=6z=2\displaystyle \begin{aligned} x + (4 - x) + z &= 6 \\ 4 + z &= 6 \\ z &= 2 \end{aligned}
(Watch out: when substituting y=4−xy = 4 - x into x+y+z=6x + y + z = 6, don't drop the first xx and write (4−x)+z=6(4 - x) + z = 6, which gives the wrong line (x,4−x,x+2)(x, 4 - x, x + 2).)
Answer(x,4−x,2)(x, 4 - x, 2)
5

A bakery sells three sizes of cookie boxes: Small for $5\$5, Medium for $8\$8, and Large for $10\$10. In one afternoon, they sold 3030 boxes in total, brought in $205\$205 in sales, and sold 33 times as many Small boxes as Large boxes. How many of each size did they sell?

Write one equation for the total number of boxes, one for the total sales in dollars, and one for the relationship between Small (SS) and Large (LL) boxes. Then use that third equation to substitute for SS right away.

Write an equation for each of the three clues:
S+M+L=305S+8M+10L=205S=3L\displaystyle \begin{aligned} S + M + L &= 30 \\ 5S + 8M + 10L &= 205 \\ S &= 3L \end{aligned}
(Watch out: "33 times as many Small boxes as Large boxes" means there are more Small boxes, so S=3LS = 3L. Writing L=3SL = 3S reverses the sizes and leads to the impossible counts −353-\frac{35}{3} Small, 2303\frac{230}{3} Medium, and −35-35 Large.)
Substitute S=3L\elim{S} = 3L into the first two equations:
(3L)+M+L=30  ⟹  M+4L=305(3L)+8M+10L=205  ⟹  8M+25L=205\displaystyle \begin{aligned} (\elim{3L}) + M + L = 30 &\implies M + 4L = 30 \\ 5(\elim{3L}) + 8M + 10L = 205 &\implies 8M + 25L = 205 \end{aligned}
Multiply M+4L=30\elim{M} + 4L = 30 by −8-8 and add to 8M+25L=205\elim{8M} + 25L = 205:
(−8M−32L)+(8M+25L)=−240+205−7L=−35L=5\displaystyle \begin{aligned} (-\elim{8M} - 32L) + (\elim{8M} + 25L) &= -240 + 205 \\ -7L &= -35 \\ L &= 5 \end{aligned}
Plug L=5L = 5 back in to get S=3(5)=15S = 3(5) = 15 and 15+M+5=3015 + M + 5 = 30   ⟹  \implies M=10M = 10.
Answer1515 Small boxes, 1010 Medium boxes, and 55 Large boxes