Part 15 · Knowledge and Science
Calculus
The mathematics of things that change — how fast something is changing at an instant, and how much piles up over time or across a shape. Explained in plain terms with worked examples, from the strongest beam you can cut from a log to the flow of a stream and the cooling of a pot.
- Difficulty
- ●●●●●
- Time
- A few months of steady study to use it with confidence; the core ideas in this chapter take a week
- Steps from zero
- 4 prerequisites →
This unlocks
—The full path from nothing — 4 steps before this one
Do them roughly in this order. See it on the tech tree →
Why it matters
Be honest with yourself about this one. You can build mills, smelt iron, raise cathedrals and sail oceans without calculus — people did, for thousands of years. Rules of thumb, Geometry and Trigonometry and careful testing carry you a very long way.
But calculus is the language in which almost all of modern physics and engineering is written. It tells you exactly how far a stone falls, how a beam bends, how much work a The Steam Engine does in a stroke, how fast a tank drains, how a current rises in a coil, how a planet moves. Once you need to predict the behaviour of something before building it — a bridge, a boiler, a The Generator, a Radio circuit, an aircraft — you need calculus. It is also how you get the best shape for a given purpose: the strongest beam, the cheapest container, the most efficient angle.
Calculus asks only two questions:
- How fast is it changing right now? (the derivative)
- How much has piled up altogether? (the integral)
And its great discovery is that these two questions are the reverse of each other.
This chapter assumes Algebra (formulas, powers, graphs, quadratic equations) and Geometry and Trigonometry (areas, slopes, angles).
How it works
The derivative: speed at an instant
A cart covers 60 m in 20 seconds. Its average speed is 60 ÷ 20 = 3 m/s. Easy. But what about a stone falling down a well, which speeds up every moment? What is its speed at exactly 2 seconds?
From Algebra, a dropped stone falls d = 4.9 × t² metres in t seconds. Work out the average speed over shorter and shorter stretches starting at t = 2:
| From | To | Distance fallen in that time | Average speed |
|---|---|---|---|
| 2 s | 3 s | 44.1 − 19.6 = 24.5 m | 24.5 m/s |
| 2 s | 2.1 s | 21.609 − 19.6 = 2.009 m | 20.09 m/s |
| 2 s | 2.01 s | 19.79649 − 19.6 = 0.19649 m | 19.649 m/s |
| 2 s | 2.001 s | 0.0196049 m | 19.6049 m/s |
The averages close in on 19.6 m/s. That is the speed at exactly 2 seconds. On a graph it is the slope of the curve at that point — the steepness of a straight line that just touches the curve there (the tangent).
Do the same at any time t and you find the speed is always 9.8 × t. So the derivative of 4.9t² is 9.8t. The general rule behind this is short and powerful:
The derivative of xⁿ is n × xⁿ⁻¹. Bring the power down in front, and lower the power by one.
| Quantity | Its derivative (rate of change) |
|---|---|
| a constant number | 0 (it doesn't change) |
| x | 1 |
| x² | 2x |
| x³ | 3x² |
| 4.9t² | 9.8t |
| a sum, like x³ + 5x | the sum of the derivatives: 3x² + 5 |
| sin x (with x in radians — see below) | cos x |
| cos x | −sin x |
(A radian is the angle at which the arc of a circle equals its radius: about 57.3°. Calculus with sines only comes out this neatly when angles are measured in radians. To convert, multiply degrees by π/180.)
Derivatives are everywhere once you look: speed is the rate of change of distance; acceleration is the rate of change of speed; the steepness of a road is the rate of change of height with distance; the current in a wire is the rate at which charge flows.
Method 1: Finding the best
At the very top of a hill or the very bottom of a valley, the ground is level for a moment — its slope is zero. So to find the largest or smallest possible value of anything, write a formula for it, find the derivative, and set the derivative equal to zero.
Worked example 1 — the biggest pen. You have 40 m of fence for three sides of a pen against a wall. Depth x, length along the wall 40 − 2x. Area A = 40x − 2x². Derivative: 40 − 4x. Set it to zero: x = 10. A 10 m by 20 m pen encloses 200 m², the most possible. (In Algebra we found that 250 m² is impossible; now we know why.)
Worked example 2 — the biggest box from a sheet. From a square sheet of tin or leather 60 cm on a side, cut a square of side x from each corner and fold up the sides. What x holds the most?
- Volume V = x × (60 − 2x) × (60 − 2x) = 3,600x − 240x² + 4x³.
- Derivative: 3,600 − 480x + 12x².
- Set to zero and divide by 12: x² − 40x + 300 = 0, so (x − 10)(x − 30) = 0.
- x = 30 leaves no base at all; so cut 10 cm squares. The box is 40 × 40 × 10 cm and holds 16 litres — more than any other choice.
Worked example 3 — the strongest beam from a round log. The strength of a rectangular beam laid on edge grows with its width b times the square of its depth h (deep beams are much stronger — see Timber Framing and Log Building). Cut from a log of diameter d, the corners of the rectangle must touch the circle, so b² + h² = d² (Pythagoras). Strength is proportional to b × (d² − b²) = d²b − b³. Derivative: d² − 3b². Zero when b = d ÷ √3 = 0.577 d, and then h = 0.816 d. The depth should be √2 ≈ 1.4 times the width.
From a log 30 cm across, cut a beam 17.3 cm wide and 24.5 cm deep, and lay it on its narrow edge. Carpenters marked it out with the simple construction in the drawing for centuries. (For the stiffest beam — the one that sags least — the same method gives a depth √3 ≈ 1.7 times the width.)
Method 2: Adding up — the integral
Turn the question around. A cart's speed changes; how far has it gone? If the speed were constant you would multiply speed × time — the area of a rectangle on a speed–time graph. When it varies, the distance is the area under the speed curve. Find it by slicing the area into thin strips, finding each strip's area, and adding them up. Thinner strips give a better answer; the exact limit is the integral.
By strips: the flow of a stream
You want to know how much water a stream carries — to judge a site for a The Waterwheel or Water Turbines and Hydroelectric Power.
- Stretch a cord across the stream. Every 1 m along it, measure the depth with a marked pole: 0, 0.3, 0.5, 0.6, 0.5, 0.2, 0 m.
- Trapezium rule. Each strip is a trapezium of width 1 m with the two depths as its sides; its area is the average of the two depths × width. Adding all strips comes to a simple recipe: half the first and last depths, plus all the others, times the spacing. Area = 1 × (0/2 + 0.3 + 0.5 + 0.6 + 0.5 + 0.2 + 0/2) = 2.1 m².
- Simpson's rule (more accurate, for an even number of strips): spacing ÷ 3 × (first + 4 × second + 2 × third + 4 × fourth + … + last). Area = ⅓ × (0 + 1.2 + 1.0 + 2.4 + 1.0 + 0.8 + 0) = 2.13 m².
- Time a floating stick over 10 m of straight stream: 20 seconds → 0.5 m/s at the surface. The water near the bed and banks is slower; the average over the section is about 0.85 of the surface speed: 0.43 m/s.
- Flow = area × average speed = 2.1 × 0.43 ≈ 0.9 m³ per second — 900 litres every second.
- Water falling 2 m through a wheel gives, in theory, 1,000 kg × 9.81 × 2 m = about 19,600 joules per cubic metre. At 0.9 m³/s that is about 17,700 watts; a good overshot wheel captures about 60% of that — around 10 kW, the work of a dozen or more horses — if you could use the whole stream. See Forces, Energy and Heat for joules and watts.
The shortcut: reversing the derivative
Since a derivative is a rate and an integral is a total, integrating undoes differentiating. Whatever has the rate you are given as its derivative is the total. For powers:
The integral of xⁿ is xⁿ⁺¹ ÷ (n + 1). Raise the power by one and divide by the new power.
- A stone's speed is 9.8t. Its integral is 9.8 × t² ÷ 2 = 4.9t² — the distance fallen, exactly as measured. After 3 s, 4.9 × 9 = 44.1 m.
- The volume of a cone or a heap. Slice a cone of height H and base radius R into thin discs. At height y from the tip, the radius is R × y ÷ H, so the disc's area is π R² y² ÷ H². Integrate y² from 0 to H: H³ ÷ 3. Volume = π R² H³ ÷ (3 H²) = ⅓ π R² H — the cone formula from Geometry and Trigonometry, now proved.
- The work to empty a cistern. A round cistern 2 m across and 3 m deep is full of water. A thin layer at depth h weighs (1,000 kg/m³ × 9.81 × area π m² × its thickness) and must be lifted h metres to the rim. Adding all layers means integrating h from 0 to 3: 3² ÷ 2 = 4.5. Work = 1,000 × 9.81 × 3.1416 × 4.5 = 139,000 joules. A person pumping steadily delivers about 75 watts, so that is about 31 minutes of hard pumping, more with a leaky Pumps. Notice it is not the same as lifting all the water the full 3 m — the top layers have hardly any distance to go.
The same idea measures the work done in each stroke of a The Steam Engine: James Watt's assistants drew the cylinder's pressure against the piston's position on a card, and the area inside the loop was the work per stroke.
Method 3: Predicting by small steps
Many laws of nature say how fast something changes given how things are now. Such a law is a differential equation. Even if you can't solve it with a formula, you can always step it forward in time:
new value = old value + (rate now) × (small time step).
Worked example — a cooling pot. A pot of water at 100 °C cools in a room at 20 °C. It loses heat at a rate proportional to how much hotter it is than the room; measurements show the rate is 0.1 × (temperature − 20) degrees per minute.
| Minute | Temperature | Rate now (°C per minute) | Change in 1 minute |
|---|---|---|---|
| 0 | 100 | −0.1 × 80 = −8.0 | −8.0 |
| 1 | 92.0 | −0.1 × 72 = −7.2 | −7.2 |
| 2 | 84.8 | −0.1 × 64.8 = −6.48 | −6.5 |
| 3 | 78.3 | … | … |
The exact answer at 3 minutes is 79.3 °C. Half-minute steps get closer; tenth-minute steps closer still. With patience — or, much later, a The Computer — this "step method" (named after Leonhard Euler) predicts the motion of anything whose rates you know: a swinging pendulum, a charging coil, a shell's path through the air, the spread of a disease through a town.
The cooling curve is an example of exponential change, where the rate is proportional to the amount itself. The special number e = 2.71828… is the base whose curve eˣ has a slope everywhere equal to its own height. It appears in cooling, growth, decay, compound interest, the charging of electrical circuits and radioactivity.
How to tell it worked
- Check a derivative by numbers. Work out the average rate over a tiny step (like 2 to 2.001 s above). It must match the formula's answer.
- Check an integral by differentiating it. You should get back what you started with.
- Halve the step. For strip and step methods, repeat with steps half as wide. If the answer barely changes, it is good; if it changes a lot, keep halving.
- Check a "best" answer by trying neighbours. For the box, x = 9 gives 15,876 cm³ and x = 11 gives 15,884 cm³ — both less than 16,000. Correct.
- Check units. A rate is "something per something" (m/s, litres per minute); an integral multiplies (m/s × s = m).
Note Troubleshooting. A maximum turns out to be a minimum → setting the derivative to zero finds both peaks and valleys. Try values either side to see which you have. Derivatives of sines come out wrong → you are using degrees. Convert to radians. Strip estimates jump about → too few strips over a bumpy curve. Use more, or Simpson's rule. Step-by-step predictions run away to huge numbers → the step is too large for how fast things change. Make it ten times smaller. The answer has impossible units → you mixed up rate and total; write units at every line.
Dangers
Warning A calculation is only as true as its model. Calculus will give a precise answer to the question you asked — even if the formula you fed it leaves out friction, wind, rust or a weak joint. Before building anything that can hurt people (a boiler, a bridge, a dam), test a scale model or a sample to destruction, and build several times stronger than the calculation says is needed.
- Extrapolation. A formula fitted to a beam loaded up to 1 tonne says nothing reliable about 5 tonnes; materials yield, buckle and crack suddenly.
- Cumulative error. Step methods add a little error at every step. Over many steps it can grow large. Check against a measured result whenever you can.
Going further
Calculus is the working language of Forces, Energy and Heat (motion, energy, waves), of electrical engineering (Measuring Electricity, The Transformer, Radio), of Astronomy and orbits, of fluid flow (Hydraulic Presses and Rams, Gliders and Aeroplanes) and of the strength of materials (Steel Frames and Tall Buildings, bridges). Tables of integrals and logarithms, and later the The Computer, remove the drudgery — see Calculating Aids.
How it was first done
Archimedes (about 250 BC) found the area of a parabola and the volume of a sphere by slicing them into ever-thinner pieces — integration in all but name. The Chinese mathematician Liu Hui (3rd century AD) used similar slicing for volumes, and in Kerala, south India, Madhava of Sangamagrama (about 1350–1425) and his followers found infinite series for sine, cosine and π. In France around 1636, Pierre de Fermat found maxima and tangents by setting rates to zero. Isaac Newton in England worked out his "method of fluxions" in 1665–1666 and used it to explain the motion of the planets in his Principia (1687); Gottfried Leibniz in Germany developed it independently and published first, in 1684, with the notation (dx, ∫) still used today. The two men's followers quarrelled bitterly over who came first. Leonhard Euler, in the mid-1700s, turned calculus into the toolkit of engineers and wrote down the step method above in 1768.
Source: content/entries/knowledge/calculus.md