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

Systems in Three Variables

Learning goals

  • Picture each equation as a plane in space
  • Eliminate forward to triangular form, then back-substitute
  • Sort the outcome into point, line, plane or empty
  • Read a false row as empty and a zero row as free
  • Parameterize a line or plane with a letter per free variable
  • Note the routine is mechanical, which is why a matrix can run it

From a line to a plane

A linear equation in three variables has the standard form

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

with numbers aa, bb, cc, dd (and aa, bb, cc not all zero) and each variable to the first power only. Its solutions are ordered triples (x,y,z)(x, y, z), three numbers at once. Compare the counting. In two variables an equation ax+by=cax + by = c leaves one degree of freedom: pick xx and yy is forced, so the solutions sweep out a line. In three variables an equation ax+by+cz=dax + by + cz = d leaves two degrees of freedom: pick xx and yy freely and zz is forced, so the solutions sweep out a two-dimensional sheet, a plane. Going up one variable lifts the picture up one dimension.

A two-variable equation is a line; a three-variable equation is a planeOn the left, axes with a slanted line through them. On the right, a tilted parallelogram representing a plane in space.two variablesa linethree variablesa plane
One equation, one dimension up. In two variables the solutions of ax + by = c fill a line in the plane; in three variables the solutions of ax + by + cz = d fill a flat plane in space. Each extra variable adds a degree of freedom to the solution set.

A system of three linear equations stacks three of these and asks for the triples satisfying all three at once. Geometrically it stacks three planes and asks which points lie on every one. That is why solving a three-variable system is the study of how planes can intersect.

The elimination algorithm: reduce to triangular form

You met elimination as a way to cancel a variable by adding or subtracting equations. The previous lessons also proved the key fact we lean on: replacing one equation by itself plus a multiple of another changes nothing about the solution set. The upgrade here is to stop combining pairs at random and instead aim at a target shape. Use the first equation to remove xx from the other two, then use the new second equation to remove yy from the third. What remains is a triangular (staircase) system: the first equation still carries all three unknowns, the second carries only two, the third carries only one.

Triangular form and back-substitutionAn upper-triangular staircase of shaded cells over columns x, y, z, with the diagonal pivots outlined and an upward back-substitution arrow.xyz= 4= 1= 3xyzyzzback-substitute
The target shape. Forward elimination clears the lower-left entries so each equation begins one variable later than the one above it, leaving a staircase. The bottom row has a single unknown; back-substitution then climbs the stairs, solving for z, then y, then x.

The bottom equation has one unknown, so you solve it outright. Carry that value up into the second equation and solve for its second unknown. Carry both up into the first equation and solve for the last. This forward sweep to triangular form, then the climb back up, is a fixed procedure you can run without inventing anything. Two lessons from now you will drop the letters and record only the coefficients in a rectangular array called a matrix, and this identical sweep becomes a purely mechanical routine. For now keep the letters, so the reasoning stays visible.

Worked example 1 Solve x+y+z=4x + y + z = 4, x+2y+3z=5x + 2y + 3z = 5, 2x+3y+z=122x + 3y + z = 12

Number the equations to keep the bookkeeping honest:

(1) x+y+z=4,(2) x+2y+3z=5,(3) 2x+3y+z=12.(1)\ x + y + z = 4, \qquad (2)\ x + 2y + 3z = 5, \qquad (3)\ 2x + 3y + z = 12.

Use equation (1)(1) to clear xx from the other two. Subtract (1)(1) from (2)(2), and subtract 22 times (1)(1) from (3)(3):

(2)(1): y+2z=1,(3)2(1): yz=4.(2) - (1): \ y + 2z = 1, \qquad (3) - 2(1): \ y - z = 4.

Now clear yy from the second of these by subtracting it from the first, which leaves a single equation in zz:

(y+2z)(yz)=14,3z=3.(y + 2z) - (y - z) = 1 - 4, \qquad 3z = -3.

The system is now triangular, one variable dropping away at each step:

x+y+z=4y+2z=13z=3\begin{array}{rrrcr} x & +\, y & +\, z & = & 4 \\[2pt] & y & +\, 2z & = & 1 \\[2pt] & & 3z & = & -3 \end{array}

