This site is a work in progress. New lessons are added regularly. Contact us

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
  • Picture each equation as a plane meeting at a point
  • Read a false or always-true leftover as the special cases

From two unknowns to three

A linear equation in three variables can be written in the standard form

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

where aa, bb, cc, and dd are numbers and each variable appears only to the first power. Its solutions are no longer pairs but ordered triples (x,y,z)(x, y, z): three numbers, one for each variable, that make the equation true. A system of three linear equations stacks three such equations and asks for the triple that satisfies all three at the same time.

Take the system

x+y+z=6,xy+z=2,x+yz=0.x + y + z = 6, \qquad x - y + z = 2, \qquad x + y - z = 0.

The triple (1,2,3)(1, 2, 3) solves it, because 1+2+3=61 + 2 + 3 = 6, and 12+3=21 - 2 + 3 = 2, and 1+23=01 + 2 - 3 = 0 are all true. A single three-variable equation, like a single two-variable equation, has far too many solutions to pin the unknowns down. It takes three independent equations to fix three unknowns, one condition for each degree of freedom.

The plan is to shrink the system one variable at a time. You already own the tool that removes a variable: elimination, from two lessons ago. Adding or subtracting two equations to cancel a variable worked no matter what the other letters were. So that same move works just as well when a third letter is riding along. The new idea in this lesson is purely organizational. You will run elimination twice, on two different pairs of the three equations, and both times you must cancel the same variable. Cancelling the same variable is what leaves you two equations sharing the same two remaining unknowns.

The reduction strategy step by step

Every three-variable system yields to the same routine.

  1. Choose a variable to eliminate. Pick whichever one has the friendliest coefficients, often a variable that already appears with matching or opposite coefficients somewhere.
  2. Eliminate it from one pair of equations. Combine two of the three equations, by adding or subtracting (scaling first if needed), so that variable cancels. You now have one equation in the other two unknowns.
  3. Eliminate the same variable from a second pair. Combine a different pair, being sure to use the equation you have not touched yet, and cancel the same variable again. This gives a second equation in the same two unknowns.
  4. Solve the two-variable system. Those two new equations form an ordinary system in two unknowns. Solve it by substitution or elimination.
  5. Back-substitute for the third variable. Put the two values you found into any one of the three original equations and solve for the variable you eliminated.
  6. Check the triple in all three original equations. A genuine solution satisfies every one of them, not just the two you happened to use.

The one step people get wrong is step 3. If you eliminate zz from the first pair but then eliminate yy from the second, your two leftover equations do not share the same unknowns. Without the same two unknowns, those two leftover equations cannot be solved together. Cancel the same variable both times.

The three-to-two-to-one reductionThree boxes left to right: three equations three unknowns, two equations two unknowns, one equation one unknown. Forward arrows are labeled eliminate a variable; a return arrow below is labeled back-substitute for each variable.3 equations3 unknowns2 equations2 unknowns1 equation1 unknowneliminate a variableeliminate a variableback-substitute for each variable
The reduction in one picture. Each elimination removes one variable, so three equations in three unknowns become two in two unknowns, then one in one unknown. Solving that and back-substituting walks the answer back up the chain.

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

Number the equations so the bookkeeping stays clear:

(1) x+y+z=6,(2) 2xy+z=3,(3) x+2yz=2.(1)\ x + y + z = 6, \qquad (2)\ 2x - y + z = 3, \qquad (3)\ x + 2y - z = 2.

Choose to eliminate zz. Look at the zz terms: equations (1)(1) and (2)(2) both have +z+z, while equation (3)(3) has z-z. That makes equation (3)(3) the convenient partner, because adding it to either of the others cancels zz on the spot.

Eliminate zz from the first pair, equations (1)(1) and (3)(3). Add them:

(x+y+z)+(x+2yz)=6+2,2x+3y=8.(A)(x + y + z) + (x + 2y - z) = 6 + 2, \qquad 2x + 3y = 8. \quad (A)

Now eliminate the same variable zz from a second pair, equations (2)(2) and (3)(3), using the equation not yet touched. Add them:

(2xy+z)+(x+2yz)=3+2,3x+y=5.(B)(2x - y + z) + (x + 2y - z) = 3 + 2, \qquad 3x + y = 5. \quad (B)

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

2x+3(53x)=8,2x+159x=8,7x=7,x=1.2x + 3(5 - 3x) = 8, \qquad 2x + 15 - 9x = 8, \qquad -7x = -7, \qquad x = 1.

