Sub topic 5
Solving Two-Step Equations
This chapter assumes you can do arithmetic with integers, fractions, and decimals, that you know the order of operations, and that you read a letter such as x as a number you have not found yet. It also assumes you have met inverse operations and one-step equations in the earlier chapters.
What a two-step equation is
A two-step equation has the variable involved in two operations. The standard shape is ax + b = c, where a, b, and c are known numbers and a is not 0. Two examples:
- 2x + 3 = 11: x is multiplied by 2, then 3 is added.
- x/4 − 5 = 1: x is divided by 4, then 5 is subtracted.
Solving takes two inverse operations, one for each step, and they must be applied in the right order. The next section explains which order.
The working model: undo in reverse order
Read the left side as a recipe that builds a value from x. For 2x + 3, the recipe is:
- Start with x.
- Multiply by 2.
- Add 3.
To get x back, undo the recipe from the last step to the first. You subtract 3, then divide by 2. This is the reverse of the order of operations. When you build the expression, multiplication and division come before addition and subtraction. When you take it apart, you remove the addition or subtraction first.
Each undo step is applied to both sides. That keeps every line equivalent to the one before, so the solution never changes.
Worked example: positive coefficient
Solve 2x + 3 = 11.
- Subtract 3 from both sides: 2x + 3 − 3 = 11 − 3, which gives 2x = 8.
- Divide both sides by 2: 2x / 2 = 8 / 2, which gives x = 4.
- Check in the original equation: 2(4) + 3 = 11. This is true.
The same procedure works when the numbers are not friendly. The function below follows the derivation exactly. It subtracts b from both sides, divides by a, and uses Fraction so the answer is exact.
from fractions import Fraction
def solve_linear(a, b, c):
"""Solve a*x + b = c exactly for x."""
a, b, c = Fraction(a), Fraction(b), Fraction(c)
if a == 0:
return "infinitely many solutions" if b == c else "no solution"
return (c - b) / a
print(solve_linear(2, 3, 11)) # 4
print(solve_linear(3, -5, 2)) # 7/3
print(solve_linear(0, 4, 4)) # infinitely many solutions
print(solve_linear(0, 4, 5)) # no solutionThe second call solves 3x − 5 = 2. Adding 5 gives 3x = 7, and dividing by 3 gives x = 7/3. The answer is not a whole number, and that is fine. A fraction is a legitimate solution, so do not assume you made a mistake because the result is not an integer.
The third and fourth calls handle a = 0. In that case x disappears, and the equation reduces to the statement b = c. If that statement is true, every number is a solution. If it is false, no number is. A later chapter treats these cases in detail. For now, remember that the formula (c − b)/a only makes sense when a is not 0.
Subtraction and negative coefficients
Many errors come from signs, so work through them on purpose.
Subtraction in the equation
Solve 5x − 7 = 18.
- Add 7 to both sides: 5x = 25.
- Divide by 5: x = 5.
The operation attached to x is "subtract 7," so its inverse is "add 7." If you treat the equation as 5x + (−7) = 18, you can see why: subtracting −7 is the same as adding 7.
A negative coefficient
Solve −3x + 4 = 19.
- Subtract 4 from both sides: −3x = 15.
- Divide both sides by −3: x = −5.
Check: −3(−5) + 4 = 15 + 4 = 19. This is true.
Dividing by a negative number is the step where signs most often slip. Divide by the coefficient including its sign. The coefficient of x here is −3, not 3.
A variable that is subtracted
Solve 10 − x = 4. Here the "b" term comes first.
- Subtract 10 from both sides: −x = −6.
- Multiply both sides by −1 (or divide by −1): x = 6.
Check: 10 − 6 = 4. This is true. The expression −x means (−1)·x, so the coefficient is −1. You cannot stop at −x = −6, because the goal is x alone, not −x.
Division as the first operation
When x is divided by a number, the inverse is multiplication.
Solve x/4 − 5 = 1.
- Add 5 to both sides: x/4 = 6.
- Multiply both sides by 4: x = 24.
Check: 24/4 − 5 = 6 − 5 = 1. This is true.
A common variant puts the addition inside a fraction: (x + 5)/3 = 4. Here the whole numerator is divided by 3, so the division is the last operation applied, and you undo it first.
- Multiply both sides by 3: x + 5 = 12.
- Subtract 5: x = 7.
So the order of undoing depends on how the expression is built. When a fraction bar groups x + 5, the order is reversed compared with x/3 + 5 = 4.
| Equation | Last operation applied | Undo first | Undo second | Solution |
|---|---|---|---|---|
| 2x + 3 = 11 | add 3 | subtract 3 | divide by 2 | x = 4 |
| x/4 − 5 = 1 | subtract 5 | add 5 | multiply by 4 | x = 24 |
| (x + 5)/3 = 4 | divide by 3 | multiply by 3 | subtract 5 | x = 7 |
| 10 − x = 4 | subtract x from 10 | subtract 10 | multiply by −1 | x = 6 |
Why dividing first also works
You can divide first when every term is divisible by the coefficient. For 2x + 6 = 14, divide every term by 2 to get x + 3 = 7, then x = 4. This is valid, but you must divide every term, including the constant. The common error is dividing only the 2x term and writing x + 6 = 7. The subtract-first order avoids this mistake, which is why it is the default method.
Common errors
- Undoing in the wrong order. From 2x + 3 = 11, dividing by 2 first gives x + 3 = 5.5 only if you divide every term. People often write x + 3 = 11 instead. Subtract first.
- Changing only one side. Every operation must be applied to both sides. If you subtract 3 from the left, subtract 3 from the right.
- Sign slips. Subtracting a negative, or dividing by a negative, flips the result's sign. Write the step out rather than doing it mentally.
- Stopping at −x. An answer such as −x = −6 is not finished.
- Rounding too early. With 3x − 5 = 2, the answer is exactly 7/3. Writing 2.33 and then substituting it back gives 1.99, which looks like a failed check. Keep fractions until the end.
Checking your answer
Substitute the solution into the original equation, not into a later line you derived. If you substitute into a later line, an earlier mistake will still look correct. For 3x − 5 = 2 with x = 7/3:
- Left side: 3(7/3) − 5 = 7 − 5 = 2.
- Right side: 2.
The two sides match, so x = 7/3 is correct.
A written solution in full
A tidy solution has one equivalent equation per line, with the operation noted. For −3x + 4 = 19:
-3x + 4 = 19
-3x = 15 subtract 4 from both sides
x = -5 divide both sides by -3
Check: -3(-5) + 4 = 19Each line has the same solution as the line above it. That is what the balance principle guarantees, and it is why the final line, x = −5, is the solution of the original equation too.
Where this leads
The two-step method is the core of everything that follows. When an equation has parentheses or several x terms, you first simplify it until it takes the ax + b = c shape, then apply the steps in this chapter. Fractions and decimals are handled the same way, either by working with them directly or by clearing them first.
Exercise
Solve 4x − 9 = 15 and then solve (x − 2)/5 = −3. Check both answers by substituting into the original equations.
Show answer
For 4x − 9 = 15, add 9 to get 4x = 24, then divide by 4 to get x = 6. Check: 4(6) − 9 = 15, which is true. For (x − 2)/5 = −3, multiply both sides by 5 to get x − 2 = −15, then add 2 to get x = −13. Check: (−13 − 2)/5 = −15/5 = −3, which is true.
Exercise
Solve 7 − 2x = 1. Explain why the coefficient of x is −2 and not 2, and say which step most often goes wrong.
Show answer
Subtract 7 from both sides to get −2x = −6, then divide both sides by −2 to get x = 3. The term 7 − 2x means 7 + (−2)x, so the coefficient is −2. The step that goes wrong is dividing by −2, where learners often divide by 2 and get x = −3. Check: 7 − 2(3) = 1, which is true.
Exercise
Use solve_linear to find x in 6x + 2 = 5, and give the exact answer. Why is 0.5 the wrong thing to report if the answer is not exact?
Show answer
solve_linear(6, 2, 5) returns (5 − 2)/6 = 1/2, printed as 1/2, which equals 0.5 exactly. In general, reporting a rounded decimal such as 2.33 for 7/3 is wrong because the rounded value does not satisfy the original equation exactly. Use the fraction.