Climb from the bottom. The last row gives z=1z = -1. Put that into the middle row:

y+2(1)=1  y=3.y + 2(-1) = 1 \ \Rightarrow \ y = 3.

Put y=3y = 3 and z=1z = -1 into the top row:

x+3+(1)=4  x=2.x + 3 + (-1) = 4 \ \Rightarrow \ x = 2.

The candidate is (2,3,1)(2, 3, -1). Check it in all three originals, including the one you touched last:

2+31=4 ,2+63=5 ,4+91=12 .2 + 3 - 1 = 4 \ \checkmark, \qquad 2 + 6 - 3 = 5 \ \checkmark, \qquad 4 + 9 - 1 = 12 \ \checkmark.

The three planes meet at the single point (2,3,1)(2, 3, -1).

Check your understanding

A system has been reduced to the triangular form xy+2z=1x - y + 2z = 1, y+z=5y + z = 5, and 4z=84z = 8. What is xx?

Answer choices

A word problem in three unknowns

Three unknowns need three independent facts, and each fact becomes one equation. The elimination routine solves the resulting system the same way, whether the third fact is a full weighted total or a plain relationship between the unknowns.

Worked example 2 A three-way coffee blend

A roaster builds a 1212-pound blend from three coffees. The three coffees are a house roast at 66 dollars per pound, a dark roast at 99 dollars per pound, and a decaf at 1212 dollars per pound. The blend costs 102102 dollars in all, and the roaster uses as much house roast as dark and decaf combined. How many pounds of each go in?

Let hh, dd, and kk be the pounds of house, dark, and decaf. The three facts become

(1) h+d+k=12,(2) 6h+9d+12k=102,(3) h=d+k.(1)\ h + d + k = 12, \qquad (2)\ 6h + 9d + 12k = 102, \qquad (3)\ h = d + k.

Divide equation (2)(2) by 33 to shrink the numbers, and rewrite equation (3)(3) with all terms on one side:

(2) 2h+3d+4k=34,(3) hdk=0.(2')\ 2h + 3d + 4k = 34, \qquad (3')\ h - d - k = 0.

Use (3)(3') to clear hh. Subtract (3)(3') from (1)(1), and subtract 22 times (3)(3') from (2)(2'):

