Calculus I
Maxima, Minima, and the Shape of a Function
Or: where a curve peaks, where it bottoms out, and why some bowls have no false floors
Companion notebook. Play with this chapter’s ideas — sliders, animations, and drills — in
notebooks/ch8_convexity.ipynb.
By the end of this chapter you will be able to find the highest and lowest points of a function — the single most useful thing calculus does in the real world — and you will know why the methods work, because you built their foundations in the last two chapters.
You will locate the candidates with Fermat’s theorem (extrema hide where the slope is zero), sort them with the first- and second-derivative tests, and read a function’s curving from its second derivative. Every one of these is a consequence of the Mean Value Theorem (Chapter 6) or of Taylor’s quadratic (Chapter 7) — you are not learning new magic, you are spending what you already own.
Then you will meet convex functions — the ones shaped like a single clean bowl — and prove the property that makes them the most important functions in optimization: a convex function has no false floors. Every place where its slope is zero is the true global minimum; there is nowhere to get stuck. That one fact is the dividing line between optimization problems that are guaranteed to work and the ones — like training a neural network — where you cross your fingers. The two-valley landscape from Chapter 9’s gradient-descent lab, where the ball settled into the wrong valley, was exactly a non-convex function. This chapter names the condition that rules that out.
Here is the through-line. Finding a maximum or minimum is asking “where does this function turn around?” — and turning around is a statement about slope. So the whole subject is the derivative, read carefully. That’s why we needed the theorems first.
The problem, and why it is the whole game
A maximum is a high point of a function; a minimum is a low point. We split each into two kinds, and the difference matters enormously:
- A local maximum is a point higher than everything nearby — a hilltop, even if taller hills exist elsewhere.
- A global (or absolute) maximum is the single highest point anywhere on the function’s domain — the tallest hill of all.
(Same for minima, swapping high for low.) The reason this is the application of calculus: almost every practical question is secretly “make this as big or as small as possible.” An engineer minimizes the material in a can. A pharmacologist finds the dose at which a drug’s effect peaks. And — the thread we’ve followed all book — a machine-learning system minimizes a loss, a single number measuring how wrong its predictions are. Learning is minimizing. So learning to find minima is learning, in miniature, how a model is trained. (Figure 8.1: a wavy curve with two local maxima of different heights, one global maximum, two local minima, and the global minimum marked — so the local/global distinction is unmistakable.)