Skip to content

Calculus I: Slopes, Totals and the Bridge Between Them

Your car's speedometer is a derivative. Its odometer is an integral. Everything a first calculus course teaches is a way of moving between the two.

10 min readReadInteractive

Look at a dashboard. The odometer says how far you have gone in total. The speedometer says how fast the total is changing right now. Press the accelerator and the speedometer moves first; the odometer follows, a little behind, like a patient accountant adding up what the speedometer reported.

Nobody gave the speedometer a ruler or a clock to look at the whole trip. It reads one instant. Yet it reports a rate, which is a statement about change, from a single moment. How can a single moment say anything about change? That puzzle is what the course exists to answer, and the answer turned out to run most of modern engineering and computing.

This is the second time the library has met calculus. Calculus: Derivatives, Integrals, and the Language of Motion (12/11) is the easier first read, with the tangent line and the rectangle sum. Here we go a step further: what the course trains you to see, how a computer gets it wrong, and where the idea is used afterwards.

The course in one box

Who takes it: first-year students in Mechanical & Aerospace Engineering and in Computer Science, and almost every other science or engineering degree.

What it is for: turning "how much?" into "how fast?" and back, so that change can be calculated instead of guessed.

Comes after: nothing in this series. Algebra and a little trigonometry are all it assumes.

Leads to: Multivariable Calculus (34/02), Differential Equations (34/03), Probability & Statistics (34/05), Physics I: Mechanics (34/06), Thermodynamics (34/14), and from them nearly everything else on both majors.

Honest line: you will not be able to differentiate a hard formula by hand after this. You will see why a flat spot on a curve is where the best answer hides, and why the area under a rate is a total.

A limit is where a calculation settles

The speedometer puzzle is this. Speed is distance divided by time, but in an instant no time passes and no distance is covered, so you seem to be dividing zero by zero. The way out is to stop asking what happens at zero and ask what a sequence of better and better answers is settling towards. Measure over one second, then a tenth, then a hundredth, and watch the average speed home in on a number. That number is the limit.

speed now = limit of (distance change ÷ time change) as the time change shrinks to 0

A graduate does not carry the formal definition around, but carries the habit: if a quantity looks like 0 ÷ 0, ask what it is approaching. Take sin(x) ÷ x as x goes to zero, with x in radians. At x = 0.1 it is 0.99833; at 0.01, 0.99998; at 0.001, 0.9999998. It never "is" 1 at zero, since it is undefined there, but it settles on 1. That one limit is why the derivative of sine turns out to be cosine.

Interactive · Shrink the gap until the computer gives up

We estimate the slope of ex at x = 1 by (e1+h − e) ÷ h. The true slope is e = 2.718281828459045. Make the gap h smaller.

Gap h = 10−k

The error falls as the gap shrinks, as the limit promises, until about h = 10−8, where it bottoms out near 7 × 10−9. Shrink further and it gets worse: the two values being subtracted agree in almost all of their roughly 16 stored digits, so the subtraction wipes out the information. At 10−16 the answer is exactly 0. This is a computer-science lesson hiding in a calculus course: the limit is a mathematical idea, and a machine can only approach it so far.

The derivative is a slope, and a slope is a rate

Zoom in on any smooth curve and it straightens out. The steepness of that straight piece is the derivative. In plain words: how much the output moves per unit nudge of the input. If the curve is distance against time, the derivative is speed. If it is temperature against position, it is how sharply it warms as you walk. Rate and slope are one thing seen two ways.

f′(x) = limit of [f(x+h) − f(x)] ÷ h as h → 0

The graduate's real asset is not computing derivatives but reading them. Where the curve is rising, the derivative is positive. Where it is flat, the derivative is zero. Where the curve is steepest, the derivative is at its peak. Try it: the lower graph is the derivative of the upper one, drawn point by point.

Interactive · A curve and its slope, side by side
Position x

Check the three curves. Every time the top curve peaks or dips, the bottom one crosses zero. Every time the top is climbing, the bottom is above the axis. For x³ − 3x the slope is 3x² − 3, which is zero at x = −1 and x = 1: the hill top and the valley floor.

