The Technology
of Calculus
Step a game ball through time with velocity and acceleration, design smooth animations with easing curves, see how GPS turns timing into position and speed, watch a computer learn by rolling downhill, and find square roots with tangent lines.
- 00First Principlesp.2
- 01Game physicsp.4
- 02Easingp.5
- 03GPSp.6
- 04Gradient descentp.7
- 05Newton’s methodp.8
- ✦Self-check · Make it · 5 Questions · Side Questp.9
You'll need: a calculator, graph paper, a spreadsheet, a flipbook or sticky notes and a device with an adult’s permission.
Principles
A first principle is a basic truth you can build on. The technology of calculus rests on four: computers take tiny steps, smooth motion means smooth rates, timing can measure distance and downhill finds the best answer.
What do I already know?
What is necessary?
Everything in this module is built from four bricks. Rate yourself on each one, then check the example to see if your rating holds up.
What is the objective?
By the end, you’ll be able to step a falling object forward frame by frame, explain easing with derivatives, describe how GPS finds position and speed, run gradient descent by hand and use Newton’s method to find a square root.
- 01Do 2 game-physics steps.
- 02Explain ease-in.
- 03Say why GPS needs 4 satellites.
- 04Run 3 steps of gradient descent.
- 05Spot a too-big step.
- 06Find √2 with Newton’s method.
The list on the left is ours. Now make it yours. What do you want out of this?
How much do you know about the technology of calculus right now? Shade the boxes in pencil. You'll come back at the end (p.9) and shade it again in pen.
Why start this way? When you know what you already have (1), what you need (2) and where you're going (3), you learn faster and you notice the gaps. Every module on the Calculus Path starts with these same three questions.
Game physics
Games step motion forward in tiny time slices.
Euler’s method
Games can’t solve motion exactly, so each frame they take a small time step dt:
- new velocity = v + a × dt
- new position = x + (new v) × dt
At 60 frames per second, dt is about 0.0167 s.
dt = 0.1 s, a = 9.8 m/s2
| Step | v (m/s) | x fallen (m) |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0.98 | 0.098 |
| 2 | 1.96 | 0.294 |
The exact fall after 0.2 s is 0.196 m. Smaller steps get closer.
Integration in code
Each step adds a small change: that’s a Riemann sum (Lens 1) running in real time. Game engines also handle collisions, friction and bounces, often by flipping and shrinking the velocity when a ball hits the ground.
- Which game has the most realistic jumps you’ve seen?
- What would happen in a game if dt were much too big?
Step it
Continue the table for steps 3, 4 and 5. Then compare with the exact distance 4.9t2 at t = 0.5 s. How big is the error?Why do smaller time steps give better results?
Easing
Easing makes speed start and end at zero.
Natural motion
Real things don’t start or stop instantly. Animators use easing curves for position over time (t from 0 to 1):
- Ease-in: p = t2 (starts slow)
- Ease-out: p = 1 − (1 − t)2 (ends slow)
At t = 0.5: ease-in 0.25, ease-out 0.75.
Check the start
For ease-in, speed = p′ = 2t, which is 0 at the start, so the motion begins gently. For ease-out, p′ = 2(1 − t), which is 0 at the end. Web designers use curves like CSS ease-in-out, which is cubic-bezier(0.42, 0, 0.58, 1) (Lens 7).
Brains and motion
Sudden starts look robotic because the speed jumps, an infinite acceleration. Easing keeps speed continuous, and good easing limits jerk too (Lens 3). That’s why menus slide and phone screens bounce instead of snapping.
- Where have you noticed easing in apps or menus?
- Why does sudden motion look less natural?
Flipbook
Make a 10-page flipbook of a ball moving across. Space the positions with ease-in (0, 0.01, 0.04, 0.09 … of the width). Then make one with even spacing. Which looks more natural?For ease-out p = 1 − (1 − t)2, what is the speed at t = 0?
GPS
GPS turns signal timing into position and speed.
Timing is distance
About 30 GPS satellites orbit about 20,200 km up, each sending its position and a precise time. Radio travels at the speed of light, about 300 m per microsecond, so a receiver turns signal delays into distances. It needs at least 4 satellites: 3 for position, 1 to correct its own clock.
Derivatives in your phone
Your speed is the rate of change of position. A receiver can compare positions second by second, or measure the tiny Doppler shift in each satellite’s signal, which depends on how fast you’re moving relative to it.
38 microseconds a day
GPS satellite clocks run faster than ground clocks by about 38 microseconds per day, because of Einstein’s relativity. Light goes about 11 km in that time, so without corrections, positions would drift by kilometres each day.
- How would life change without GPS for a week?
- Should apps always ask before using your location? Why?
Walk speed
With an adult’s OK, record a walk in a map or fitness app. Note the distance and time for 3 parts of the walk. Find your average speed for each part. Where did you speed up?A timing error of 1 microsecond is about how far?
Gradient descent
Step against the slope to reach a minimum.
Gradient descent
Machine-learning models learn by reducing a loss, a measure of how wrong they are. They nudge each setting a little against the slope:
xnew = x − η · f′(x)
η (eta) is the learning rate, the step size.
f(x) = (x − 3)2, η = 0.25
f′(x) = 2(x − 3). Start at x = 0:
| Step | x |
|---|---|
| 0 | 0 |
| 1 | 1.5 |
| 2 | 2.25 |
| 3 | 2.625 |
It heads toward the minimum at x = 3.
Overshooting
With η = 1.1, x goes 0 → 6.6 → −1.32 and jumps farther away each time. Choosing the learning rate is part of the art. Real models adjust millions or billions of settings at once, each with its own slope, using the same idea.
- Why might a computer need many small steps instead of one big jump?
- What problems would you want a learning computer to help with?
Run it
Run 3 steps of gradient descent on f(x) = (x − 3)2 from x = 10 with η = 0.25. Then try η = 0.5. What happens with η = 0.5, and why?With η = 0.25 and x = 1.5, what is the next x?
Newton’s method
Follow tangents to zoom in on a root.
Tangents find roots
To solve f(x) = 0, start with a guess, follow the tangent line to where it hits zero, and repeat:
xnew = x − f(x)/f′(x)
f(x) = x2 − 2
The formula becomes xnew = (x + 2/x)/2. Start at 1:
| Step | x |
|---|---|
| 0 | 1 |
| 1 | 1.5 |
| 2 | 1.41667 |
| 3 | 1.414216 |
The correct digits roughly double each step.
Fast methods
Calculators and computers use fast step-by-step methods like this one, along with others such as series and shortcuts built into the chip, to find roots, logs and trig values. Averaging rules like this for square roots are often traced back to ancient Babylon and Heron of Alexandria.
- Why is a good first guess helpful?
- Can you think of other times you got closer step by step?
Root of 10
Use xnew = (x + 10/x)/2 starting at 3. Do 3 steps. Square your answer to check it. How many steps until your calculator can’t tell the difference?First step for √10 from x = 3?
Quick self-check
Six questions, covering every stop. Show your thinking. Answers are upside down at the bottom; no peeking till you're done.
1 · What does a game add to velocity each frame?
2 · What is speed at the start of ease-in?
3 · Why does GPS need 4 satellites?
4 · What is the learning rate?
5 · What happens if it’s too big?
6 · State Newton’s method.
Re-shade your knowledge meter
How much do you know about the technology of calculus now? Flip back to p.3 and shade the meter again in pen (or shade this one). Did any of the four bricks on p.2 move from "Not yet" to "Got it"?
Bounce a ball on paper
Can you code physics without a computer?
1 · Plan
Simulate a ball dropped from 2 m with dt = 0.1 s and a = 9.8 m/s2 in a table or spreadsheet. When height goes below 0, set it to 0 and flip the velocity, keeping 80% of the speed (a bounce). Run 30 steps.
- Columns: t, v, height
- Bounce rule written
- 30 steps
- Graph made
2 · Results
| Bounce | Time (s) | Peak height (m) |
|---|---|---|
| Start | 0 | 2 |
| 1 | ||
| 2 | ||
| 3 |
3 · Must-haves
- Height–time graph
- Peaks shrink
- dt halved test
- Explain each rule
4 · What I found
What fraction of the height does each bounce keep? What changed when you halved dt? How would a game use this?
Use a spreadsheet or paper. If you try a coding site, use one that runs without an account, with an adult’s OK, and don’t share personal details.
5 Questions
I Still Have
This module didn't answer everything. Good. Write 5 new questions it didn't answer, one of each type below. There are no wrong questions, only ones nobody's asked yet.
★ Star the one question you'd most like answered. You'll need it on the next page.
1What I'll find out
Break your big question into 2 or 3 smaller ones you could actually answer.
2Where I'll look
3How I'll share it
Who I'll share it with:
Done by: