Systems of Equations

Solving a System of Three Equations

To solve a system of three equations, eliminate the same variable from two different pairs of equations, solve the two-variable system that results, then back-substitute for the third variable. The answer is an ordered triple (x,y,z)(x, y, z) that makes all three equations true at once, or the discovery that no such triple exists or that infinitely many do.

a1x+b1y+c1z=d1,  a2x+b2y+c2z=d2,  a3x+b3y+c3z=d3a_1x+b_1y+c_1z=d_1,\; a_2x+b_2y+c_2z=d_2,\; a_3x+b_3y+c_3z=d_3

Try it with your numbers

Show every step

Everything here builds on solving systems by elimination and solving systems by substitution with two variables. Three variables add one more layer of bookkeeping, and the sections below cover the method, the traps that cost points, and the cases where no single clean answer exists.

What is a system of three equations, and what does it mean?

Each equation such as 2x−y+3z=72x - y + 3z = 7 describes a flat plane in three-dimensional space. A system of three equations asks where three planes meet. Usually they meet at exactly one point, which is the ordered triple. They can also share a whole line, or have no point in common. A linear system never has exactly two solutions: if two points lie on all three planes, the entire line through them does too.

Drawing the planes, the idea behind solving systems by graphing, is not practical here, so algebra takes over. The geometry still explains the algebra, though. When you eliminate zz from a pair of equations, the result contains only xx and yy. That equation is the shadow, cast onto the xyxy-plane, of the line where those two planes cross. Two shadows from two different pairs are lines in a flat picture, and they cross at the (x,y)(x, y) of the answer.

Counting matters as well. Each independent equation removes one degree of freedom, so three unknowns need three independent equations. “Independent” means no equation can be built from the others, and that is exactly what fails in the special cases later on.

Quick check

Two of the three planes in a system are parallel and distinct. How many solutions does the system have?

How do you solve a system of three equations by elimination?

Elimination is safe because replacing an equation with itself plus a multiple of another can be undone, so the solution set never changes. Used twice on the same target variable, it shrinks three equations in three unknowns to two equations in two unknowns.

  1. Label the equations (1), (2), (3).
  2. Pick one variable and eliminate it from (1) and (2) to get equation (4).
  3. Eliminate the same variable from a different pair, such as (1) and (3), to get equation (5).
  4. Solve (4) and (5) as an ordinary two-variable system.
  5. Put those two values into an original equation to find the third variable.

The trap that costs the most points is eliminating yy from one pair and xx from the other. The two new equations then still involve three variables between them, and nothing has been gained.

Here is a full example.

