Sub topic 4
Solving one-step equations
This chapter covers equations that need exactly one inverse operation to isolate the variable. It 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 stand-in for a number. It also builds on the two ideas from earlier chapters: equivalent equations keep the same solution, and an inverse operation undoes another operation.
The goal: isolate the variable
A one-step equation has the variable involved in a single operation. These are the four forms:
| Form | Operation on x | Inverse | Example | Solution |
|---|---|---|---|---|
| x + a = c | add a | subtract a | x + 6 = 15 | x = 9 |
| x - a = c | subtract a | add a | x - 4 = 10 | x = 14 |
| a·x = c | multiply by a | divide by a | 3x = 12 | x = 4 |
| x / a = c | divide by a | multiply by a | x / 5 = 7 | x = 35 |
To solve, you apply the inverse operation to both sides. The variable ends up alone on one side, and the other side is the solution. The balance principle guarantees that each new equation has the same solution as the one before it.
Addition and subtraction equations
Take x + 6 = 15. The 6 is added to x, so subtract 6 from both sides.
x + 6 = 15
x + 6 - 6 = 15 - 6
x = 9On the left, +6 and -6 cancel and leave x. On the right, 15 - 6 is 9.
Subtraction works the same way in the opposite direction. For x - 4 = 10, add 4 to both sides:
x - 4 = 10
x - 4 + 4 = 10 + 4
x = 14Negative numbers need care with signs. For x + 7 = 2, subtracting 7 gives x = 2 - 7 = -5. For x - (-3) = 8, subtracting a negative is the same as adding, so the equation is x + 3 = 8 and x = 5.
Multiplication and division equations
For 3x = 12, the variable is multiplied by 3. Divide both sides by 3:
3x = 12
3x / 3 = 12 / 3
x = 4For x / 5 = 7, the variable is divided by 5. Multiply both sides by 5:
x / 5 = 7
5 · (x / 5) = 5 · 7
x = 35Division by a negative number flips the sign of the result. For -2x = 10, divide both sides by -2 to get x = -5. The coefficient (the number multiplying the variable) keeps its sign when you divide by it, so divide by -2, not by 2.
Coefficients that are fractions
When the coefficient is a fraction, dividing by it is the same as multiplying by its reciprocal. The reciprocal of a/b is b/a. For (2/3)x = 8, multiply both sides by 3/2:
(2/3)x = 8
(3/2) · (2/3)x = (3/2) · 8
x = 12Multiplying by the reciprocal turns the coefficient into 1, because (3/2)(2/3) = 1. This is usually quicker than dividing by 2/3.
Variable on the right and a lone minus sign
The variable can sit on either side. For 12 = x + 5, you can solve it as written:
12 = x + 5
12 - 5 = x
7 = xThe statement 7 = x says the same thing as x = 7, because equality is symmetric. You may flip the sides at any point.
A minus sign in front of the variable needs one extra step. In -x = 6, the coefficient is -1. Multiply or divide both sides by -1 to get x = -6. A common slip is to stop at -x = 6 and read the answer as 6.
Checking by substitution
Every solution should be checked in the original equation, not in a later line that might already contain an error. Replace the variable with your answer and confirm both sides are equal.
For -2x = 10 with x = -5, the left side is -2 · (-5) = 10, which matches the right side. For (2/3)x = 8 with x = 12, the left side is (2/3) · 12 = 8, which matches.
Solving exactly in code
Floating-point numbers can hide exact answers, since 0.1 + 0.2 is not exactly 0.3 in binary. Python's fractions.Fraction stores exact rationals. This program solves all four one-step forms and checks each answer by substitution.
from fractions import Fraction
def solve_one_step(op, a, c):
"""Solve a one-step equation exactly.
op is one of:
"add" : x + a = c
"sub" : x - a = c
"mul" : a * x = c
"div" : x / a = c
"""
a, c = Fraction(a), Fraction(c)
if op == "add":
return c - a
if op == "sub":
return c + a
if op == "mul":
if a == 0:
raise ValueError("a = 0: the equation is not a one-step equation")
return c / a
if op == "div":
if a == 0:
raise ValueError("division by zero is undefined")
return c * a
raise ValueError("unknown operation: " + op)
def check(op, a, c, x):
"""Substitute x into the original equation."""
a, c = Fraction(a), Fraction(c)
if op == "add":
return x + a == c
if op == "sub":
return x - a == c
if op == "mul":
return a * x == c
return x / a == c
cases = [
("add", 6, 15),
("sub", 4, 10),
("mul", 3, 12),
("div", 5, 7),
("mul", -2, 10),
("mul", Fraction(2, 3), 8),
("mul", "0.4", "1.2"),
]
for op, a, c in cases:
x = solve_one_step(op, a, c)
print(op, a, c, "-> x =", x, "| check:", check(op, a, c, x))The output is:
add 6 15 -> x = 9 | check: True
sub 4 10 -> x = 14 | check: True
mul 3 12 -> x = 4 | check: True
div 5 7 -> x = 35 | check: True
mul -2 10 -> x = -5 | check: True
mul 2/3 8 -> x = 12 | check: True
mul 0.4 1.2 -> x = 3 | check: TruePassing the string "0.4" to Fraction gives exactly 2/5. Passing the float 0.4 would give a nearby binary fraction instead, and the check could fail.
Decimal coefficients
Decimals follow the same rules. For 0.4x = 1.2, divide both sides by 0.4:
0.4x = 1.2
x = 1.2 / 0.4
x = 3If the division is awkward by hand, multiply both sides by 10 first to get 4x = 12, then divide by 4. Both routes give 3. The next chapters treat clearing decimals in more detail.
The process as a flow
The decision is the same each time. Identify the operation applied to the variable, then apply its inverse to both sides.
Common errors
- Operating on one side only. Writing x + 6 = 15, then x = 15 - 6 is fine because you subtracted from both sides. Writing x = 15 and dropping the 6 on the left without subtracting it on the right is not.
- Using the same operation instead of the inverse. For x + 6 = 15, adding 6 gives x + 12 = 21, which is a valid equation but does not isolate x.
- Dividing the wrong way. For 3x = 12, the answer is 12 / 3 = 4, not 3 / 12. Divide the constant by the coefficient.
- Losing a negative sign. For -x = 6, the solution is -6. For -2x = 10, it is -5, not 5.
- Misreading the order for x / a. In x / 5 = 7, multiply 7 by 5. Dividing 7 by 5 gives 7/5, which fails the check because (7/5) / 5 is 7/25.
- Skipping the check. A sign slip is easy to miss on a single line. Substituting into the original equation catches it in seconds.
Edge cases to know
- The solution can be zero. For x + 5 = 5, the solution is x = 0. A value of 0 is a valid solution and still needs to be written down.
- The solution can be a fraction. For 3x = 2, the solution is 2/3. Leave it as a fraction rather than rounding, unless the problem asks for a decimal.
- Variable names do not matter. The equation n - 9 = -3 is solved exactly like x - 9 = -3, giving n = 6.
- The result can be negative even when all inputs are positive. For x + 8 = 3, the solution is -5.
Summary of the method
- Name the operation that acts on the variable.
- Apply the inverse operation to both sides.
- Simplify to get the variable alone.
- Substitute into the original equation to check.
Exercise
Solve each equation and check your answer: (a) x - 9 = -3, (b) -4x = 28, (c) x / (-3) = 6, (d) (3/4)x = 15.
Show answer
(a) Add 9 to both sides: x = 6. Check: 6 - 9 = -3. (b) Divide both sides by -4: x = -7. Check: -4 · (-7) = 28. (c) Multiply both sides by -3: x = -18. Check: -18 / (-3) = 6. (d) Multiply both sides by 4/3: x = 20. Check: (3/4) · 20 = 15.
Exercise
A student solves 5x = 20 and writes x = 5 / 20 = 1/4. Find the error, give the correct solution, and show how substitution would have caught it.
Show answer
The student divided the coefficient by the constant instead of the constant by the coefficient. The correct step is x = 20 / 5 = 4. Substituting the student's answer gives 5 · (1/4) = 5/4, which is not 20, so the check fails. Substituting 4 gives 5 · 4 = 20, which passes.
Exercise
Using the Python function above, what would solveonestep("div", 4, -3) return, and what does it mean?
Show answer
It returns Fraction(-12, 1), printed as -12. The equation is x / 4 = -3, so multiplying both sides by 4 gives x = -12. Check: -12 / 4 = -3.