Then y=53(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.1 + 2 + z = 6, \qquad z = 3.

The candidate is (1,2,3)(1, 2, 3). Check it in all three originals, not just the two pairs you combined:

1+2+3=6 ,2(1)2+3=3 ,1+2(2)3=2 .1 + 2 + 3 = 6 \ \checkmark, \qquad 2(1) - 2 + 3 = 3 \ \checkmark, \qquad 1 + 2(2) - 3 = 2 \ \checkmark.

All three hold, so the solution is (1,2,3)(1, 2, 3).

Check your understanding

You want to eliminate zz from the pair x+y+z=4x + y + z = 4 and x+yz=2x + y - z = 2. What do you get by adding the two equations?

Answer choices

Why the reduction works and always finishes

The routine trades a big system for a smaller one and repeats. Two things need to be true for that to be trustworthy: each step must keep exactly the same set of solutions, and the shrinking must actually stop. Both follow from what you already proved for two equations.

Why eliminating a variable preserves the solution set and terminates#

A solution of a three-equation system is a triple (x,y,z)(x, y, z) that satisfies all three equations at once, and the solution set is the collection of every such triple. The reduction must not lose any of those triples or invent new ones, and it must reach an answer in finitely many moves.

Recall the guarantee proved in the elimination lesson. Suppose you keep one equation untouched. Suppose you also replace a second equation by that second equation plus a multiple of the kept one. Then the new pair has exactly the same solutions as the old pair. That guarantee holds in both directions, because the addition and multiplication properties of equality let you build the combination and then undo it. Nothing in that argument counted the variables, so it stays true word for word when the equations carry three letters instead of two.

Now run the reduction on the system, assuming the first equation contains the variable you want to remove (if it does not, reorder the equations so it does). Keep the first equation. Replace the second equation by the second minus the right multiple of the first, choosing the multiple so the target variable cancels. By the guarantee, the solution set is unchanged. Replace the third equation the same way, subtracting a multiple of the first so its copy of the target variable cancels too; again the solution set is unchanged. The system now reads: the untouched first equation, still carrying all three unknowns, together with two equations that contain only the other two unknowns. Every triple that solves the whole system must have its two-variable part solving those last two equations.

So the work splits into stages, and each stage is strictly smaller than the one before. The two leftover equations are an ordinary two-variable system, and you proved in the last lessons that such a system resolves. Eliminate again to reach one equation in one unknown. Solve that equation, then back-substitute for the second unknown. With two of the three values in hand, the untouched first equation becomes a single equation in the last unknown, which you solve directly. Each round removes one variable, so three unknowns fall to two and then to one. The process therefore cannot run forever. It halts after as many rounds as there are variables. The identical bookkeeping applies to a system of nn equations in nn unknowns. That bookkeeping drives the system down to n1n - 1 equations, then n2n - 2, and onward to a single equation. The method is therefore not special to three unknowns; it scales to any number.

Because every step preserves the solution set, the strange endings carry a clear meaning. If a stage ever collapses to a false statement such as 0=40 = 4, then the original system had no triple satisfying it, so the system has no solution. Suppose instead a stage collapses to an always-true statement such as 0=00 = 0. That stage carried nothing new, so the triples were never narrowed down to one. Whatever equations survive then decide the outcome: infinitely many triples solve the system, or none do. With only two equations there is nothing left to decide, and the answer is infinitely many. A third equation can still contradict the others. Consider x+y+z=1x + y + z = 1 paired with 2x+2y+2z=22x + 2y + 2z = 2, which collapses to 0=00 = 0. Now add x+y+z=5x + y + z = 5 to that pair: eliminating against the first equation leaves 0=40 = 4 as well, so the enlarged system has no solution at all.

Check your understanding

After eliminating zz and solving the resulting two-variable system, you find x=1x = 1 and y=2y = 2. How do you find zz?

Answer choices

A three-variable word problem

Three-variable systems earn their keep on problems with three unknowns and three facts. A clean example is recovering unknown prices from several 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 66 dollars,
  • two popcorns, one pretzel, and three drinks cost 1313 dollars,
  • one popcorn, two pretzels, and four drinks cost 1717 dollars.

Find the price of each item.

Name the unknowns. 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=6,(2) 2p+t+3d=13,(3) p+2t+4d=17.(1)\ p + t + d = 6, \qquad (2)\ 2p + t + 3d = 13, \qquad (3)\ p + 2t + 4d = 17.

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)=1312,t+d=1.(A)(2p + t + 3d) - 2(p + t + d) = 13 - 12, \qquad -t + d = 1. \quad (A)

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

(p+2t+4d)(p+t+d)=176,t+3d=11.(B)(p + 2t + 4d) - (p + t + d) = 17 - 6, \qquad t + 3d = 11. \quad (B)

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

(t+d)+(t+3d)=1+11,4d=12,d=3.(-t + d) + (t + 3d) = 1 + 11, \qquad 4d = 12, \qquad d = 3.

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

