Skip to content
DoingCamp CS

Make it comfy

Lesson style

Quick mode shows the key picture, a summary and the practice. Good for a refresher.

Theme
Font

Both fonts are designed to be easy to read. Some readers with dyslexia prefer Lexend.

Text size
Spacing
Animations

F09

Calculus for CS

“How fast is the slide getting steeper?”

Lessons

Start the course →0 of 20 lessons done
  1. Rates of changeFreeWelcome to Splash Park, where you're the only programmer and the new slide, the Big Drop, opens in a month. How fast does a rider fall? How quickly does the new pool fill? Both questions are about rates of change. You'll measure them as the slope of a line between two points on a graph, the idea that all of calculus grows out of. · 14 min
  2. LimitsFreeThe Big Drop's speed display has to show the speed at one instant, but "distance moved in zero time, divided by zero time" is 0 ÷ 0. The way out is to ask what the numbers get close to as the time gap shrinks. That's a limit. You'll walk up to tricky points from both sides, find values a formula can't reach directly, and spot limits that don't exist at all. · 15 min
  3. The derivativeFreeShrink the time gap to zero, in the limit sense, and the average speed becomes the speed at one instant. That's the derivative, the slope of the curve at a single point. You'll watch a secant line turn into a tangent, trace out the speed of the Big Drop rider at every moment, and write the code behind the ride's speed display, including the trap of making the gap too small. · 16 min
  4. Derivative rules🔒 MembersTaking a limit every time you need a slope would be exhausting. Luckily the answers follow simple patterns. For powers of x, bring the power down and lower it by one, and sums and multiples behave just as you'd hope. You'll discover the pattern by tracing slopes, then use it to check a new slide design before anyone gets wet. · 15 min
  5. Product, quotient and chain rules🔒 MembersSplash Park's revenue is price times visitors, and both change when the price changes. A rider's speed depends on how far they've fallen, which depends on time. To differentiate products and functions inside functions you need three more rules. You'll see the product rule as a growing rectangle and the chain rule as a relay of nudges, then use them to see which way a price change pushes the park's takings. · 17 min
  6. Exponentials, e and logarithms🔒 MembersSome things change at a rate proportional to their size. Money earns interest on its interest, bacteria multiply, and the pool fills fastest when it's emptiest. All of them are described by one special number, e = 2.718…, and the function eˣ, which is its own derivative. You'll discover e from compound interest, trace eˣ's slope, and use logarithms to answer "how long until…?" questions for the park. · 16 min
  7. Sine, cosine and waves🔒 MembersThe new wave pool pushes out a wave every 4 seconds, and the water at the wall rises and falls like a sine curve. Where does that curve come from, and how fast does the water move? You'll turn a point around a circle to draw sine and cosine, discover that the slope of sine is cosine, and program the wave machine's speed sensor. · 15 min
  8. Optimization🔒 MembersWhat ticket price brings Splash Park the most money? What shape of splash pad gives the most space from 60 m of fence? At the very top of a hill the ground is level, so the best answer sits where the derivative is zero. You'll find both answers by hand and by formula, learn how to tell a peak from a valley, and write a program that finds the best price on its own. · 16 min
  9. Linear approximation and Newton's method🔒 MembersZoom in on any smooth curve and it looks straight, so near a point, the tangent line is an excellent shortcut for the curve. You'll see that happen, use it to estimate square roots in your head, then turn it into Newton's method, which finds the exact moment the Big Drop's splash camera should fire in four steps. · 16 min
  10. Integrals as accumulation🔒 MembersThe Big Drop's new sensor measures only speed. How far has the rider fallen? The pump logs only its flow rate. How much water is in the pool? Both questions run derivatives backwards, adding up rate × time slice by slice. That sum is the area under a curve, and its limit is the integral. You'll slice areas into rectangles and trapezoids and watch the estimates close in on the truth. · 16 min
  11. The fundamental theorem of calculus🔒 MembersDerivatives measure rates; integrals add rates up. It turns out they're opposites, the way multiplying and dividing are. You'll watch the area under the Big Drop's speed graph grow and see that its slope is the speed itself, then use that to compute exact areas in one line instead of thousands of slices. · 17 min
  12. Integration techniques🔒 MembersDifferentiating always works by rule; integrating takes some cunning. Two tricks cover most cases you'll meet. Substitution undoes the chain rule, and integration by parts undoes the product rule. You'll see substitution as stretching an axis, check an answer the reliable way (by differentiating it), and use both to answer a question about the pool, then learn when to stop and let the computer do it numerically. · 16 min
  13. Numerical integration and simulation🔒 MembersMost real integrals have no formula, and most real motion has no neat equation. Computers handle both by taking small steps. You'll estimate how many visitors arrive on a busy day with Simpson's rule, then simulate the Big Drop with water drag using Euler's method, and see how the step size trades speed for accuracy. · 17 min
  14. Sequences and series🔒 MembersCan you add up infinitely many numbers and get a finite answer? Sometimes yes, sometimes no, and the line between them is surprising. You'll add halves until they reach 1, watch 1 + 1/2 + 1/3 + … creep upward forever, and solve a puzzle from the park's storeroom. How far can a stack of foam blocks reach out over the edge of a table without falling? · 16 min
  15. Taylor series🔒 MembersThe wave machine's controller chip can only add and multiply, yet it needs sin(x) hundreds of times a second. How do computers calculate sin, cos and eˣ at all? By polynomials that match the function's value, slope, bend and every higher derivative at one point. You'll add terms one at a time and watch a polynomial wrap itself around a wave, then build your own sin and exp from nothing but arithmetic. · 17 min
  16. Functions of two variables🔒 MembersThe park is building a second pool, and the ground isn't flat. The height of the land depends on two numbers, how far east and how far north you are. You'll explore a hiking-style contour map of the site, slice it east–west and north–south, and find that each slice has its own slope, the partial derivatives. They're the first step toward how machines learn. · 16 min
  17. The gradient🔒 MembersPut the two partial derivatives side by side and you get an arrow, the gradient, which points straight uphill. Its length is how steep the steepest way is. You'll spin a direction arrow on the pool site to find the steepest climb and the level paths, then trace where rainwater runs, which tells the builders exactly where to put the drain. · 16 min
  18. Gradient descent🔒 MembersSetting both partial derivatives to zero works for the pool site, but a model with a million settings has a million equations. Instead, start anywhere and keep stepping downhill along minus the gradient. That simple loop, gradient descent, trains almost every modern AI. You'll tune the step size until it neither crawls nor explodes, watch it zig-zag down a narrow valley, and see it get stuck in the wrong hollow. · 17 min
  19. The chain rule and backpropagation🔒 MembersTo train the park's wait-time model by gradient descent, you need the gradient of its error with respect to every setting. Backpropagation computes all of them in one sweep, by running the chain rule backwards through the calculation. It's how every neural network learns. You'll step gradients back through a small computational graph by hand, then code the forward and backward passes yourself. · 17 min
  20. Boss level: gradient-descent playground🔒 MembersSplash Park wants a sign at the Big Drop that says how long the wait is. You have twelve days of measurements and a two-setting model. You'll train it by gradient descent, find the learning rate where training blows up, discover why, fix it with feature scaling, and then build the whole training loop in Python and check it against the exact answer. Every idea from this course meets here. · 25 min

💼 Already know this course?

Placement tests are coming soon. Until then, you can mark it as known so it’s colored in on your map. You can undo this any time.