Systems with More Variables

Learning goals

  • Write ax+by+cz=dax + by + cz = d and solve for ordered triples
  • Eliminate the same variable from two different pairs
  • Reduce to a two-variable system, then back-substitute
  • Explain why each round removes an unknown and terminates
  • Interpret a shared point, line, or plane as solutions
  • Read a false or always-true leftover as the special cases

From two unknowns to three

Take the system

x+y+z=6,x−y+z=2,x+y−z=0.\begin{gathered} x + y + z = 6, \\ x - y + z = 2, \\ x + y - z = 0. \end{gathered}

The triple (1,2,3)(1, 2, 3) solves it, because 1+2+3=61 + 2 + 3 = 6, 1−2+3=21 - 2 + 3 = 2, and 1+2−3=01 + 2 - 3 = 0 are all true. A solution is now three numbers, one for each letter.

An equation like these, written in the standard form

ax+by+cz=d,ax + by + cz = d,

is a linear equation in three variables: aa, bb, cc, and dd are numbers, aa, bb, and cc are not all zero, and each variable appears only to the first power. Its solutions are ordered triples (x,y,z)(x, y, z). A system of three linear equations asks for the triple that satisfies all three at the same time. Pinning down three unknowns takes three equations with independent left sides: no left side can be formed by adding multiples of the other two. When one can, the system has either no solution or infinitely many, as the special cases below show.

Elimination, from two lessons ago, still removes a variable however many other letters there are. What is new is how you organize the work: eliminate the same variable from two different pairs of equations, leaving two equations in the same two unknowns.

Check your understanding

Rewrite z=4x+2y−9z=4x+2y-9 in the standard form ax+by+cz=dax + by + cz = d. Which equation results?

Answer choices

The reduction strategy step by step

  1. Choose a variable to eliminate, often one that already has matching or opposite coefficients somewhere.
  2. Eliminate it from one pair of equations by adding or subtracting (scaling first if needed). This leaves one equation in the other two unknowns.
  3. Eliminate the same variable from a different pair, one that uses the equation you have not touched yet. This gives a second equation in the same two unknowns.
  4. Solve that two-variable system by substitution or elimination.
  5. Back-substitute the two values into an original equation with a nonzero coefficient on the eliminated variable, and solve for it.
  6. Check the triple in all three original equations, not just the ones you combined.

Step 3 is the one people get wrong: eliminate zz from one pair but yy from the other, and the two leftover equations still involve three unknowns. If an equation loses all its variables, use the special cases below.

The three-to-two-to-one reductionThree boxes arranged vertically with readable labels. A full elimination round leads down from each box to the next; an arrow on the right leads back upward for back-substitution.3 equations3 unknowns2 equations2 unknowns1 equation1 unknownone fullroundone fullroundback-substitute using kept equationssolve, then work back
In the one-solution case, each full round leaves a smaller system: three equations in three unknowns, then two in two, then one in one. Keep an equation from each round for back-substitution. An identity or contradiction instead leads to the special cases below.

Worked example 1 Solve x+y+z=6x + y + z = 6, 2x−y+z=32x - y + z = 3, and x+2y−z=2x + 2y - z = 2

Number the equations so the bookkeeping stays clear:

(1) x+y+z=6,(2) 2x−y+z=3,(3) x+2y−z=2.\begin{gathered} (1)\ x + y + z = 6, \\ (2)\ 2x - y + z = 3, \\ (3)\ x + 2y - z = 2. \end{gathered}

Eliminate zz: equations (1)(1) and (2)(2) have +z+z and equation (3)(3) has −z-z, so adding (3)(3) to either of the others cancels zz. Add (1)(1) and (3)(3):

(x+y+z)+(x+2y−z)=6+2,2x+3y=8.(A)\begin{gathered} (x + y + z) + (x + 2y - z) = 6 + 2, \\ 2x + 3y = 8. \quad (A) \end{gathered}

Now eliminate the same variable from a second pair that uses the untouched equation (2)(2). Add (2)(2) and (3)(3):

(2x−y+z)+(x+2y−z)=3+2,3x+y=5.(B)\begin{gathered} (2x - y + z) + (x + 2y - z) = 3 + 2, \\ 3x + y = 5. \quad (B) \end{gathered}

Equations (A)(A) and (B)(B) form an ordinary two-variable system. By substitution, (B)(B) gives y=5−3xy = 5 - 3x, so replace yy in (A)(A):

