Sub topic 9
Restrictions on the rearranged formula
Rearranging a formula is not always a free move. Many steps are only valid when some condition holds, such as "this quantity is not zero" or "this value is not negative". This chapter shows how to find those conditions, write them down, and decide which ones matter for your problem.
It assumes you can already isolate a variable that appears once, collect and factor terms, clear fractions, and undo powers and roots. It also assumes you are comfortable with the idea that an equation stays true when you do the same valid operation to both sides.
Why restrictions appear
Every step in a rearrangement is a claim that the new equation holds whenever the old one does. Some operations keep that claim true for every input. Others keep it true only under a condition.
| Operation on both sides | Always safe? | Condition or risk |
|---|---|---|
| Add or subtract the same quantity | Yes | None, as long as the quantity is defined |
| Multiply or divide by a nonzero constant | Yes | The constant must not be 0 |
| Divide by an expression containing a variable | No | The expression must not be 0 |
| Multiply by an expression containing a variable | No | If the expression can be 0, you may add false solutions |
| Square both sides | No | Can add solutions; the sign information is lost |
| Take an even root | No | The radicand must be at least 0; you must choose a sign |
| Take a reciprocal | No | Both sides must be nonzero |
The rule is simple. Before each step that is not "always safe", write down the condition under which it is legal. Keep that list. The final restrictions on your formula are the conditions you collected, plus any restrictions the original formula already had.
Zero denominators created by division
Dividing by a quantity that contains other variables is the most common source of restrictions. Take the equation from the plan:
a·x + b = c·x + d
Solving for x:
- Move the x terms to one side: a·x − c·x = d − b.
- Factor: (a − c)·x = d − b.
- Divide by (a − c): x = (d − b) / (a − c).
Step 3 divides by (a − c), so the result holds only when a ≠ c. If you skip that, the formula looks complete but fails silently on some inputs.
The excluded case is not just "undefined". Go back to step 2 with a = c, and the left side becomes 0·x = 0. Two outcomes are possible:
- If d ≠ b, the equation reads 0 = d − b, which is false. No value of x works.
- If d = b, the equation reads 0 = 0. Every value of x works.
The restriction a ≠ c marks the point where one formula stops describing a single answer. A function that applies the rearranged formula should handle the excluded case explicitly.
def solve_linear(a, b, c, d):
"""Solve a*x + b = c*x + d for x, reporting the degenerate cases."""
if a == c:
# Step "divide by (a - c)" is illegal here.
return "all x" if b == d else "no solution"
return (d - b) / (a - c)
print(solve_linear(3, 1, 1, 9)) # 4.0, since 3*4 + 1 = 13 = 1*4 + 9
print(solve_linear(2, 1, 2, 5)) # no solution
print(solve_linear(2, 5, 2, 5)) # all xA variable in a denominator
When the target sits in a denominator, you often multiply both sides by an expression, and that creates restrictions. Consider the parallel resistor formula:
1/R = 1/R₁ + 1/R₂
The steps for solving for R₂ are:
- Subtract: 1/R₂ = 1/R − 1/R₁.
- Combine over a common denominator: 1/R₂ = (R₁ − R) / (R·R₁).
- Take the reciprocal of both sides: R₂ = R·R₁ / (R₁ − R).
Here are the conditions collected along the way:
- The original formula requires R, R₁ and R₂ to be nonzero, because each appears in a denominator.
- Step 3 takes a reciprocal, so the numerator R₁ − R must be nonzero. Equivalently, R₁ ≠ R.
The second condition has a physical meaning. If R₁ equals R, then 1/R₂ would have to be 0, and no finite resistor has a reciprocal of 0. The guard in the code reflects that.
def second_resistor(r_total, r1):
# From 1/R = 1/R1 + 1/R2:
# 1/R2 = 1/R - 1/R1 = (R1 - R) / (R * R1), so R2 = R * R1 / (R1 - R)
if r1 == r_total:
raise ValueError("R1 must differ from R; otherwise R2 is undefined")
return r_total * r1 / (r1 - r_total)
print(second_resistor(2, 6)) # 3.0, since 1/6 + 1/3 = 1/2The formula is also mathematically defined for inputs that make no physical sense. If you call second_resistor(2, 1), you get −2.0. The algebra is fine, but a parallel combination is always smaller than each of its parts, so R₁ must be larger than R. This is a second kind of restriction. It comes from the situation the formula describes, not from the algebra.
Sign conditions: powers and roots
Undoing an even power is the other main source of restrictions. The area of a circle is A = π·r². Solving for r gives r = ±√(A/π). Three conditions are in play:
- The radicand must be nonnegative, so A/π ≥ 0, which means A ≥ 0.
- The ± records that both a positive and a negative number square to the same value.
- A radius is a length, so the physical context discards the negative root.
The √ symbol means the nonnegative root. That is why √(x²) equals |x|, not x. If you write x = √(x²) you are wrong for negative x. When you have x² = 9, the correct conclusion is x = 3 or x = −3, written x = ±3.
import math
def radius_from_area(area):
if area < 0:
raise ValueError("area cannot be negative")
# Only the positive root is physically meaningful for a radius.
return math.sqrt(area / math.pi)
print(round(radius_from_area(math.pi * 4), 6)) # 2.0Context decides which sign to keep. In E = ½·m·v², solving for v gives v = ±√(2E/m). If v is a speed, keep the positive root. If v is a velocity along a line, both signs describe real motions in opposite directions, and you keep both.
Restrictions on the input of the new formula
Sometimes the restriction falls on the value you plug into the rearranged formula, not on the variable you solved for. Start with y = √x. Squaring gives x = y². The new formula accepts any y, but only y ≥ 0 can come from the original, because √x is never negative. If you evaluate x = y² at y = −3, you get 9. But √9 = 3, not −3, so the original equation is not satisfied.
Squaring both sides is a step that can add solutions that do not belong. The fix is to carry the sign condition along: x = y², valid for y ≥ 0.
Restrictions that turn out to be automatic
A restriction you find in the middle of a derivation does not always remain in the final answer. Consider y = (x − 1) / (x + 2), with x ≠ −2 from the original formula. Solve for x:
- Multiply by (x + 2), which is nonzero by assumption: y·(x + 2) = x − 1.
- Expand: y·x + 2y = x − 1.
- Collect: y·x − x = −1 − 2y.
- Factor: x·(y − 1) = −(1 + 2y).
- Divide by (y − 1): x = (1 + 2y) / (1 − y).
Step 5 requires y ≠ 1. Is that a real restriction? Try y = 1 in the original: (x − 1)/(x + 2) = 1 gives x − 1 = x + 2, which says −1 = 2. No x produces y = 1, so excluding y = 1 loses nothing. The restriction is a true statement about the original formula, not a limitation of your algebra.
Now check the other direction. Could the new formula produce x = −2? Setting (1 + 2y)/(1 − y) = −2 gives 1 + 2y = −2 + 2y, which says 1 = −2. It cannot. The new formula never returns the value that the original excluded. That match between the two sets of restrictions is a good sign that the rearrangement is right.
A repeatable procedure
- Write the restrictions of the original formula: every denominator is nonzero, every even-root radicand is at least 0.
- At each step that divides, multiplies by a variable expression, squares, or roots, record its condition.
- State the final formula together with its conditions, for example "x = (d − b)/(a − c), for a ≠ c".
- Go back to the original equation and substitute each excluded case. Decide whether it has no solution, all solutions, or a different formula.
- Apply the context. Drop roots that violate physical constraints, such as negative lengths or negative absolute temperatures.
Common mistakes
- Cancelling a factor that might be zero. From x·(y − 1) = 0 you may not conclude x = 0, because y could equal 1.
- Writing x = √(x²) and ignoring the absolute value.
- Reporting both roots of a quadratic-type rearrangement without checking them against the context.
- Treating a restriction as an error in the formula. A restriction states where the formula applies. The excluded inputs usually have a meaning of their own.
- Forgetting the restrictions of the original formula. Even after rearranging, the original denominators must still be nonzero.
Exercise
Solve (x + p) / q = r for x. State every restriction that comes from the steps.
Show answer
Multiply both sides by q to get x + p = r·q, then subtract p to get x = r·q − p. The original formula divides by q, so q ≠ 0. Multiplying by q is then legal and adds no new condition. The final result is x = r·q − p, for q ≠ 0.
Exercise
Solve a·x + b = c·x + d for x when a = c and b = d. What does the result mean for the formula x = (d − b)/(a − c)?
Show answer
With a = c and b = d, both sides of the equation are identical, so every x satisfies it. The formula gives 0/0, which is undefined, so it cannot describe this case. The restriction a ≠ c is what excludes it.
Exercise
The kinetic energy formula E = ½·m·v² is solved for v as v = ±√(2E/m). State the condition on E and m for a real answer, and explain when you would keep only the positive root.
Show answer
Since 2E/m must be at least 0 and mass m is positive, E must be at least 0. If v is a speed, which is never negative, keep only +√(2E/m). If v is a signed velocity along a line, both roots are valid motions.
Exercise
From y = √x a student writes x = y² and uses it with y = −4 to get x = 16. Explain why this is wrong and state the corrected formula.
Show answer
The square root symbol returns a nonnegative number, so y = √x implies y ≥ 0. Squaring both sides lost that information, and y = −4 cannot come from the original. The corrected statement is x = y², valid for y ≥ 0. Indeed, √16 = 4, not −4.