Sub topic 1
Formulas, variables, and choosing what to solve for
A formula is an equation that relates quantities through variables, which are letters that stand for unknown or changing values. Rearranging a formula means rewriting it so that one chosen variable, the target variable, stands alone on one side.
Prerequisites
This chapter assumes you can work with fractions, negative numbers, and exponents, that you know the order of operations, and that you can solve a simple linear equation such as 3x + 2 = 11.
Keeping an equation balanced
An equation is a statement that two expressions have equal value. Think of it as a balance scale. Whatever you do to one side, you must do to the other, or the scale tilts. Every rearrangement step preserves this equality.
Inverse operations
An inverse operation undoes another operation. Addition undoes subtraction, and multiplication undoes division. Applying the inverse to both sides removes a term from the target variable's side.
Working backwards through the order of operations
Evaluating a formula follows the order of operations. Solving it reverses that order. Undo the outermost step first, then work inward.
def solve_x(y):
# From y = 2 * x + 3: subtract 3, then divide by 2
return (y - 3) / 2
print(solve_x(11)) # 4.0The function undoes the steps in reverse. It subtracts 3 first because the formula added 3 last, then divides by 2 because the formula multiplied by 2 before that.
::: callout note Always check which operation was applied last. That operation is the first one to undo. :::
Isolating a variable that appears once
When the target variable appears only once, apply inverse operations one at a time until it stands alone. Choose the operation that is outermost relative to the variable.
Choosing what to solve for
The same formula can be rearranged for any of its variables. Pick the target that the problem needs. For v = u + at, solving for t gives t = (v - u)/a, and solving for u gives u = v - at.
Exercise
Rearrange v = u + a*t to solve for a.
Show answer
Subtract u from both sides to get v - u = a*t. Then divide both sides by t, giving a = (v - u)/t.