The chain rule: rates multiply down a chain

Rates often come in chains. A bicycle's pedals turn the chainring, the chain turns the rear wheel, the wheel moves the bike. If the wheel turns 3 times per pedal turn, and the bike moves 2 metres per wheel turn, the bike moves 6 metres per pedal turn. You multiply the ratios. That is the chain rule, and it is the most used rule in the course.

d(outer)/d(input) = d(outer)/d(middle) × d(middle)/d(input)

The classic worked case is a balloon. Its volume depends on its radius, and the radius depends on time. At radius r the surface has area 4πr², so one extra centimetre of radius adds a shell of volume about 4πr² cm³: that is dV/dr. Multiply by how fast the radius is growing and you have how fast the volume is growing. At r = 10 cm, growing 2 cm each second, volume grows at 4π × 100 × 2 ≈ 2,513 cm³ per second. Pull the sliders and confirm it.

Interactive · Inflate a balloon
Radius now
Radius is growing at

The picture shows why it works: the shaded shell is what one second adds, a skin of area 4πr² and thickness equal to the radius growth. The same rule runs inside every neural network, where the "chain" is dozens of layers long and the multiplication is called backpropagation (Machine Learning, 34/32; Multivariable Calculus, 34/02).

Where the slope is zero, something is best

At the top of a hill you stop going up and have not yet started going down. The slope is zero. So to find the biggest or smallest value of anything smooth (strongest, cheapest, lightest, fastest) look for where its derivative is zero. That is optimisation, and it is why engineers love the derivative.

Take a 30 cm by 20 cm sheet of card. Cut a square of side x from each corner and fold up the sides to make an open box. Its volume is V = x(30 − 2x)(20 − 2x). Cut too little and the box is shallow. Cut too much and it is narrow. In between there is a best x, and the slope tells you where: at x ≈ 3.92 cm the volume peaks at about 1,056 cm³.

Interactive · The best box
Corner cut x

Notice what the slope does as you drag. To the left of the peak the slope is positive, so a bigger cut helps. To the right it is negative, so a smaller cut helps. At the peak it is zero and nothing nearby is better. Gradient descent, the algorithm that trains machine-learning models, is exactly this reasoning repeated: look at the slope, step downhill, repeat.

The integral adds up a rate into a total

The odometer is the speedometer added up over time. Draw speed against time; the area between the curve and the time axis is distance. That is the integral. Anywhere a rate is known and a total is wanted (litres per minute into a tank, watts into a battery, newtons over a distance) the answer is an area.

Try it before you read on. A car accelerates steadily from 0 to 20 m/s in 10 seconds, cruises at 20 m/s for 30 seconds, then brakes steadily to a stop in 10 seconds. How far has it gone?

Interactive · Predict, then reveal
Choose an answer.

The shape is two triangles and a rectangle: ½ × 10 × 20 + 30 × 20 + ½ × 10 × 20 = 100 + 600 + 100 = 800 m. The common wrong guess, 1,000 m, uses the top speed for all 50 seconds and forgets that the car spends time slower than that.

The Fundamental Theorem: two jobs, one idea

Here is the surprise that makes the course a single subject. Build a running total from a rate: the amount in the tank after time T. Then ask how fast that total is growing at T. The answer is just the rate at T. Accumulating and differentiating undo each other, the way the odometer and speedometer do. Newton and Leibniz, working separately in the late 1600s, each saw this.

if A(T) = area under the rate up to T, then A′(T) = the rate at T

Its practical power is that you can find a total without adding anything: find a function whose slope is your rate and subtract its values at the two ends. Below, water flows into a tank at a rate that wobbles: 4 + 3 sin(t/2) litres per minute. Drag the time and watch the right-hand graph, the tank's total, steepen exactly when the rate on the left is high.

Interactive · The tank and its rate
Time T

The readout checks the theorem two ways: area by adding 600 thin slices, and the exact formula 4T + 6(1 − cos(T/2)). At T = 12 minutes both give 48.24 litres. The slope of the total at that moment is 4 + 3 sin 6 ≈ 3.16 litres per minute, the rate at that moment.

