INAIO Guide Stage 1 5Calculus and Optimisation
5.2 Maxima and minima
Use local rates of change to find possible maxima and minima, then compare all allowed choices.
Optimization is the method of choosing an input or decision to make a quantity as large as possible (maximize) or as small as possible (minimize). The quantity being improved is the objective: height, profit, cost, distance, or error. This is especially useful in AI. Training a model often means choosing its adjustable parameters to minimize a loss that measures prediction error.
Why do optimization and differentiation appear together? The derivative tells us how the objective changes when we adjust an input slightly. At a smooth point with positive slope, moving right raises the value and moving left lowers it; with negative slope, the directions reverse. Such a point cannot be a highest or lowest point inside the allowed range. An interior smooth optimum must therefore have slope zero. Differentiation finds these candidates; derivative signs, the graph's shape, and the allowed boundaries tell us which candidate actually wins. This is why calculus is central to optimization over continuous choices.
This is intermediate calculus. Review Module 5.1 and OpenStax's maxima-and-minima section. The algebra of quadratics from Module 2.3 provides a useful check. A derivative is powerful for smooth continuous objectives, but a sharp corner, a boundary, or a discrete choice may need direct comparison too.
A basic idea: where could the direction change?
Suppose we want to maximize for . The graph rises before and falls after it. Its derivative is : positive to the left, zero at , and negative to the right. Moving right helps before and hurts after , so is a peak. Its value is , higher than either endpoint: and . It is the greatest allowed value.
A quick tour of candidate points
A critical point is an allowed interior input where the derivative is zero or does not exist. These are candidates for a local high or low point. A local maximum beats nearby values; an absolute maximum beats every allowed value. The same distinction applies to minima.
For a continuous function on a closed interval , check:
- Interior points where .
- Interior points where is undefined but exists.
- Both endpoints and .
Evaluate at every candidate; the greatest and smallest values are the absolute extrema. Derivative signs help classify an interior point: means a local maximum, and means a local minimum. No sign change means a flat tangent without a turn, as for at zero. At a corner, such as at , the derivative may fail to exist exactly where the minimum occurs.
In AI, a model can have many adjustable parameters rather than one . The gradient collects the derivative with respect to each parameter; a small move opposite that direction tends to lower a differentiable loss. This is the many-variable version of following the slope downhill. The full gradient-based training method is beyond this one-variable introduction.
If the domain is open or unbounded, a maximum or minimum may not be attained. For instance, on approaches but never equals it. Module 5.4 applies this boundary check to constrained problems.
Application 1: the highest point of a flight model
A simplified height model is metres for seconds. What is the greatest height on this interval?
- Find interior candidates. at .
- Compare values. , , and metres.
- Choose the absolute maximum. The highest height is metres at seconds. The derivative changes from positive to negative there, agreeing with the comparison.
The interval endpoints matter even though the peak happens inside it.
Application 2: a sharp minimum
An error is for . Where is it smallest?
- Read the distance. is the distance from to , so it cannot be negative.
- Check the corner and endpoints. At , ; at and , .
- Conclude. The absolute minimum is at . The graph has a corner there, so a method that searches only for would miss it.
Resources
| Source | Title | Why read it |
|---|---|---|
| OpenStax | Maxima and minima | Review critical points, endpoints, and absolute extrema. |
Finished this module? Mark it done.
Comments
Stuck on something, spotted a mistake, or found a resource that helped you? Tell us below.
Loading comments