Sub topic 3
Inverse operations: addition, multiplication, and their opposites
This chapter assumes you can do arithmetic with fractions and negative numbers, you know the order of operations, you can read notation like 3x + 2, and you can solve a simple equation such as x + 5 = 12. The previous chapter showed that an equation is a balance: whatever you do to one side, you must do to the other. This chapter covers which operations to choose, and why they work.
What an inverse operation is
An inverse operation undoes another operation. If you apply an operation and then its inverse, you get back the value you started with.
- Adding 7 and then subtracting 7 leaves a number unchanged.
- Multiplying by 4 and then dividing by 4 leaves a number unchanged.
In symbols, for any numbers x and a:
(x + a) - a = x(x - a) + a = x(x * a) / a = x, providedais not 0(x / a) * a = x, providedais not 0
Each pair works because the two steps combine into a "do nothing" step. Adding 7 then subtracting 7 is the same as adding 0. Multiplying by 4 then dividing by 4 is the same as multiplying by 1. Numbers that do nothing in this way are called identities: 0 for addition and 1 for multiplication.
| Operation | Its inverse | Combined effect |
|---|---|---|
| Add `a` | Subtract `a` | Add 0 |
| Subtract `a` | Add `a` | Add 0 |
| Multiply by `a` (`a` ≠ 0) | Divide by `a` | Multiply by 1 |
| Divide by `a` (`a` ≠ 0) | Multiply by `a` | Multiply by 1 |
| Negate (change sign) | Negate again | Multiply by 1 |
Powers and roots form another inverse pair. A later chapter covers them, because they bring the extra complication of plus or minus signs.
Why you apply the inverse to both sides
Suppose a formula says v = u + at, and you want u. The variable u currently has at added to it. Subtracting at from the right side removes it, but that changes the value of the right side. To keep the equation true, you subtract at from the left side as well:
v = u + at
v - at = u + at - at
v - at = uSo u = v - at. The step is valid because equal quantities stay equal when you subtract the same amount from each. The same reasoning holds for the other operations. You may add the same value to both sides, multiply both sides by the same value, or divide both sides by the same nonzero value.
The goal at each step is to remove whatever is attached to the target variable. Look at the target, find the operation that connects something else to it, and apply the inverse of that operation to both sides.
Worked example 1: one step with addition
The perimeter of a rectangle is P = 2L + 2W. Solve for 2L, then for L.
- The term
2Wis added to2L. Subtract2Wfrom both sides:P - 2W = 2L. Lis multiplied by 2. Divide both sides by 2:(P - 2W) / 2 = L.
The result is L = (P - 2W) / 2.
Notice that the division applies to the whole of P - 2W. This is why the parentheses are required. The expression P - 2W / 2 means something different, because division would bind only to 2W.
Worked example 2: multiplication and division
Distance equals rate times time: d = rt. To solve for t, notice that t is multiplied by r. Divide both sides by r:
d / r = rt / r
d / r = tSo t = d / r. This step has a condition. Dividing by r is only allowed when r ≠ 0. If r is 0, the formula d = rt gives d = 0 for every t, so a nonzero distance could never be traveled and the time could not be recovered from d. Whenever you divide by something that contains a variable, record the condition that it is not zero. The restrictions chapter treats this in full.
Now the other direction. For x / k = m, the variable is divided by k. Multiply both sides by k (with k ≠ 0) to get x = mk.
Subtraction and division need extra care
Addition and multiplication are commutative, which means the order of the two numbers does not matter: a + b = b + a. Subtraction and division are not: 5 - 2 and 2 - 5 differ. This causes most errors, so it helps to rewrite each one in terms of the operation that is commutative.
- Subtracting
ais the same as adding-a. - Dividing by
ais the same as multiplying by1/a, the reciprocal ofa.
Consider y = c - x, and solve for x. Here x is being subtracted from c, so x is not simply "something minus a number".
y = c - x
y - c = -x (subtract c from both sides)
c - y = x (multiply both sides by -1)The result is x = c - y. The step that introduced trouble was -x. The target must be positive before you finish, so you multiply both sides by -1. Every term on both sides changes sign. A common mistake is to flip the sign on only one side.
A temperature example uses the same ideas. Converting Celsius to Fahrenheit uses F = (9/5)C + 32. To solve for C, subtract 32 from both sides, then multiply both sides by 5/9, the reciprocal of 9/5:
F - 32 = (9/5)C
(5/9)(F - 32) = CMultiplying by a reciprocal is the same as dividing by the fraction, and it is usually the cleaner step.
Checking a rearrangement with code
You can test a rearranged formula by computing forwards and then backwards. If the two formulas are correct inverses of each other, the round trip returns your starting value.
import math
def final_velocity(u, a, t):
# v = u + a*t
return u + a * t
def acceleration(v, u, t):
# From v = u + a*t: subtract u from both sides, then divide by t.
# The division is only valid when t is not zero.
if t == 0:
raise ValueError("t must be nonzero to solve for a")
return (v - u) / t
for u, a, t in [(5, 2, 3), (0, 9.8, 2.5), (-4, -1.5, 8)]:
v = final_velocity(u, a, t)
a_back = acceleration(v, u, t)
print(u, a, t, "->", v, "->", a_back)
assert math.isclose(a, a_back)
print("round trips agree")The math.isclose function is used instead of == because floating-point arithmetic can introduce tiny rounding differences. The guard on t == 0 mirrors the written condition from the algebra. If you leave the guard out, Python raises a ZeroDivisionError for integers and floats alike, but an explicit message tells the caller what went wrong.
Common errors
- Applying the inverse to one side only. Writing
P - 2W = 2L + 2Wafter subtracting2Wfrom the left side alone breaks the balance. - Dividing only one term. From
P - 2W = 2L, writingL = P - Wdivides only2Wby 2. Divide the whole side, or divide each term:L = P/2 - W. - Using the wrong inverse. For
x - 3 = 10, the inverse of subtracting 3 is adding 3, givingx = 13. Subtracting 3 again givesx = 7, which is wrong. - Losing a negative sign. From
-x = 6, you must multiply or divide by-1to getx = -6. Writingx = 6drops the sign. - Dividing by a quantity that might be zero. Dividing by a variable assumes it is nonzero. State this assumption, or the formula may be wrong for some inputs.
- Moving a term across the equals sign without changing its sign. "Moving" a term is shorthand for applying the inverse to both sides. It is safe only if you know what the shortcut stands for.
A reliable procedure for one-step inverses
- Identify the target variable.
- Find the operation that directly attaches something to the target, whether that is adding a term or multiplying by a coefficient.
- Write down its inverse.
- Apply the inverse to the entire left side and the entire right side.
- Simplify. Use parentheses to keep grouped expressions together.
- Note any divisor that must be nonzero.
When the target has several operations attached, you apply this procedure repeatedly. Which one you remove first is the subject of the next chapter, where you will see that the order matters and follows the order of operations in reverse.
Exercises
Exercise
Solve A = P + I for P, then solve I = P r t for r. State any condition on the variables for the second result.
Show answer
For the first formula, subtract I from both sides: P = A - I. For the second, r is multiplied by P and t, so divide both sides by Pt: r = I / (P t). This is valid only when P ≠ 0 and t ≠ 0.
Exercise
Solve y = 10 - 2x for x. Show each inverse step, and check your answer with x = 3.
Show answer
Subtract 10 from both sides: y - 10 = -2x. Divide both sides by -2: x = (y - 10) / (-2), which simplifies to x = (10 - y) / 2. Check: with x = 3, y = 10 - 6 = 4. Then (10 - 4) / 2 = 3, which matches.
Exercise
A student solves P = 2L + 2W for W and writes W = P - 2L / 2. What is wrong, and what is the correct result?
Show answer
Two things are wrong. The subtraction of 2L must be applied to the entire right-hand side before dividing, and the division by 2 must apply to the whole quantity P - 2L. As written, only 2L is divided by 2. The correct result is W = (P - 2L) / 2, or equivalently W = P/2 - L.