Every smooth thing is nearly a straight line

The last habit is the most useful in daily engineering. Close to any point, a smooth curve is almost its tangent line, so you can replace it with a straight line and be nearly right. The small-angle rule sin x ≈ x is why a pendulum swings at a steady rhythm. The rule √(1 + x) ≈ 1 + x/2 gives mental square roots: √1.1 ≈ 1.05, true value 1.0488.

f(a + x) ≈ f(a) + f′(a) · x   (good when x is small)

How small is small? The error shrinks faster than the step. Halve the step and the error falls about four times for √(1 + x) and ex, and about eight times for sine.

Interactive · How good is the straight line?
Step x from the point

What a graduate just sees

  • A rate and a slope are the same thing, and "how fast?" always means a derivative.
  • A total is an area under a rate, and adding up thin slices is a calculation, not a mystery.
  • Rates multiply along a chain: gear ratios, units, layers of a network.
  • The best value of a smooth quantity sits where its slope is zero.
  • Differentiating and accumulating are inverse jobs, so a total can often be found without adding.
  • Up close, everything smooth is a straight line, and engineers exploit that constantly.
  • Subtracting two nearly equal numbers on a computer destroys precision, so a naive slope estimate gets worse when the gap gets too small.

Where it shows up next

  • Physics I (34/06) and Dynamics (34/12): velocity is the derivative of position, acceleration of velocity, and Newton's law ties force to the second one.
  • Differential Equations (34/03): when a law is written as a rate, solving it means integrating, which is the whole next course.
  • Thermodynamics (34/14) and Heat Transfer (34/16): heat added is an integral of power; temperature profiles are read from slopes.
  • Probability & Statistics (34/05): the chance of a range of outcomes is the area under a density curve.
  • Algorithms (34/24) and Machine Learning (34/32): growth rates of running time are compared with limits, and models are trained by following slopes downhill.

If you want to go deeper

  • 📘 Textbook: James Stewart, Daniel Clegg and Saleem Watson, Calculus: Early Transcendentals (9th ed., Cengage). The most-assigned text; best for worked examples and a huge problem bank.
  • 📘 Textbook: Hass, Heil, Bogacki and Weir, Thomas' Calculus (15th ed., Pearson). Strong on applications, popular in engineering departments.
  • ▶️ Gentler: Grant Sanderson's Essence of Calculus series on 3Blue1Brown, a visual tour of the same ideas. Also Steven Strogatz, Infinite Powers, for the story.
  • 🌐 Free course: MIT OpenCourseWare 18.01SC Single Variable Calculus, with video lectures, notes and problems. Khan Academy also covers it.
The takeaway

Calculus I teaches two moves and one bridge. The derivative turns a total into a rate (a slope); the integral turns a rate into a total (an area); and the Fundamental Theorem says they undo each other. From that come the habits of mind: chain rates together, look for zero slope to find the best, and treat smooth things as lines up close. Our slope estimate for ex was best near a gap of 10−8 and useless at 10−16, a reminder that the ideas are exact and the machines are not.

Try this: next time you are in a car or on a bike, watch the speedometer and ask what the area under its history means. Then on a hill, find the spot where the road is flat. That is a derivative equal to zero.

Sources & Further Reading

Sources. Every number in the interactives was computed in node: the forward-difference error of ex at x = 1 for h = 10−1 to 10−16 (best 6.6 × 10−9 at 10−8, exactly 0 at 10−16, in IEEE double precision); sin(x)/x at 0.1, 0.01, 0.001; the box V(x) = 4x³ − 100x² + 600x, zero slope at x = (50 − √700)/6 = 3.9237, V = 1,056.3 cm³; the balloon 4π × 10² × 2 = 2,513.27 cm³/s; the car, 800 m; the tank, A(12) = 48.239 L; small-step errors of the three approximations. Book editions checked against the publishers' pages (Cengage, Pearson) and the course numbers against MIT OpenCourseWare.