2x+3(5−3x)=8,2x+15−9x=8,−7x=−7,x=1.\begin{gathered} 2x + 3(5 - 3x) = 8, \\ 2x + 15 - 9x = 8, \\ -7x = -7, \\ x = 1. \end{gathered}

Then y=5−3(1)=2y = 5 - 3(1) = 2. Back-substitute x=1x = 1 and y=2y = 2 into equation (1)(1) to recover zz:

1+2+z=6,z=3.\begin{gathered} 1 + 2 + z = 6, \\ z = 3. \end{gathered}

Check (1,2,3)(1, 2, 3) in all three originals: 1+2+3=61 + 2 + 3 = 6, 2(1)−2+3=32(1) - 2 + 3 = 3, and 1+2(2)−3=21 + 2(2) - 3 = 2. All three hold, so the solution is (1,2,3)(1, 2, 3).

Check your understanding

For x+y+z=8x+y+z=8, 2x+y−z=52x+y-z=5, and x−y+z=4x-y+z=4, add the second equation to each of the other two. Which reduced system results?

Answer choices

Check your understanding

Solve x+y+z=6x+y+z=6, 2x−y+z=72x-y+z=7, and x+2y−z=3x+2y-z=3 by eliminating zz from two pairs, then back-substituting. Which triple (x,y,z)(x,y,z) results?

Answer choices

Why the reduction works and always finishes

Each replacement is reversible, just as in the elimination lesson.

Why eliminating a variable preserves the solution set, and why two rounds finish it#

Use x+y+z=9x+y+z=9, 2x+y+z=122x+y+z=12, and x+2y+3z=20x+2y+3z=20. Keep the first equation. Subtract twice the first from the second, and the first from the third:

−y−z=−6,y+2z=11.\begin{aligned} -y-z&=-6,\\ y+2z&=11. \end{aligned}

Adding twice the kept equation back to the first reduced equation recovers the original second equation, and adding the kept equation to the other recovers the original third. Each reduced equation is a combination of the original equations, so every triple that solves those three satisfies it. No triple was gained or lost. Adding the two reduced equations gives z=5z=5; then y=1y=1, and the kept equation gives x=3x=3.

The same steps work for any coefficients. Choose a variable with a nonzero coefficient and keep an equation containing it. Subtract suitable multiples of that equation from the other two to cancel the variable; adding the same multiples back undoes each step, so the solutions are unchanged. Solve the two remaining equations, then use the kept equation’s nonzero coefficient to recover the eliminated variable. Three unknowns become two, then one: two rounds finish the one-solution case.

The reduction also ends in the other cases. A false statement means no solution. An always-true statement adds no condition and can be set aside. If the reduction finishes with no false statement at any step, a variable that was never eliminated and is missing from all the remaining equations is free to vary.

Larger systems shrink the same way: four equations in four unknowns become three in at most three, and so on, with the same endings.

Check your understanding

Why does the reduction always come to an end, instead of running forever, no matter which three-variable system you start with?

Answer choices

Check your understanding

After eliminating zz, you find x=1x=1 and y=2y=2. One original equation is x+y+z=8x+y+z=8. How do you recover zz?

Answer choices

A three-variable word problem

Three-variable systems fit problems with three unknowns and three facts, such as recovering prices from three receipts, where each receipt is one equation.

Worked example 2 Unknown prices from three receipts

At a snack stand the popcorn, pretzels, and drinks each have a fixed price. Three customers pay:

  • one popcorn, one pretzel, and one drink cost 77 dollars,
  • two popcorns, one pretzel, and three drinks cost 1111 dollars,
  • one popcorn, two pretzels, and four drinks cost 1414 dollars.

Find the price of each item.

Let pp, tt, and dd be the price in dollars of a popcorn, a pretzel, and a drink. Each receipt becomes one equation:

(1) p+t+d=7,(2) 2p+t+3d=11,(3) p+2t+4d=14.\begin{gathered} (1)\ p + t + d = 7, \\ (2)\ 2p + t + 3d = 11, \\ (3)\ p + 2t + 4d = 14. \end{gathered}

Eliminate pp, whose coefficient is 11 in the first equation. Subtract twice equation (1)(1) from equation (2)(2):