The prices are 11 dollar for popcorn, 22 dollars for a pretzel, and 33 dollars for a drink. Check the third receipt, the one held back the longest: 1+2(2)+4(3)=1+4+12=171 + 2(2) + 4(3) = 1 + 4 + 12 = 17, correct. The other two receipts check the same way.

The geometry: three planes in space

Two variables live on a flat page, and a linear equation there draws a line. Three variables live in space, and a linear equation ax+by+cz=dax + by + cz = d draws a flat sheet stretching out forever, a plane. A system of three equations is then three planes, and a solution triple is a point lying on all three at once.

In the ordinary case the three planes tilt in different directions and meet at exactly one point, the single triple that solves the system. This is the picture behind almost every example in this lesson.

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 equation of a three-variable system is a plane in space. When the three planes tilt in general directions they cross at a single shared point, and that point is the one triple (x, y, z) solving all three equations.

Special arrangements break that single crossing, and they match the same two exceptions you met with lines. If the planes never share a common point, the system is inconsistent and has no solution. That happens when two of them are parallel, or when the three enclose a hollow like the sides of a triangular tent. If the three planes instead share a whole common line, or even coincide as one plane, then endlessly many points lie on all three. In that case the system has infinitely many solutions. The algebra flags each case for you: eliminating variables leaves a false statement in the first situation and an always-true statement in the second.

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.(1)\ x + y + z = 6, \qquad (2)\ x + 2y + 3z = 14, \qquad (3)\ 2x + 3y + 4z = 25.

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

(x+2y+3z)(x+y+z)=146,y+2z=8.(A)(x + 2y + 3z) - (x + y + z) = 14 - 6, \qquad y + 2z = 8. \quad (A)

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

(2x+3y+4z)2(x+y+z)=2512,y+2z=13.(B)(2x + 3y + 4z) - 2(x + y + z) = 25 - 12, \qquad y + 2z = 13. \quad (B)

Equations (A)(A) and (B)(B) read y+2z=8y + 2z = 8 and y+2z=13y + 2z = 13. The same expression y+2zy + 2z cannot equal both 88 and 1313. Subtract (A)(A) from (B)(B) to see it plainly:

0=5.0 = 5.

This is false, so no triple satisfies all three equations, and the system has no solution. Geometrically the three planes fail to share any common point.

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.(1)\ x + y + z = 6, \qquad (2)\ x + 2y + 3z = 14, \qquad (3)\ x + 3y + 5z = 22.

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

(x+2y+3z)(x+y+z)=146,y+2z=8.(A)(x + 2y + 3z) - (x + y + z) = 14 - 6, \qquad y + 2z = 8. \quad (A)

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

(x+3y+5z)(x+y+z)=226,2y+4z=16.(B)(x + 3y + 5z) - (x + y + z) = 22 - 6, \qquad 2y + 4z = 16. \quad (B)

Equation (B)(B) is exactly twice equation (A)(A), so it says nothing new. Subtract 22 times (A)(A) from (B)(B):

0=0.0 = 0.

The statement is always true, so the third condition was not independent, and the system has infinitely many solutions. To describe them, let z=tz = t be free. From (A)(A), y=82ty = 8 - 2t, and from equation (1)(1), x=6yz=6(82t)t=t2x = 6 - y - z = 6 - (8 - 2t) - t = t - 2. So every triple

(x,y,z)=(t2, 82t, t)(x, y, z) = (t - 2,\ 8 - 2t,\ t)

solves the system, one for each value of tt. The three planes meet along this whole line rather than at a single point.

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.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions Start →
More practice (optional)

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

More resources (optional)
A bit of history (Optional)

Why would anyone want a system with eight unknowns? Here is one answer, from 18451845.

Electricity was new, and the current inside a wire could not be measured directly. A circuit with several branches was a real puzzle. The current splits at every junction, and how it splits depends on the whole network, not on any single piece.

Gustav Kirchhoff was a student of twenty-one in Prussia, a kingdom in what is now Germany. He wrote down two rules that settled the matter. At any junction, the current arriving equals the current leaving. Around any closed loop, the voltage gained and the voltage lost cancel out. Each junction and each loop gives one equation, and each branch of the circuit is one unknown.

That is a system, and it is exactly the kind you have been reducing. A circuit with eight branches yields eight unknowns and eight equations. Nobody solves such a thing by eye. You knock out one unknown, then another, until a single one is left. Then you climb back up and pick up the rest. That is this lesson’s method, run a few more rounds.

Kirchhoff’s rules are still how engineers describe a circuit, and the tools that solve those systems still run elimination underneath. Three unknowns give you three planes meeting at a point, and that is the last picture you can draw. Past three, the geometry runs out of room and the algebra carries on without it.