Welcome back to Solving Systems by Elimination! This is Lesson 2 of 5, and you are building momentum through the course. In the previous lesson, you learned to eliminate a variable by adding two equations whose coefficients are opposites. Today we tackle the natural companion: systems where a variable has equal coefficients — same value, same sign. In these cases, we subtract one equation from the other to make that variable disappear.
Subtraction introduces one extra challenge that addition does not: every term in the subtracted equation must have its sign changed. A single missed sign flip can silently ruin the entire solution. This lesson puts that skill front and center so you can manage signs with confidence.
When Subtraction Is the Right Move
You already know that if a=b and c=d, adding the equations gives a+c=b+d. The same reasoning works in reverse. We can subtract one equation from the other and the result is still true:
a−c=b−d
This is the Subtraction Property of Equality, and it extends naturally to any system of equations. So when should we reach for subtraction instead of addition? Consider this system:
2x+3y=132x−y=1
Both equations contain 2x with the same coefficient. Adding them would produce 4x, doubling the variable instead of removing it. Subtracting, on the other hand, gives 2x−2x=0, and x vanishes entirely. The takeaway is straightforward: equal coefficients call for subtraction, just as opposite coefficients call for addition.
Distributing the Negative Sign
Here is the most important detail of the entire lesson: when we subtract an equation, we must negate every term in that equation — not just the first one. Subtracting Equation 2 is the same as multiplying the entire equation by −1 and then adding.
Take Equation 2 from our system: 2x−y=1. Here is what happens to each term when we negate:
Original term
Negated term
+2x
−2x
−y
+y
+1
−1
Pay close attention to the middle row: −y becomes +y, not −y. A term that is already negative becomes positive after the sign flip. This is the exact spot where most errors occur. If you only change the sign of the leading term and leave the rest untouched, every value you compute afterward will be wrong.
A helpful habit is to write out the fully negated equation on its own line before combining. That one extra line of work makes errors much easier to catch.
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
Solving a System Step by Step
Verifying the Solution
Equal Coefficients in a Billing Scenario
Conclusion and Next Steps
When a variable has equal coefficients in both equations, subtracting one equation from the other eliminates that variable. The critical skill is distributing the negative sign to every term in the subtracted equation — including terms that are already negative. After the subtraction, solve the resulting one-variable equation, back-substitute to find the second value, and verify in both original equations.
Up next, the practice exercises will challenge you to identify correctly flipped signs, perform the subtraction step in isolation, and work through full systems — including a billing scenario — entirely on your own. Master the sign changes now, and you will have a reliable tool for the rest of this course.
Step 1 — Negate every term in Equation 2. Rewrite the second equation with all signs flipped:
−2x+y=−1
Step 2 — Add the negated equation to Equation 1. Combine the left sides and right sides:
(2x+3y)+(−2x+y)=13+(−1)
The x-terms cancel (2x−2x=0), and the y-terms combine (3y+y=4y):
4y=12
Step 3 — Solve for y. Divide both sides by 4:
y=3
Step 4 — Back-substitute. Plug y=3 into either original equation. Using Equation 2:
2x−3=1⟹2x=4⟹x=2
The solution is (x,y)=(2,3).
As always, check the answer in both original equations to make sure no sign error slipped through.
Equation
Substitution
Result
2x+3y=13
2(2)+3(3)=4+9
13=13 ✓
2x−y=1
2(2)−3=4−3
1=1 ✓
Both equations balance, confirming that (2,3) is correct. Verification is especially important when subtracting, because a single missed sign change can throw off the entire solution without any obvious warning.
Equal coefficients show up naturally when two transactions share the same quantity of one item. Suppose a print shop receives two invoices from a supplier:
Invoice A: 4 reams of paper and 3 ink cartridges for $100
Invoice B: 4 reams of paper and 1 ink cartridge for $60
Letting p represent the price of one ream of paper and k the price of one ink cartridge, we write:
4p+3k=100(Invoice A)4p+k=60(Invoice B)
Both equations share the coefficient 4p, so we subtract Invoice B from Invoice A. Negating Invoice B gives −4p−k=−60. Adding that to Invoice A:
(4p+3k)+(−4p−k)=100+(−60)2k=40⟹k=20
Back-substituting into Invoice B: 4p+20=60, so 4p=40 and p=10. Each ream of paper costs $10, and each ink cartridge costs $20. A quick check confirms: 4(10)+3(20)=40+60=100 ✓ and 4(10)+20=60 ✓. Whenever two real-world scenarios share the same amount of one item, subtraction elimination is a natural fit.