(2p+t+3d)−2(p+t+d)=11−14,−t+d=−3.(A)\begin{gathered} (2p + t + 3d) - 2(p + t + d) \\ = 11 - 14, \\ -t + d = -3. \quad (A) \end{gathered}

Eliminate the same variable pp from the untouched equation (3)(3) by subtracting equation (1)(1):

(p+2t+4d)−(p+t+d)=14−7,t+3d=7.(B)\begin{gathered} (p + 2t + 4d) - (p + t + d) = 14 - 7, \\ t + 3d = 7. \quad (B) \end{gathered}

Add (A)(A) and (B)(B) to cancel tt:

(−t+d)+(t+3d)=−3+7,4d=4,d=1.\begin{gathered} (-t + d) + (t + 3d) = -3 + 7, \\ 4d = 4, \\ d = 1. \end{gathered}

From (A)(A), −t+1=−3-t + 1 = -3, so t=4t = 4. Back-substitute into equation (1)(1): p+4+1=7p + 4 + 1 = 7, so p=2p = 2.

So popcorn costs 22 dollars, a pretzel 44 dollars, and a drink 11 dollar. Check each receipt:

2+4+1=7,2(2)+4+3(1)=11,2+2(4)+4(1)=14.\begin{aligned} 2+4+1&=7,\\ 2(2)+4+3(1)&=11,\\ 2+2(4)+4(1)&=14. \end{aligned}

The geometry: three planes in space

With two variables, a linear equation draws a line on a flat page. With three, ax+by+cz=dax + by + cz = d draws a flat sheet stretching out forever in space, a plane. A system of three equations is three planes, and a solution triple is a point lying on all three at once. In the one-solution case, the three planes meet at exactly one point.

Three planes meeting at one pointThree parallelogram-shaped planes sharing a single common corner point, which is highlighted and labeled as the triple x, y, z that solves the system.(x, y, z)
Each linear equation in three variables, with at least one nonzero variable coefficient, is a plane. This picture shows the one-solution case: exactly one point lies on all three planes, so one triple (x, y, z) solves all three equations.

Check your understanding

One system's three planes share exactly one point. A second system is x+y+z=7x+y+z=7, 2x+2y+2z=142x+2y+2z=14, and 3x+3y+3z=213x+3y+3z=21. A third system's planes share exactly one line. Which description of their solution sets is correct?

Answer choices

Two planes can also be parallel. Compare x+y+z=3x+y+z=3 with 2x+2y+2z=82x+2y+2z=8. Dividing the second by 22 gives x+y+z=4x+y+z=4, which cannot hold at the same point as x+y+z=3x+y+z=3: same variable coefficients, different constant, so the planes are distinct and parallel. (With 66 instead of 88, the two equations would describe the same plane.) As with lines in the elimination lesson, two planes are parallel or the same exactly when one equation’s variable coefficients are a nonzero multiple of the other’s; otherwise they cross along a line.

If the planes have no common point, the system is inconsistent and has no solution. That happens when two of them are distinct parallel planes, or when all three cross in pairs without one point common to all three. In the second case, the three intersection lines are distinct and parallel, like the vertical edges of a triangular prism with each side face extended into a whole plane.

Pairwise intersections without a common pointFinite patches of three planes form the sides of a triangular prism. Each pair shares a vertical edge; the three edges extend into distinct parallel lines.three parallel intersection lines
Three side faces of a triangular prism model planes that meet in pairs but have no common point. Extend each face into a whole plane and each vertical edge into a line. The three intersection lines are distinct and parallel.

Any two of these lines lie in one of the planes and cannot meet, because a meeting point would lie on all three planes, so they are parallel.

If the three planes share a whole line, or coincide as one plane, the system has infinitely many solutions. Elimination tells the cases apart: a false statement means no common point (Worked Example 3), and 0=00=0 with no contradiction left means infinitely many (Worked Example 4).

When the reduction hits no solution or infinitely many

Worked example 3 A system with no solution

Solve

(1) x+y+z=6,(2) x+2y+3z=14,(3) 2x+3y+4z=25.\begin{gathered} (1)\ x + y + z = 6, \\ (2)\ x + 2y + 3z = 14, \\ (3)\ 2x + 3y + 4z = 25. \end{gathered}

Eliminate xx using the first equation. Subtract equation (1)(1) from equation (2)(2):