{x+y+z=6(1)2x−y+z=3(2)x+2y−z=2(3)\begin{cases} x+y+z=6 & (1)\\ 2x-y+z=3 & (2)\\ x+2y-z=2 & (3)\end{cases}

The yy terms are the easiest to remove. Adding (1) and (2) gives 3x+2z=93x+2z=9 as equation (4). Doubling (2) and adding (3) gives 4x−2y+2z+x+2y−z=6+24x-2y+2z+x+2y-z=6+2, so 5x+z=85x+z=8 as equation (5).

From (5), z=8−5xz=8-5x. Substitute into (4): 3x+2(8−5x)=93x+2(8-5x)=9, so 3x+16−10x=93x+16-10x=9, which gives −7x=−7-7x=-7 and x=1x=1. Then z=8−5=3z=8-5=3. Put both into (1): 1+y+3=61+y+3=6, so y=2y=2. The solution is (1,2,3)(1, 2, 3).

What if a variable is missing from one equation?

A missing variable is a gift, because that equation has already done half of an elimination for you. You only need to remove the missing variable from one other pair, then combine the two-variable equations. Negatives make this a good place to be careful.

{x+y=1(1)2x−y+z=−6(2)−x+2y+3z=11(3)\begin{cases} x+y=1 & (1)\\ 2x-y+z=-6 & (2)\\ -x+2y+3z=11 & (3)\end{cases}

Equation (1) has no zz, so eliminate zz from (2) and (3). Multiply (2) by 3 to get 6x−3y+3z=−186x-3y+3z=-18, then subtract (3) in full, right side included:

(6x−3y+3z)−(−x+2y+3z)=−18−11⇒7x−5y=−29.(6x-3y+3z)-(-x+2y+3z)=-18-11 \quad\Rightarrow\quad 7x-5y=-29.

Subtracting a negative term flips its sign, and forgetting to subtract the right side is the most common slip. Now use (1) as y=1−xy=1-x: 7x−5(1−x)=−297x-5(1-x)=-29, so 12x−5=−2912x-5=-29, giving 12x=−2412x=-24 and x=−2x=-2. Then y=3y=3. From (2): −4−3+z=−6-4-3+z=-6, so z=1z=1. The solution is (−2,3,1)(-2, 3, 1), and (3) confirms it: 2+6+3=112+6+3=11.

Try this: Solve x+y=5x+y=5, y+z=7y+z=7, x+z=6x+z=6 by adding all three equations first. The sum gives x+y+zx+y+z immediately, and each variable then drops out with one subtraction. You should land on (2,3,4)(2, 3, 4).

Which variable should you eliminate first?

Choose by cost, not by habit. The cheapest variable is the one that is missing, then the one whose coefficients are already opposites, then one whose coefficients are ±1\pm1, so that any multiplier is a whole number. In the first example, yy had coefficients 11, −1-1 and 22, so a plain addition and a single doubling were enough.

Never divide early

Multiply equations to match coefficients and keep everything in whole numbers. Fractions appear only when you divide at the very end, so most arithmetic slips never get a chance.

When an equation has a variable with coefficient 11, substitution can beat elimination. Solve that equation for the variable, substitute into the other two equations, and you land on the same two-variable system. For equations like x+y=1x+y=1 this takes one line. For something like 3x+5y−2z=83x+5y-2z=8 the fractions get ugly fast, and elimination is cleaner.

Whatever you pick, stay consistent. Each new equation should be written down with its label and the operation used, for example “(1) + (2)”. When an answer fails the check later, those notes let you find the broken step in seconds instead of redoing everything.

Quick check

Add x+y−z=4x+y-z=4 and 2x−y+3z=52x-y+3z=5 to eliminate yy. What equation results?

When does a system of three equations have no solution?

Three lines forming a small triangle show three planes with no common point and no parallel pair
Viewed along the shared direction, the three planes become three lines that cross in pairs and enclose a triangle instead of meeting at one point.

Elimination announces the outcome through the last two-variable step, and it matches the geometry.

Result of elimination Meaning Planes
A value for each variable One solution Meet at a single point
A true statement such as 0=00=0 Infinitely many solutions Share a line (or coincide)
A false statement such as 0=10=1 No solution No common point

Try this system.

{x+y−z=2(1)2x−y+z=1(2)4x+y−z=6(3)\begin{cases} x+y-z=2 & (1)\\ 2x-y+z=1 & (2)\\ 4x+y-z=6 & (3)\end{cases}

Adding (1) and (2) gives 3x=33x=3, so x=1x=1. Then (1) says y−z=1y-z=1, while (3) says 4+y−z=64+y-z=6, so y−z=2y-z=2. Both cannot hold, so there is no solution. Notice that no two of these planes are parallel. Students often assume “no solution” requires parallel planes, and that belief makes them trust a false answer.

The prism case

Three planes can cross each other in pairs along three parallel lines, like the faces of a triangular tunnel. No two planes are parallel, yet no point lies on all three.

Change the 66 in (3) to 55 and the contradiction becomes y−z=1y-z=1 twice, which is the true statement 0=00=0. Now there are infinitely many solutions. Let z=tz=t, so x=1x=1 and y=t+1y=t+1, and the solution set is (1,t+1,t)(1, t+1, t) for any real tt. A quick check in (3): 4+(t+1)−t=54+(t+1)-t=5. For the two-variable version of this idea, see no solution versus infinitely many solutions.

One warning: a single 0=00=0 does not settle the matter. 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 equations eliminate to 0=00=0, but the first and third give 0=40=4. Reduce the whole system before you decide, because any contradiction anywhere means no solution.

Can Cramer’s rule solve a system of three equations?

Yes, when the coefficient determinant DD is not zero. Cramer’s rule says x=DxDx=\frac{D_x}{D}, y=DyDy=\frac{D_y}{D}, z=DzDz=\frac{D_z}{D}, where DxD_x replaces the xx column of the coefficients with the constants (and likewise for the others). The full rule is on the Cramer’s rule page.

Take the first example. Its coefficient matrix has rows (1,1,1)(1,1,1), (2,−1,1)(2,-1,1), (1,2,−1)(1,2,-1), and expanding along the first row (the method from the determinant of a 3×3 matrix) gives

D=1(1−2)−1(−2−1)+1(4+1)=−1+3+5=7.D=1(1-2)-1(-2-1)+1(4+1)=-1+3+5=7.

Replacing the first column with the constants 6,3,26, 3, 2 gives Dx=6(1−2)−1(−3−2)+1(6+2)=−6+5+8=7D_x=6(1-2)-1(-3-2)+1(6+2)=-6+5+8=7, so x=77=1x=\frac{7}{7}=1, matching the elimination result.

The second half of the story is the trap. For the no-solution system above, D=0D=0, but D=0D=0 is also what the infinite-solution version gives. A zero determinant tells you the system is not unique, never which of the other two cases it is. You still need elimination to decide. By hand, Cramer’s rule also needs four determinants, so elimination is usually faster beyond a quick check.

Where are three-variable systems used in real life?

Whenever three unknowns are tied together by three independent facts: mixing three ingredients to hit a target, splitting money among three accounts, counting three ticket types from total sales, or balancing currents in a circuit with Kirchhoff’s laws. The skill is in translation: name each unknown, then write one equation per fact.

The most elegant use is curve fitting. A line has two unknowns, so two points fix it (see slope-intercept form). A parabola y=ax2+bx+cy=ax^2+bx+c has three unknowns, so three points fix it. Fit a parabola through (1,2)(1,2), (2,3)(2,3) and (3,6)(3,6):

{a+b+c=24a+2b+c=39a+3b+c=6\begin{cases} a+b+c=2\\ 4a+2b+c=3\\ 9a+3b+c=6\end{cases}

Subtracting the first equation from the second gives 3a+b=13a+b=1. Subtracting the second from the third gives 5a+b=35a+b=3. Subtracting those two results gives 2a=22a=2, so a=1a=1. Then b=1−3=−2b=1-3=-2, and c=2−1+2=3c=2-1+2=3. The parabola is y=x2−2x+3y=x^2-2x+3.

Check all three points: 1−2+3=21-2+3=2, 4−4+3=34-4+3=3 and 9−6+3=69-6+3=6. Its discriminant is (−2)2−4(1)(3)=−8(-2)^2-4(1)(3)=-8, so it never touches the xx-axis, which you can confirm with quadratic formula practice problems.

How do you check the answer to a 3×3 system?

Substitute the triple into all three original equations, not into the derived ones. Back-substitution guarantees that the one equation you used holds, and a slip in an earlier step can leave a triple that satisfies two equations while failing the third. A failure on exactly one equation is the signature of an arithmetic error in a step that involved it.

Here is a fast routine.

  • Substitute into each original equation separately and compare both sides.
  • If the problem was a story, reread the words and test the numbers against them, since a negative price or a fraction of a person signals a setup error.
  • Add all three original equations and test the sum as a final sanity check, but never use it alone, because two errors can cancel.

For (1,2,3)(1,2,3) in the first example: 1+2+3=61+2+3=6, then 2−2+3=32-2+3=3, then 1+4−3=21+4-3=2. All three hold, so the answer stands.

Quick check

Is (2,−1,3)(2,-1,3) a solution of x+y+z=4x+y+z=4, 2x−y=52x-y=5 and x−z=1x-z=1?

Do you always need three equations for three unknowns?

For a single answer, yes. With only two independent equations in three unknowns, the planes meet in a line, so you get a family of solutions described with a parameter, as in the (1,t+1,t)(1, t+1, t) example above. With more equations than unknowns, the system is usually inconsistent unless the extra equations happen to agree with the rest.

The same steps also power larger systems. Writing a system as an augmented matrix and applying row operations is just elimination in compact form, and it is what a calculator’s rref command does. Four or five unknowns need nothing new, only more patience. If you swap the equals signs for inequality signs, the solutions become regions, covered in systems of linear inequalities.

To build speed, work through elimination method practice problems, then try the same systems with the substitution method practice problems and compare how many lines each route takes.

Practice problems

0 of 5 solved

  1. Solve {x+y+z=6y+z=5z=3\begin{cases} x+y+z=6 \\ y+z=5 \\ z=3 \end{cases}

  2. Solve {x+y+z=9x−y=1y−z=1\begin{cases} x+y+z=9 \\ x-y=1 \\ y-z=1 \end{cases}

  3. Solve {x+y+z=42x−y+z=8x+2y−z=−3\begin{cases} x+y+z=4 \\ 2x-y+z=8 \\ x+2y-z=-3 \end{cases}

  4. Solve {2x+3y−z=−13x−2y+2z=15x+y+4z=5\begin{cases} 2x+3y-z=-1 \\ 3x-2y+2z=15 \\ x+y+4z=5 \end{cases}

  5. Find aa, bb, cc so that y=ax2+bx+cy=ax^2+bx+c passes through (−1,4)(-1,4), (1,2)(1,2) and (2,7)(2,7).

Common questions

How do you solve a system of three equations with three variables?

Eliminate the same variable from two different pairs of equations to get two equations in two variables. Solve that pair, then substitute back into an original equation to find the third variable. Check the triple in all three original equations.

What does it mean if you get 0 = 0 while solving a system of three equations?

It means one equation was redundant, so the system is dependent and has infinitely many solutions, provided no other step produced a false statement. Describe the solutions by letting one variable equal a parameter such as tt.

Can a system of three linear equations have exactly two solutions?

No. A linear system has no solution, exactly one solution, or infinitely many. If two points satisfy every equation, every point on the line through them does too.

Is substitution or elimination better for three equations?

Elimination is usually cleaner because it avoids fractions and scales to larger systems. Substitution is faster when one equation has a variable with coefficient 1 or is missing a variable.

What does a zero determinant tell you about a system of three equations?

A zero coefficient determinant means the system does not have exactly one solution. It could have none or infinitely many, so you still need elimination to decide which.

How do you solve a system of three equations on a calculator?

Write the system as a 3 by 4 augmented matrix, enter it, and use the rref command. The last column of the result gives xx, yy and zz when the solution is unique.

Up next