Sub topic 13
Solving a Formula for One Variable
A formula is an equation that links several quantities, such as d = rt or P = 2l + 2w. Solving a formula for one variable means rewriting it so that the variable you want stands alone on one side. This chapter assumes you can solve two-step equations, collect variables on both sides, and distribute and combine like terms. It also assumes you can check an answer by substitution.
Why rearrange a formula
Suppose you often know the perimeter P and the length l of a rectangle and need the width w. You could solve 30 = 2(8) + 2w each time. Or you could solve P = 2l + 2w for w once and reuse the result. An equation with several letters like this is called a literal equation.
The method is the same one you already use. The only change is that the other letters stay as letters. You treat them as if they were numbers you happen to have no value for yet.
The method
- Identify the target variable, the one that must end up alone.
- Remove parentheses and combine like terms if that helps.
- Move every term that contains the target to one side, and every other term to the other side.
- If the target appears in more than one term, factor it out.
- Divide by whatever multiplies the target, or apply the inverse of whatever else is attached to it.
- Check the result with sample numbers.
Worked example 1: a two-step rearrangement
Solve P = 2l + 2w for w.
P = 2l + 2w
P - 2l = 2w subtract 2l from both sides
(P - 2l) / 2 = w divide both sides by 2So w = (P - 2l) / 2, which can also be written w = P/2 - l. With P = 30 and l = 8, this gives w = (30 - 16) / 2 = 7.
This is exactly the two-step pattern from earlier in the tutorial. The term 2l plays the role of the constant b in ax + b = c. The coefficient 2 plays the role of a.
Worked example 2: fractions in the formula
The formula that converts Fahrenheit to Celsius degrees is F = (9/5)C + 32. Solve it for C.
F = (9/5)C + 32
F - 32 = (9/5)C subtract 32
(5/9)(F - 32) = C multiply by the reciprocal 5/9So C = (5/9)(F - 32). Multiplying by the reciprocal is the same as clearing the fraction. You could instead multiply both sides by 5 first and divide by 9 at the end. Both routes give the same result.
Keep the parentheses around F - 32. The factor 5/9 multiplies the whole difference, not just F.
Worked example 3: the target appears twice
This is the case that most often causes trouble. Simple interest with the principal included gives A = P + Prt, where A is the final amount, P the starting amount, r the rate, and t the time. Solve for P.
Here P sits in two terms. You cannot divide one term by something and leave the other alone. Factor P out instead:
A = P + Prt
A = P(1 + rt) factor P out of both terms
A / (1 + rt) = P divide both sides by (1 + rt)So P = A / (1 + rt). The division is valid only when 1 + rt is not 0.
The same idea applies when the target is on both sides. Solve ax + b = cx + d for x:
ax + b = cx + d
ax - cx = d - b collect x terms on the left, other terms on the right
x(a - c) = d - b factor x out
x = (d - b) / (a - c) divide by (a - c)This is the formula behind the "variables on both sides" method, and it needs a - c to be nonzero. When a = c, you are in the no-solution or infinitely-many-solutions cases from the earlier chapter on solution types.
Worked example 4: the target is in a denominator
The thin-lens equation is 1/f = 1/u + 1/v. Solve it for v.
1/f = 1/u + 1/v
1/f - 1/u = 1/v isolate the term with v
(u - f)/(fu) = 1/v combine the fractions on the left
v = fu / (u - f) take the reciprocal of both sidesTaking the reciprocal of both sides is legal when both sides are nonzero. Notice that it flips the whole side, not each term separately. The answer is not v = f - u.
Restrictions on the rearranged formula
When you divide by an expression that contains letters, you silently assume it is not zero. A rearranged formula may therefore be valid in fewer cases than the original. The table shows some common ones.
| Original formula | Solved for | Result | Restriction |
|---|---|---|---|
| `d = rt` | `r` | `r = d/t` | `t ≠ 0` |
| `A = P(1 + rt)` | `P` | `P = A/(1 + rt)` | `1 + rt ≠ 0` |
| `ax + b = cx + d` | `x` | `x = (d - b)/(a - c)` | `a ≠ c` |
| `1/f = 1/u + 1/v` | `v` | `v = fu/(u - f)` | `u ≠ f`, `f ≠ 0`, `u ≠ 0` |
In a physical formula, these restrictions often match real limits. You cannot find a speed from a travel time of zero.
Checking a rearranged formula in code
A formula that has been rearranged can be checked with exact arithmetic. The script below uses Python's Fraction type so that no rounding errors appear. It rearranges three formulas and then confirms each one by plugging the answer back into the original.
from fractions import Fraction
def width_from_perimeter(P, l):
"""Solve P = 2l + 2w for w."""
return (Fraction(P) - 2 * Fraction(l)) / 2
def celsius_from_fahrenheit(F):
"""Solve F = (9/5)C + 32 for C."""
return Fraction(5, 9) * (Fraction(F) - 32)
def principal(A, r, t):
"""Solve A = P + P*r*t for P."""
denominator = 1 + Fraction(r) * Fraction(t)
if denominator == 0:
raise ValueError("1 + r*t is zero, so P cannot be found")
return Fraction(A) / denominator
P, l = 30, 8
w = width_from_perimeter(P, l)
print(w) # 7
print(2 * l + 2 * w == P) # True
for F in (212, -40):
C = celsius_from_fahrenheit(F)
print(C, Fraction(9, 5) * C + 32 == F) # 100 True, then -40 True
p = principal(1100, Fraction(1, 20), 2)
print(p) # 1000
print(p + p * Fraction(1, 20) * 2 == 1100) # TrueEach True is the substitution check from the earlier chapter, applied to a formula instead of a single equation. The value -40 is a useful test because both scales agree there.
Common errors
- Dividing only one term. From
P = 2l + 2w, writingw = P - 2l/2divides only2l. Put the whole numerator in parentheses:(P - 2l)/2. - Cancelling across a sum. In
(a + b)/a, you cannot cancel thea's. Cancel only common factors, not common terms. - Not factoring. When the target appears in two terms, as in
A = P + Prt, moving things around without factoring never isolates it. - Flipping term by term. Reciprocals apply to a whole side, as in worked example 4.
- Stopping with the target on both sides. If
wstill appears on the right, the job is not done.
Choosing between equivalent answers
Different correct paths can give answers that look different. For example, w = (P - 2l)/2 and w = P/2 - l are equal. Your answer is right if it matches after simplifying, so do not mark a result wrong only because it is arranged differently. You can test the equivalence with numbers, as the code above does.
Exercise
Solve A = (1/2)h(b1 + b2) for b2. State any restriction on h.
Show answer
Multiply both sides by 2: 2A = h(b1 + b2). Divide by h: 2A/h = b1 + b2. Subtract b1: b2 = 2A/h - b1, which can also be written (2A - h*b1)/h. The restriction is h ≠ 0, because the rearrangement divides by h.
Exercise
Solve S = 2πr² + 2πrh for h, then use S = 94.2, r = 3, and π = 3.14 to find h.
Show answer
Subtract 2πr²: S - 2πr² = 2πrh. Divide by 2πr: h = (S - 2πr²)/(2πr). The restriction is r ≠ 0. Substituting gives h = (94.2 - 56.52)/18.84 = 37.68/18.84 = 2.
Exercise
Solve y = mx + b for x, and then solve ax + by = c for y. Which answers need a restriction?
Show answer
First: y - b = mx, so x = (y - b)/m, which needs m ≠ 0. Second: by = c - ax, so y = (c - ax)/b, which needs b ≠ 0.
Exercise
Solve A = P + Prt for t, and say what must be true of P and r.
Show answer
Subtract P: A - P = Prt. Divide by Pr: t = (A - P)/(Pr). This needs P ≠ 0 and r ≠ 0. The target t appears in only one term, so no factoring is needed.