In the first lesson of Three-Variable Systems and a First Look Beyond, you learned to read a system of three equations, picture it as three planes in space, and test whether a candidate triple truly satisfies all three. That was the inspection work. In this second lesson, we start building.
Solving for three unknowns in one sweep is more than anyone should attempt at once. So we do something smarter: we take three equations in three variables and turn them into two equations in two variables — familiar territory from the substitution and elimination courses. That single shrinking step is the entire focus of this lesson.
The Big Idea: Trade a Variable for Familiar Ground
You may recall from elimination that adding two equations whose coefficients on one variable are opposites makes that variable disappear, and subtracting does the same job when those coefficients are identical. Adding a third variable to the mix changes nothing about that mechanic. Combining two three-variable equations still cancels one variable, and what survives is an equation in the remaining two.
Here is a receipt version of the same idea. Suppose two grocery trips each included exactly one identical bag of coffee, along with different amounts of other items. Comparing the two totals by subtraction wipes the coffee out of the comparison entirely, leaving a statement about only the other items.
The plan, in one line: perform that cancellation twice, on two different pairs of equations, always targeting the same variable. The result is a two-variable system you can already finish with the tools you own.
Choosing Which Variable to Eliminate
Before combining anything, we scan the coefficients and pick the easiest target. In this lesson we work only with systems whose coefficients already align — meaning some variable appears with matching or opposite coefficients across the equations, so no scaling is required. Here is our first system:
Laying the coefficients out in a grid makes the choice obvious:
Equation
x
y
z
(1)
1
1
1
(2)
2
−1
3
(3)
3
1
−2
The y column is the friendly one: 1, −1, 1. Equation (2) carries the opposite sign of the other two, so adding it to either one cancels y on the spot. The x and z columns would both need scaling first, which is exactly what the next lesson handles.
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
Picking the Two Pairs
Eliminating by Adding
Eliminating by Subtracting
Why the Solution Survives
Where Reductions Go Wrong
Conclusion and Next Steps
In this lesson, we cut a three-variable system down to a size we already know how to handle. Scan the coefficient columns to find the variable that cancels most easily, choose two distinct pairs of equations so all three get used, then add or subtract each pair to remove that same variable twice. What emerges is a two-variable system that still carries the original solution's values for the two remaining variables.
Now it is your turn to run the procedure. In the exercises ahead, you will plan an elimination, assemble both combined equations, reduce one system by adding and another by subtracting, and verify that the known triple still satisfies your reduced pair. Let's start shrinking some systems!
With three equations there are only three possible pairs to combine: (1) with (2), (1) with (3), and (2) with (3). We need two of them, and one rule keeps the reduction honest: every original equation must be used at least once. Conveniently, any two distinct pairs automatically satisfy that rule, since two pairs drawn from three equations can never miss one.
In our system, y cancels by addition only when equation (2) is in the mix, so the natural choice is the pair (1) and (2), together with the pair (2) and (3). Equation (2) does double duty here, which is completely fine and quite common.
Now the arithmetic. Add equations (1) and (2) term by term, right-hand sides included:
x+y+z2x−y+3z3x+0y+4z​=6=9=15​​
The y terms cancel, leaving 3x+4z=15. Repeat with equations (2) and (3):
2x−y+3z3x+y−2z5x+0y+z​=9=−1=8​​
That gives 5x+z=8, so the reduced system is
{3x+4z=155x+z=8​
Two equations, two variables — and crucially, both involve the same two variables, x and z. That match is what makes the pair solvable. Eliminating the same variable both times makes this the common outcome, but a third variable can also cancel incidentally in one of the reductions, so always confirm afterward that the two results together form a usable system.
When the target coefficients are equal rather than opposite, we subtract. Consider a system in which every x coefficient is 1, so x is the obvious target:
Subtraction rewards care, because the minus sign applies to every term of the second equation, constant included. Computing (1)−(2) and then (3)−(2):
The reduced system is 4y−3z=7 and 3y+2z=1 — again, both in the same two variables. If subtraction makes you uneasy, multiply the second equation by −1 first and then add; the result is identical and the sign traps mostly disappear.
Reduction would be worthless if it quietly changed the answer, so let's confirm that it does not. Adding or subtracting two true equations always produces another true statement, which means any triple satisfying the originals must also satisfy every combination built from them.
Our first system has the solution (1,2,3), and the reduced equations use only x and z:
3x+4z=3(1)+4(3)=15 ✓
5x+z=5(1)+3=8 ✓
Both hold. Geometrically, each combined equation describes a new plane that still passes through the meeting point of the originals, so the solution cannot slip away during reduction. That property is also a free error check: if the known triple fails one of your reduced equations, the arithmetic went wrong somewhere. Note that the reduced equations no longer contain y, so you must return to an original equation to recover its value; the reduced system carries the solution's remaining-variable information but cannot stand alone as a substitute for the originals.
The procedure is mechanical once the plan is set, and the mistakes that show up are refreshingly predictable:
Switching targets midway. Cancelling y in one pair and z in the other leaves two equations with no shared pair of variables, and nothing can be solved from them.
Reusing the same pair. Combining (1) and (2) twice, in either order, adds no new information and leaves equation (3) out of the story entirely.
Forgetting the constant. The right-hand side is part of the equation and travels through the addition or subtraction with everything else.
Dropping a sign while subtracting. Subtracting −yaddsy; negating the whole equation and adding avoids most of these slips.
A quick safeguard after both combinations: confirm the target variable is genuinely gone from each result and that the two reduced equations together form a usable system.