Rearranging a formula, and the errors that ruin calculus
Solving for whichever letter you want, and a tester that will tell you when an algebra step was a lie.
A weather feed gives temperatures in Fahrenheit and your program wants Celsius. The relationship you were given runs the wrong way: tells you from , and you need from . Guessing at the inverse is a good way to get an answer that is nearly right, so here is what nearly right looks like.
No row agrees, and the gap between the two last columns is the same 14.2 degrees every time. What does a gap that never changes tell you about which operation the guess undid first? Then change the - 32 in the guess to - 17.7778 and run it again: every row is fixed, because to four places.
The guess undid the multiplication before it undid the addition, and it is wrong by tens of degrees. Rearranging is not a matter of moving symbols about until it looks right; it is undoing operations in the correct order.
The method
A literal equation is one with several letters, where you are asked to solve for a chosen one. Treat the chosen letter as the only unknown and every other letter as though it were a number you happen not to know the value of. Then peel the operations off it in reverse order, doing the same thing to both sides each time.
- Start from , solving for .
- The last thing done to was adding 32, so undo that first: subtract 32 from both sides, giving .
- The remaining operation on is multiplication by , so undo it: multiply both sides by .
- That gives . The bracket is compulsory, because the whole of was multiplied.
- Check with a value you know: water boils at and . Then .
When the target appears in more than one place
Collect every term containing the target on one side, everything else on the other, then take the target out as a common factor and divide by what is left.
Solve for .
- Move the terms together: subtract from both sides, giving .
- Move the rest away: subtract from both sides, giving .
- The left side has in both terms, so factor it out: .
- Divide both sides by : .
- This needs . If the original equation has no left in it at all, and it is either always true or never true.
A formula with the target underneath a fraction line needs the fractions cleared first, using the method from the lesson on fractions inside fractions. Solve for , a formula that describes resistors in parallel and lenses alike.
- Get the term holding on its own: subtract from both sides, giving .
- Combine the left side over the common denominator : .
- So .
- Both sides are single fractions, so turn both upside down, which is legal as long as neither side is zero: .
- Check with numbers: and predict . And indeed .
The errors, and a tester for them
An algebraic identity is a claim that two expressions agree at every value. That makes it easy to test and impossible to fudge: one value where they disagree kills the claim. This snippet is a tool worth keeping.
Change right to x ** 2 + 6 * x + 9 and run it again: zero disagreements. Then test a claim of your own, such as left returning (x + 3) ** 3 against a right you write yourself.
Every row of the table below is a claim that fails that test. They have names because they are so common, and each one is a way of pretending an operation spreads across a sum when it does not.
| The false claim | A counterexample | What is actually true |
|---|---|---|
| : 49 against 25 | ||
| : 5 against 7 | nothing simpler; leave it alone | |
| : against 2 | ||
| : against | only common factors cancel, never common terms | |
| : 5 against | ||
| : against | ||
| : 36 against 18 |
Solve for .
Divide both sides by first, since multiplies the whole bracket: . Subtract 1: . Divide by : , which tidies by multiplying top and bottom by to . Check with , , : the formula gives , and .