Sub topic 6
Solving by substitution
What this chapter covers and what you should already know
This chapter assumes you can solve one-variable linear equations, evaluate an expression by plugging in a value, and work with negative numbers and fractions. It also assumes you know what a system of two linear equations is and what its solution means: an ordered pair (x, y) that makes both equations true at once. You should also know how to check a proposed solution in both equations.
Substitution turns a two-variable problem into a one-variable problem. You solve one equation for one variable, then replace that variable in the other equation. The replacement leaves an equation with a single unknown, which you already know how to solve.
The core idea
If an equation tells you that y equals some expression, then anywhere y appears you can write that expression instead. The two are the same number, so the swap changes nothing about the truth of the equation.
Take this system:
- Equation 1: y = 2x - 1
- Equation 2: 3x + 2y = 12
Equation 1 says y and 2x - 1 are the same quantity. Put 2x - 1 in place of y in Equation 2, using parentheses:
System: y = 2x - 1
3x + 2y = 12
Substitute y = 2x - 1 into the second equation:
3x + 2(2x - 1) = 12
3x + 4x - 2 = 12
7x = 14 -> x = 2
Then y = 2(2) - 1 = 3
Check: 3(2) + 2(3) = 12. Solution: (2, 3)The check above tests only the second equation. A full check tests both. For Equation 1: 2(2) - 1 = 3, which matches y = 3. Both equations hold, so (2, 3) is the solution.
The procedure
- Isolate. Pick one equation and solve it for one variable. Choose a variable with coefficient 1 or -1 if you can, because that avoids fractions.
- Substitute. Replace that variable in the other equation with the expression you found. Put the expression in parentheses.
- Solve. Solve the resulting one-variable equation.
- Back-substitute. Put the value you found into the equation from step 1 (the isolated one) to get the other variable.
- Check. Test the ordered pair in both original equations.
Worked example: isolating a variable first
Often neither equation is already solved for a variable. Consider:
- Equation 1: x + 3y = 11
- Equation 2: 2x - y = 1
In Equation 1, x has coefficient 1, so it is easy to isolate. In Equation 2, y has coefficient -1, which is also easy. Either works. Isolate y from Equation 2:
2x - y = 1
-y = 1 - 2x
y = 2x - 1Substitute into Equation 1:
x + 3(2x - 1) = 11
x + 6x - 3 = 11
7x = 14
x = 2Back-substitute into y = 2x - 1:
y = 2(2) - 1 = 3Check in both original equations: 2 + 3(3) = 11 and 2(2) - 3 = 1. Both hold. The solution is (2, 3).
Now see what happens if you isolate x from Equation 1 instead: x = 11 - 3y. Substituting into Equation 2 gives 2(11 - 3y) - y = 1, so 22 - 6y - y = 1, so -7y = -21, so y = 3. Then x = 11 - 9 = 2. The answer is the same. The choice of variable affects how much work you do, not the answer.
Why the parentheses matter
The most common error in substitution is dropping the parentheses around the substituted expression. Compare:
| Step | Correct | Common error |
|---|---|---|
| Substitute y = 2x - 1 into 3x + 2y = 12 | 3x + 2(2x - 1) = 12 | 3x + 2 · 2x - 1 = 12 |
| After distributing | 3x + 4x - 2 = 12 | 3x + 4x - 1 = 12 |
| Result | x = 2 | x = 13/7, which is wrong |
The factor 2 multiplies the whole expression 2x - 1, not only the 2x. Distribute it to both terms. The same applies to a minus sign in front of the expression. If the equation contains -(x + 4), the minus sign flips both terms: -x - 4.
Equations that produce fractions
Sometimes no variable has a coefficient of 1 or -1. Consider:
- Equation 1: 2x + 3y = 13
- Equation 2: 5x - 2y = 4
Isolating x in Equation 1 gives x = (13 - 3y)/2. Substituting into Equation 2 gives:
5 * (13 - 3y)/2 - 2y = 4Multiply both sides by 2 to clear the fraction:
5(13 - 3y) - 4y = 8
65 - 15y - 4y = 8
-19y = -57
y = 3Then x = (13 - 9)/2 = 2. The solution is (2, 3), the same system and answer you will see solved by elimination in the next chapter. The work here is longer because of the fraction. This is a signal that substitution is not the most efficient method for this system. Chapter 10 returns to that question.
When the variables vanish
Sometimes after substituting, both variables disappear and you are left with a statement that has no variable. The statement tells you the type of system.
A false statement means no solution. Take y = 2x + 1 and y = 2x - 3. Substituting the first into the second gives:
2x + 1 = 2x - 3
1 = -3This is false for every x. The lines are parallel and never meet.
A true statement means infinitely many solutions. Take x + y = 3 and 2x + 2y = 6. Isolate y in the first: y = 3 - x. Substitute into the second:
2x + 2(3 - x) = 6
2x + 6 - 2x = 6
6 = 6This is true for every x. Both equations describe the same line, so every point on it is a solution. You can describe the solution set as all pairs (x, 3 - x).
Checking your work
A check protects you against arithmetic slips and against a wrong answer from a mistake in back-substitution. Follow this routine:
- Write the ordered pair, for example (2, 3).
- Substitute it into Equation 1 as originally given, not into a rearranged version.
- Substitute it into Equation 2 as originally given.
- Confirm both sides match in both equations.
If only one equation holds, the pair is not a solution. A pair that satisfies one equation lies on one line only.
Checking against the original equations matters. If you made an error while rearranging in step 1 of the procedure, a check against your rearranged version would pass, and you would not detect the mistake.
Checking with code
You can use a short Python script to check hand-worked answers. This version solves the system with substitution logic written out step by step, then verifies the result in both equations with exact fractions.
from fractions import Fraction
def solve_by_substitution(a1, b1, c1, a2, b2, c2):
"""Solve a1*x + b1*y = c1 and a2*x + b2*y = c2 by substitution.
Returns (x, y), the string "none", or the string "infinite".
Assumes each equation has at least one nonzero coefficient.
"""
# Isolate x in equation 1 when a1 != 0: x = (c1 - b1*y) / a1.
# Substituting into equation 2 gives:
# a2*(c1 - b1*y)/a1 + b2*y = c2
# which rearranges to coef*y = rhs.
if a1 != 0:
coef = Fraction(-a2 * b1, a1) + b2
rhs = c2 - Fraction(a2 * c1, a1)
if coef == 0:
return "infinite" if rhs == 0 else "none"
y = rhs / coef
x = (c1 - b1 * y) / a1
return x, y
# a1 == 0, so equation 1 is b1*y = c1, which fixes y.
y = Fraction(c1, b1)
if a2 == 0:
return "infinite" if b2 * y == c2 else "none"
x = (c2 - b2 * y) / a2
return x, y
def check(a1, b1, c1, a2, b2, c2, x, y):
return a1 * x + b1 * y == c1 and a2 * x + b2 * y == c2
# y = 2x - 1 and 3x + 2y = 12, rewritten as 2x - y = 1 and 3x + 2y = 12
x, y = solve_by_substitution(2, -1, 1, 3, 2, 12)
print(x, y, check(2, -1, 1, 3, 2, 12, x, y)) # 2 3 True
# 2x + 3y = 13 and 5x - 2y = 4
print(solve_by_substitution(2, 3, 13, 5, -2, 4)) # (Fraction(2, 1), Fraction(3, 1))
# Parallel lines and the same line
print(solve_by_substitution(2, -1, -1, 2, -1, 3)) # none
print(solve_by_substitution(1, 1, 3, 2, 2, 6)) # infiniteThe script mirrors the hand method: when the substituted equation collapses to 0 * y = rhs, the result is "infinite" if rhs is 0 and "none" otherwise. This is the same true-or-false test you apply by hand.
Common errors and how to spot them
| Error | What it looks like | How to catch it |
|---|---|---|
| Dropping parentheses | 2 · 2x - 1 instead of 2(2x - 1) | Distribute to every term inside |
| Substituting into the same equation | Solving x = 3 - y, then putting it back into x + y = 3 | You get 3 = 3, a true but useless statement. Use the other equation |
| Forgetting to back-substitute | Reporting only x = 2 | A solution is an ordered pair. Always find both values |
| Sign error when isolating | y = 2x + 1 from 2x - y = 1 | Re-substitute a point to test the rearranged equation |
| Checking only one equation | Pair passes Equation 2 but not Equation 1 | Always check both originals |
The second error deserves attention. If you isolate a variable from Equation 1 and substitute it back into Equation 1, you are only restating that equation, and every variable cancels into an identity like 3 = 3. This is easy to mistake for the "infinitely many solutions" case. The two situations differ: in the genuine case you substituted into the other equation.
Summary of decisions
- Look for a variable with coefficient 1 or -1 to isolate. It keeps the arithmetic free of fractions.
- If an equation is already in the form y = ... or x = ..., start there.
- Substitute into the equation you did not use to isolate.
- Use parentheses every time.
- Read a vanished-variable result as a true statement (infinitely many) or a false statement (none).
- Check the pair in both original equations.
Exercise
Solve this system by substitution and check your answer in both equations: x = 3y - 4 and 2x + 5y = 14.
Show answer
Substitute x = 3y - 4 into the second equation: 2(3y - 4) + 5y = 14, so 6y - 8 + 5y = 14, so 11y = 22, so y = 2. Then x = 3(2) - 4 = 2. The solution is (2, 2). Check: 2 = 3(2) - 4 = 2 is true, and 2(2) + 5(2) = 14 is true.
Exercise
Use substitution to decide how many solutions this system has: 4x - 2y = 6 and y = 2x - 3. If it has infinitely many, describe them.
Show answer
Substitute y = 2x - 3 into the first equation: 4x - 2(2x - 3) = 6, so 4x - 4x + 6 = 6, so 6 = 6. This is always true, so the system has infinitely many solutions. Every point on the line y = 2x - 3 is a solution, which you can write as all pairs (x, 2x - 3).
Exercise
A student solves x + 2y = 8 and 3x - y = 3 by writing x = 8 - 2y, then substituting into x + 2y = 8 to get 8 - 2y + 2y = 8, so 8 = 8. They conclude there are infinitely many solutions. What went wrong, and what is the correct solution?
Show answer
The student substituted x = 8 - 2y back into the same equation it came from, which always gives a true statement. They should substitute into the other equation: 3(8 - 2y) - y = 3, so 24 - 6y - y = 3, so -7y = -21, so y = 3. Then x = 8 - 2(3) = 2. The solution is (2, 3). Check: 2 + 2(3) = 8 and 3(2) - 3 = 3.