Rationalising a numerator, the move calculus actually needs
Watch a perfectly sensible expression turn to rubbish as a number shrinks, then repair it with one multiplication.
Here is a quantity that turns up in the third week of every calculus course, written out in ordinary arithmetic. Take a number , take a small step beyond it, and ask how much the square root changed per unit of step:
Nothing about it looks fragile. Compute it at for steps that get smaller and smaller, and watch what happens.
Change x = 4.0 to x = 100.0 and run it again. The collapse still happens, and the value the tidy column settles on is now different. What is it, and what is its relationship to 100?
Two things are worth staring at. For the larger steps the two columns agree to all but the last digit or two, so they are computing the same quantity. For the smallest steps the first column loses its digits, wanders, and finally sits at exactly zero, while the second column does not budge.
The first column falls apart because it subtracts two numbers that have become almost identical. and agree in the first sixteen digits, the machine only keeps about sixteen, so the difference it computes is made entirely of the digits it had to throw away. Dividing that by a tiny magnifies the damage.
The second column never subtracts anything, so there is nothing to lose. And notice where it settles: , which is , which is . That number is the answer calculus will want, and the second form is how you get to it.
Where the second form came from
It is one multiplication. In the lesson on simplest form you cleared a root off the bottom of a fraction by multiplying top and bottom by a conjugate. Here the root is on the top and it is the top you want to clear, so you do exactly the same thing for the opposite reason. This is called rationalising the numerator.
The numerator is , so its conjugate is , the same two terms with the sign flipped. Multiplying top and bottom by it is multiplying by 1.
- The new numerator is , which is the pattern with and .
- Squaring a square root removes it: and .
- So the numerator is , and the s cancel, leaving on its own.
- The denominator is , left as a product rather than multiplied out, which is the whole trick.
- The fraction is now , and is a factor of both top and bottom, so it cancels.
- What is left is , which is the second column of the output.
Look at what the cancellation bought. In the original form, setting gives , which is not a number and not a question with an answer. In the new form, setting gives , an ordinary number, computed without difficulty. The two expressions are equal everywhere except at the single point where the first one refuses to speak.
- Direct form at
- 0.236068
- Rationalised form at
- 0.236068
- Where both head as shrinks
- 0.25
The first two output lines are identical for every setting, because they are the same expression. Drag h down towards 0.05 and watch the solid curve settle onto the dashed one.
A second worked example, every step
Simplify , given that is not 9.
- The root is on the top, so rationalise the numerator. The conjugate of is .
- Multiply top and bottom by , which is multiplying by 1.
- The new top is .
- The new bottom is , deliberately left unmultiplied.
- Now is a factor of both, so it cancels, leaving .
- Check with a number. At the original is , and the new form is .
- At the original is and the new form is . That number, which the original could not produce, is the point of the exercise.
Add 9.0 to the list and run it again: one column fails and the other does not. Then change both 3s to 2s and both 9s to 4s, which checks the same manoeuvre for .
Why does the rationalised form of keep its accuracy in a computer when the original does not?
Because it never subtracts two nearly equal numbers. In the original, and agree in almost all their digits when is tiny, so their difference is built from whatever digits the machine happened to keep, and dividing by a tiny then blows that error up. In the two roots are added, which loses nothing, and no small number is divided by. The algebra and the numerical stability improved for the same reason: the cancellation was done exactly, on paper, instead of approximately, in the machine.