(x+2y+3z)−(x+y+z)=14−6,y+2z=8.(A)\begin{gathered} (x + 2y + 3z) - (x + y + z) = 14 - 6, \\ y + 2z = 8. \quad (A) \end{gathered}

Now clear the same variable from equation (3)(3) by subtracting 22 times equation (1)(1):

(2x+3y+4z)−2(x+y+z)=25−12,y+2z=13.(B)\begin{gathered} (2x + 3y + 4z) - 2(x + y + z) \\ = 25 - 12, \\ y + 2z = 13. \quad (B) \end{gathered}

The same expression y+2zy + 2z cannot equal both 88 and 1313. Subtracting (A)(A) from (B)(B) shows it:

0=5.0 = 5.

This is false, so the system has no solution: the three planes share no common point. Equation (3)(3)‘s left side is (1)(1) plus (2)(2), but 2525 is not 6+146+14.

Worked example 4 A system with infinitely many solutions

Solve

(1) x+y+z=6,(2) x+2y+3z=14,(3) x+3y+5z=22.\begin{gathered} (1)\ x + y + z = 6, \\ (2)\ x + 2y + 3z = 14, \\ (3)\ x + 3y + 5z = 22. \end{gathered}

Eliminate xx again with the first equation. Subtract equation (1)(1) from equation (2)(2):

(x+2y+3z)−(x+y+z)=14−6,y+2z=8.(A)\begin{gathered} (x + 2y + 3z) - (x + y + z) = 14 - 6, \\ y + 2z = 8. \quad (A) \end{gathered}

Subtract equation (1)(1) from equation (3)(3):

(x+3y+5z)−(x+y+z)=22−6,2y+4z=16.(B)\begin{gathered} (x + 3y + 5z) - (x + y + z) = 22 - 6, \\ 2y + 4z = 16. \quad (B) \end{gathered}

Equation (B)(B) is exactly twice (A)(A). Subtracting 22 times (A)(A) from (B)(B) gives

0=0.0 = 0.

Indeed, the third original equation is twice the second minus the first, including its constant: 22=2(14)−622=2(14)-6. It is a combination of the other two, though not a multiple of either, so it added no new condition. The system has infinitely many solutions: pick any value for zz, and (A)(A) gives yy, then equation (1)(1) gives xx. Here zz is a free variable: you may choose any real value for it, and the remaining equations determine the other coordinates. Try a few values:

zzy=8−2zy = 8 - 2zx=6−y−zx = 6 - y - zTriple
0088−2-2(−2,8,0)(-2, 8, 0)
1166−1-1(−1,6,1)(-1, 6, 1)
224400(0,4,2)(0, 4, 2)

Every row solves all three original equations; for the first, −2+8+0=6-2 + 8 + 0 = 6, −2+2(8)+3(0)=14-2 + 2(8) + 3(0) = 14, and −2+3(8)+5(0)=22-2 + 3(8) + 5(0) = 22. Each choice of zz gives a different triple on the same line: the three planes meet along a whole line rather than at a single point.

With two equations in two unknowns, 0=00 = 0 always meant infinitely many solutions. With three equations it means only that one equation added nothing new, and another can still contradict the rest: in x+y+z=1x + y + z = 1, 2x+2y+2z=22x + 2y + 2z = 2, x+y+z=5x + y + z = 5, the first two collapse to 0=00 = 0, but the third against the first leaves 0=40 = 4, so there is no solution.

Check your understanding

Reducing a system of three equations in three unknowns, you eliminate a variable from two pairs and arrive at y+z=5y + z = 5 and 2y+2z=102y + 2z = 10. What does this tell you?

Answer choices

Check your understanding

Reducing a system of three equations in three unknowns, you eliminate a variable from two pairs and arrive at 0=40 = 4. What does this tell you?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)
Go deeper (optional)

You can skip this and keep going. Read it if you want to know more.

Why three pairwise plane intersections can be parallel

Pairwise intersections of three planes with no common point#

Three distinct planes that meet in pairs but share no common point have parallel intersection lines.

Take the planes x=0x=0, y=0y=0, and x+y=1x+y=1. They meet in pairs along the lines (0,0,z)(0,0,z), (0,1,z)(0,1,z), and (1,0,z)(1,0,z), with zz any real number; each varies only in its third coordinate, so they are parallel. No two of them meet: a common point would satisfy all three equations, but the first two give x+y=0x+y=0 while the third requires x+y=1x+y=1.

