Isolate any variable in a physics or finance formula using the same steps as solving equations.
Why this matters
Formulas are usually printed solved for one variable, but the question you face often asks for a different one. Ohm's law is written V = IR, yet an electronics tech often needs the resistance. A finance formula gives interest, but you want to know how long a loan runs. Rearranging (also called solving a literal equation) lets you get any variable you need from one formula, instead of memorising several versions.
The core idea
Rearranging a formula is exactly the same as solving an equation. The only difference is that the other "numbers" are letters. Pick the variable you want, then use inverse operations on both sides until it is alone.
Treat every other letter as if it were a known number. If it helps, mentally replace them with numbers first, work out the steps, then repeat the steps with letters.
Worked example 1: Ohm's law
V = I × R. Solve for R.
R is multiplied by I, so divide both sides by I:
R = V / I
Check with numbers: V = 12 volts, I = 0.5 amps gives R = 24 ohms, and 0.5 × 24 = 12. (checks out)
Worked example 2: speed, distance and time
d = v × t. Solve for t: divide both sides by v, so t = d / v.
A 450 km trip at 90 km/h takes 450 / 90 = 5 hours.
Worked example 3: temperature
The formula from Celsius to Fahrenheit is F = (9/5)C + 32. Solve for C.
- Subtract 32 from both sides: F − 32 = (9/5)C
- Multiply both sides by 5/9 (the reciprocal of 9/5): C = (5/9)(F − 32)
Check: F = 212 gives C = (5/9)(180) = 100. Water boils at 100 °C. (checks out)
Note the parentheses. (5/9)(F − 32) is not the same as (5/9)F − 32. In code, write (f - 32) * 5 / 9.
Worked example 4: simple interest
I = P × r × t, where P is the principal, r the yearly rate as a decimal, and t the time in years. Solve for t.
P and r both multiply t, so divide both sides by P × r:
t = I / (P × r)
How long until $2,000 at 4% earns $240 in simple interest? t = 240 / (2000 × 0.04) = 240 / 80 = 3 years.
Worked example 5: a variable inside a power
The area of a circle is A = πr². Solve for r.
- Divide by π: r² = A / π
- Take the square root: r = √(A / π)
A 50 cm² circle has radius √(50 / π) ≈ 3.99 cm. (We take the positive root because a length cannot be negative.)
A general strategy
- Circle the variable you want.
- List what has been done to it, in order (multiplied by, then added to, then squared, and so on).
- Undo those steps in reverse order, doing each step to both whole sides.
- Check by substituting simple numbers into the original formula and your new one.
Rearranged formulas in code
def resistance(voltage, current):
return voltage / current
def celsius(fahrenheit):
return (fahrenheit - 32) * 5 / 9
print(resistance(12, 0.5)) # 24.0
print(celsius(98.6)) # about 37.0
Common mistakes
- Dividing only part of a side. From F − 32 = (9/5)C, dividing gives (F − 32) ÷ (9/5), not F − 32 ÷ (9/5).
- Dropping parentheses when turning a formula into code.
- Forgetting units when you check. A rearranged formula should still give sensible units: V / I gives volts per amp, which is ohms.
- Dividing by a quantity that could be zero, such as t = d / v when v = 0. Note those limits.
Quick recap
- Rearranging a formula is solving an equation with letters.
- Undo operations in reverse order, applying each to both sides.
- Keep parentheses around whole sides when you divide or multiply.
- Check with easy numbers in both versions of the formula.
Try it
In the Do tab, rearrange the Fahrenheit formula for Celsius and write it as Python. The checks test freezing, boiling, body temperature and the one temperature where both scales agree.