Pre-Calculus for Programmers

Algebra foundations: the toolkit calculus never reteaches

13 / 397
Contents

Contents

Pre-Calculus for Programmers

0 of 397 complete

9 min read

Fractions inside fractions

One multiplication clears every small denominator at once, and calculus produces these constantly.

A complex fraction is a fraction with fractions inside its numerator, its denominator, or both. The name has nothing to do with complex numbers; it means stacked. Start with one made only of numbers, so the shape is visible without any letters getting in the way.

12+1314−16\frac{\dfrac{1}{2}+\dfrac{1}{3}}{\dfrac{1}{4}-\dfrac{1}{6}}
Four small denominators: 2, 3, 4 and 6.
What is that stack worth?Python

Change the - in the bottom to a + and run it again. The answer drops sharply, because the bottom stopped being a small number.

The answer is exactly 10, and there are two honest routes to it.

Method one: tidy each storey, then divide

  1. Combine the top into one fraction: 12+13=36+26=56\frac{1}{2}+\frac{1}{3} = \frac{3}{6}+\frac{2}{6} = \frac{5}{6}.
  2. Combine the bottom into one fraction: 14−16=312−212=112\frac{1}{4}-\frac{1}{6} = \frac{3}{12}-\frac{2}{12} = \frac{1}{12}.
  3. A fraction is a division, so the stack is 56÷112\frac{5}{6} \div \frac{1}{12}.
  4. Dividing is multiplying by the reciprocal: 56⋅121=606=10\frac{5}{6}\cdot\frac{12}{1} = \frac{60}{6} = 10.

Method two: multiply everything by one big denominator

Multiplying the top and the bottom of the whole stack by the same non-zero quantity does not change its value. Choose that quantity to be the LCD of all the small denominators, and every small fraction disappears in one step.

  1. The small denominators are 2, 3, 4 and 6. The smallest number all four divide is 12.
  2. Multiply the top by 12: 12⋅12+12⋅13=6+4=1012 \cdot \frac{1}{2} + 12 \cdot \frac{1}{3} = 6 + 4 = 10.
  3. Multiply the bottom by 12: 12⋅14−12⋅16=3−2=112 \cdot \frac{1}{4} - 12 \cdot \frac{1}{6} = 3 - 2 = 1.
  4. The stack is now 101=10\frac{10}{1} = 10, with no fractions left anywhere.

Both are correct. The second is usually faster, and it is much faster once letters are involved, which is what happens next.

Neither method is a trick. Both rest on the same two facts: a fraction is a division, and multiplying the top and the bottom of a fraction by the same non-zero quantity leaves its value alone. Method one uses the first fact at the end; method two uses the second fact at the start.

The one calculus hands you

Ask how much 1x\frac{1}{x} changes per unit step, in the same way the lesson on rationalising a numerator asked about x\sqrt{x}. The quantity is 1x+h−1xh\dfrac{\frac{1}{x+h}-\frac{1}{x}}{h}, and it is a complex fraction.

  1. The small denominators are x+hx+h and xx, so the LCD is x(x+h)x(x+h).
  2. Multiply the top by it: x(x+h)⋅1x+h−x(x+h)⋅1xx(x+h)\cdot\frac{1}{x+h} - x(x+h)\cdot\frac{1}{x}.
  3. In the first product (x+h)(x+h) cancels, leaving xx. In the second xx cancels, leaving x+hx+h.
  4. So the new top is x−(x+h)x - (x+h). Distribute the minus sign across the bracket: x−x−h=−hx - x - h = -h.
  5. Multiply the bottom by it too: h⋅x(x+h)h \cdot x(x+h).
  6. The stack is now −hh x(x+h)\dfrac{-h}{h\,x(x+h)}, an ordinary fraction, and hh cancels.
  7. What is left is −1x(x+h)\dfrac{-1}{x(x+h)}.
  8. At h=0h = 0 that is −1x2\dfrac{-1}{x^{2}}, an ordinary number, while the original was 00\frac{0}{0} there.

Method one gets to the same place. Combining the top into one fraction gives x−(x+h)x(x+h)=−hx(x+h)\frac{x-(x+h)}{x(x+h)} = \frac{-h}{x(x+h)}, and the stack is that divided by hh, which means multiplying by 1h\frac{1}{h}. The result is −hh x(x+h)\frac{-h}{h\,x(x+h)}, exactly what the other route produced, with one extra line of writing.

Stacked fractions are not a curiosity to be met once. Whenever a quantity is itself a fraction and you ask how quickly it changes, the answer arrives as a fraction of fractions, and the first move is always to clear the small denominators. The same shape turns up in resistances in parallel, in average speeds over two legs of a journey, and in every harmonic mean.

The stacked form and the tidy formPython

The tidy column settles on −0.25-0.25, which is −1/x2-1/x^{2} at x=2x = 2. Change x = 2.0 to x = 5.0 and predict the settling value before you press play.

Clearing the stack, seen as a picture
1x+1−1x1=−1x (x+1)\frac{\frac{1}{x+1}-\frac{1}{x}}{1} = \frac{-1}{x\,(x+1)}
-3-2.25-1.5-0.7500.41.32.23.14
minus 1 over x squared
Stacked form at x=ax = a
-0.16667
Cleared form at x=ax = a
-0.16667
Where both head as hh shrinks
-0.25

The first two output lines never disagree, because clearing a stack does not change its value. Drag h down and watch the solid curve press onto the dashed one.

Simplify 1x−13x−3\dfrac{\frac{1}{x}-\frac{1}{3}}{x-3}.

The small denominators are xx and 3, so the LCD is 3x3x. Multiplying the top by 3x3x gives 3x⋅1x−3x⋅13=3−x3x\cdot\frac{1}{x} - 3x\cdot\frac{1}{3} = 3 - x. Multiplying the bottom by 3x3x gives 3x(x−3)3x(x-3). The stack is now 3−x3x(x−3)\frac{3-x}{3x(x-3)}. Notice that 3−x=−(x−3)3-x = -(x-3), so the (x−3)(x-3) factors cancel and leave −13x\frac{-1}{3x}. Check at x=6x = 6: the original is 1/6−1/33=−1/63=−118\frac{1/6-1/3}{3} = \frac{-1/6}{3} = -\frac{1}{18}, and the answer is −118-\frac{1}{18}.

Check yourself

What should the top and bottom of 2x+3x+11x\dfrac{\frac{2}{x}+\frac{3}{x+1}}{\frac{1}{x}} be multiplied by to clear every small fraction in one step?

All lessons in Pre-Calculus for Programmers