The same reasoning works for any three distinct planes that meet in pairs with no point common to all three. Any two intersection lines lie in one plane (the first plane’s intersections with the other two both lie in the first plane, for example). A point on both would lie on all three planes, which is impossible, so the lines are distinct and do not meet. Distinct lines in one plane that do not meet are parallel.

Why elimination works and finishes for any number of equations, not just three

Why elimination preserves solutions and terminates for a system of any size#

Start with four equations:

w+x+y+z=10,2w+x+y+z=14,w+2x+3y+2z=18,w+2x+2y+3z=17.\begin{aligned} w+x+y+z&=10,\\ 2w+x+y+z&=14,\\ w+2x+3y+2z&=18,\\ w+2x+2y+3z&=17. \end{aligned}

Keep the first equation; subtract twice it from the second and once from each of the last two:

−x−y−z=−6(A),x+2y+z=8(B),x+y+2z=7(C).\begin{aligned} -x-y-z&=-6 &&(A),\\ x+2y+z&=8 &&(B),\\ x+y+2z&=7 &&(C). \end{aligned}

Keep (A)(A) and add it to (B)(B) and (C)(C), eliminating xx. This leaves y=2y=2 and z=1z=1. Set aside y=2y=2 for back-substitution; the last equation, z=1z=1, is solved. Four equations have become three, then two, then one.

Work backward: (A)(A) gives −x−2−1=−6-x-2-1=-6, so x=3x=3, and the first original gives w=4w=4. The four original left sides at (4,3,2,1)(4,3,2,1) are 1010, 1414, 1818, and 1717, as required. Every move reverses (subtract (A)(A) from y=2y=2 and z=1z=1 to get back (B)(B) and (C)(C), then add back the multiples of the first original), so no solution was lost or gained.

For nn equations in nn unknowns, choose a variable with a nonzero coefficient in one of the remaining equations, keep that equation for back-substitution, and use it to eliminate the variable from all the others; each replacement can be undone. Along the way, discard an always-true equation, and stop with no solution if an equation becomes false. A variable not yet eliminated that is missing from all the remaining equations needs no elimination: choose a value for it for now and keep that choice for back-substitution.

Every elimination removes a variable from the remaining problem, and there were only nn variables, so there are at most nn elimination steps. If the process ends with no contradiction, use any free choices and work backward through the kept equations. Each has a nonzero coefficient on the variable it recovers, so every step is possible.

Writing every solution of an infinite family with one parameter

In Worked Example 4, choosing z=4z=4 forces y=8−2(4)=0y=8-2(4)=0 and then x=6−0−4=2x=6-0-4=2, and (2,0,4)(2,0,4) checks in all three originals: 2+0+4=62+0+4=6, 2+2(0)+3(4)=142+2(0)+3(4)=14, 2+3(0)+5(4)=222+3(0)+5(4)=22. To record every choice at once, use a parameter, a letter whose value you are free to choose. Write z=tz=t for any real number tt. Then equation (A)(A) and the kept equation give

y=8−2t,x=6−(8−2t)−t=t−2.\begin{aligned} y&=8-2t,\\ x&=6-(8-2t)-t=t-2. \end{aligned}

So all the solutions are

(x,y,z)=(t−2, 8−2t, t).(x,y,z)=(t-2,\ 8-2t,\ t).

Substituting these into the three originals gives 66, 1414, and 2222 for every tt. Conversely, any solution has some value z=tz=t, and then the reduced equation forces y=8−2ty=8-2t and the kept original forces x=t−2x=t-2. So the formula gives every solution.

A bit of history (optional)

In a circuit with several branches, how much electric current flows through each wire? The current splits at junctions, and the branches affect one another. So the currents in all the branches have to be found together.

In 1845, Gustav Kirchhoff announced two laws for such circuits while studying at the University of Königsberg in Prussia, in the city now called Kaliningrad. He was about twenty-one. One law balances the currents entering and leaving a junction. The other balances voltage changes around a closed loop.

For circuits of fixed resistors and known voltage sources, those laws give a linear system for the unknown currents, reduced by elimination just like a three-variable problem. Kirchhoff’s work extended Ohm’s earlier results to networks with several loops.

MacTutor’s biography of Kirchhoff describes his student work and the two laws.

Your progress

See all your progress →