(1)(3): 2d+2k=12  d+k=6,(2)2(3): 5d+6k=34.(1) - (3'): \ 2d + 2k = 12 \ \Rightarrow \ d + k = 6, \qquad (2') - 2(3'): \ 5d + 6k = 34.

Those two equations are an ordinary two-variable system. Subtract 55 times the first from the second to strip out dd:

(5d+6k)5(d+k)=3430,k=4.(5d + 6k) - 5(d + k) = 34 - 30, \qquad k = 4.

Then d=6k=2d = 6 - k = 2, and h=d+k=6h = d + k = 6. Check the cost, the fact held back longest:

6(6)+9(2)+12(4)=36+18+48=102 .6(6) + 9(2) + 12(4) = 36 + 18 + 48 = 102 \ \checkmark.

The blend takes 66 pounds of house roast, 22 pounds of dark, and 44 pounds of decaf.

The shape of the solution set

Every example so far ended at one point, but that is only the most common ending. Recall the two-variable result from the previous lesson: a system there is consistent (has a solution) or inconsistent (none). A consistent system is in turn either independent (exactly one solution) or dependent (infinitely many). The infinite case had a single shape, a whole line where two equations described the same line. Space adds a dimension, and with it a new possibility. A dependent system in three variables can leave the solutions filling a line or filling an entire plane, so the catalog grows from three entries to four.

The four intersection patterns of three planesA two by two catalog: a point, a line, a coincident plane, and three parallel planes with no common intersection.one pointunique solutiona lineinfinitely manya planeinfinitely manyemptyno solution
What three planes can do. They cross at one point (a unique solution), or lean on a shared line, or coincide as a single sheet (both give infinitely many solutions), or fail to share any point at all (no solution). These four are the only possibilities.

Why exactly these four, and never a stray answer like two points? The triangular form settles it. The count that matters is how many equations survive the forward sweep as genuine constraints.

Why the solution set is a point, a line, a plane, or nothing#

Run the forward elimination until the system is triangular. Each step replaces one equation by itself plus a multiple of another, and the earlier lessons proved that such a step neither loses a solution nor invents one. So the triangular system has exactly the solutions the original did. Read it from the bottom up.

First, a row may collapse to 0=k0 = k with k0k \neq 0. No triple can make 00 equal a nonzero number, so the system has no solution and its solution set is empty. Set that case aside.

Otherwise every surviving row genuinely constrains the unknowns. Call a variable a pivot when it is the first variable still present in some row of the triangular system. That row pins its pivot down as soon as the variables after it are known. A variable that is never a pivot is free, meaning you may hand it any value you like. Suppose rr of the rows survive as real constraints, so there are rr pivots and 3r3 - r free variables. Back-substitution then determines each pivot uniquely from whatever values the free variables were given. So the solutions are exactly the triples you sweep out by running the free variables through all their choices.

Now count. If r=3r = 3, no variable is free, back-substitution forces one value for each unknown, and the solution set is a single point. If r=2r = 2, one variable is free; letting it run traces a one-parameter family of triples, which is a line. If r=1r = 1, two variables are free, and the two-parameter family they generate fills a plane. A count of r=0r = 0 would need all three equations to vanish, which cannot happen for a genuine system, and no other value of rr exists. So a consistent three-variable system has one solution, a line of them, or a plane of them. Such a system never has exactly two solutions, or any other finite count past one, because a single free variable already delivers infinitely many. Together with the empty case, the complete catalog is point, line, plane, or nothing.

Check your understanding

Elimination turns a three-equation system into x+y+z=2x + y + z = 2 and yz=1y - z = 1, with the third equation reduced to 0=00 = 0. What is the solution set?

Answer choices

Degenerate systems and how to read them

When the sweep ends anywhere but three clean pivots, the arithmetic tells you which shape you have. A false row (0=k0 = k with k0k \neq 0) means no solution, and it overrides everything else. If no row is false, then a vanishing row (0=00 = 0) is a redundant constraint, so a variable is free and you parameterize. To parameterize, name each free variable with a letter and solve for the rest in terms of it.

Worked example 3 A vanishing row: the solutions form a line

Solve

(1) x+3y+z=3,(2) x+y+z=1,(3) x+5y+3z=5.(1)\ x + 3y + z = 3, \qquad (2)\ -x + y + z = 1, \qquad (3)\ -x + 5y + 3z = 5.

Clear xx using equation (1)(1). Add (1)(1) to each of the others, since their xx terms are x-x:

(1)+(2): 4y+2z=4  2y+z=2,(1)+(3): 8y+4z=8  2y+z=2.\begin{aligned} (1) + (2): \ 4y + 2z &= 4 \ \Rightarrow \ 2y + z = 2, \\ (1) + (3): \ 8y + 4z &= 8 \ \Rightarrow \ 2y + z = 2. \end{aligned}

Both reductions give the identical equation 2y+z=22y + z = 2, so subtracting one from the other leaves 0=00 = 0. The third equation carried no new information. Only two real constraints survive, equation (1)(1) and 2y+z=22y + z = 2, so r=2r = 2 and one variable is free: the solutions form a line.

Parameterize. In 2y+z=22y + z = 2, set z=2tz = 2t so the division by 22 comes out clean; as tt runs over all numbers, z=2tz = 2t still reaches every value. Then

2y+2t=2  y=1t.2y + 2t = 2 \ \Rightarrow \ y = 1 - t.

Recover xx from equation (2)(2), x+y+z=1-x + y + z = 1:

x+(1t)+2t=1  x+1+t=1  x=t.-x + (1 - t) + 2t = 1 \ \Rightarrow \ -x + 1 + t = 1 \ \Rightarrow \ x = t.

Every solution has the form

(x,y,z)=(t, 1t, 2t),(x, y, z) = (t,\ 1 - t,\ 2t),

one triple for each value of tt. Check the held-back equation (3)(3): $-t + 5(1 - t) + 3(2t) = -t + 5 - 5t

  • 6t = 5foreveryfor everyt$. The three planes share this whole line.

Worked example 4 A false row: no solution

Solve

(1) x+y+2z=4,(2) 2x+3y+z=5,(3) 3x+4y+3z=12.(1)\ x + y + 2z = 4, \qquad (2)\ 2x + 3y + z = 5, \qquad (3)\ 3x + 4y + 3z = 12.

Clear xx with equation (1)(1). Subtract 22 times (1)(1) from (2)(2), and 33 times (1)(1) from (3)(3):

(2)2(1): y3z=3,(3)3(1): y3z=0.(2) - 2(1): \ y - 3z = -3, \qquad (3) - 3(1): \ y - 3z = 0.

The same expression y3zy - 3z cannot equal both 3-3 and 00. Subtract the first from the second to see it:

0=3.0 = 3.

This row is false, so no triple satisfies all three equations. The system is inconsistent, and the three planes enclose space without ever sharing a common point.

Worked example 5 Two vanishing rows: the solutions form a plane

Solve

(1) 2xy+z=3,(2) 4x+2y2z=6,(3) 6x3y+3z=9.\begin{aligned} (1)\ 2x - y + z &= 3, \\ (2)\ -4x + 2y - 2z &= -6, \\ (3)\ 6x - 3y + 3z &= 9. \end{aligned}

Look before computing. Equation (2)(2) is exactly 2-2 times equation (1)(1), and equation (3)(3) is exactly 33 times equation (1)(1). Elimination confirms it: adding 22 times (1)(1) to (2)(2) gives 0=00 = 0, and subtracting 33 times (1)(1) from (3)(3) gives 0=00 = 0. Both extra rows vanish, so only r=1r = 1 constraint survives. With 31=23 - 1 = 2 free variables, the solution set is a whole plane, namely the single plane 2xy+z=32x - y + z = 3 that all three equations describe.

Parameterize with two letters. Solve for yy, whose coefficient is 1-1 so no fractions appear, and let the other two run free as x=sx = s and z=tz = t:

2xy+z=3  y=2x+z3=2s+t3.2x - y + z = 3 \ \Rightarrow \ y = 2x + z - 3 = 2s + t - 3.

Every solution has the form

(x,y,z)=(s, 2s+t3, t),(x, y, z) = (s,\ 2s + t - 3,\ t),

one triple for each pair (s,t)(s, t). Two free letters sweep out a two-dimensional sheet, which is exactly what it means for the answer to be a plane.

Check your understanding

A system reduces to x+z=3x + z = 3 and yz=1y - z = -1, with the third equation vanishing. Writing z=tz = t, which parameterization gives all the solutions?

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)

Other explanations of this lesson, if you want a second take.

A bit of history (Optional)

A surveyor measures the same corner of a field again and again. The readings never quite agree, because no instrument is perfect. To draw the map you must fit one set of numbers to every reading at once. That fit is a large system of linear equations, and for a century it was solved by hand.

Wilhelm Jordan taught the measuring of land in Germany in the eighteen hundreds. He wrote the handbook his profession worked from, and he was writing for people who had to do the arithmetic. His edition of 1888 lays the elimination out as a routine, where everything has a fixed order and a place on the page to be recorded.

His alteration to the method is small, and worth knowing. You cleared each variable out of the rows below it, and then you climbed the staircase again to recover the rest. Jordan simply keeps clearing. He removes each variable from the rows above it as well, so the staircase flattens out completely. Nothing is left to climb. When the sweep halts, every row already reads as one variable equal to one number.

That version spends more arithmetic in the middle and none at the end, and it carries his name today. A machine usually goes the other way. Clearing the rows above costs arithmetic that back-substitution gets for less. The older sweep also holds up better on awkward numbers. Jordan’s version earns its keep when the flattened form itself is what you want, or an inverse written out. Your forward sweep is the first half of it, and back-substitution is the half a surveyor wrote out of the job.