Appearance
5.4 — What Derivatives Are For
A drinks company wants a cylindrical can holding 330 ml, using the least aluminium possible. Across billions of cans a one percent saving in metal is a very large sum of money. What dimensions should it have?
This is an optimisation problem, and it is the single most useful thing calculus does. The insight is one line:
At a maximum or a minimum, the tangent is horizontal, so the derivative is zero.
At the top of a hill you are momentarily going neither up nor down. That is what a peak is.
1. Critical points and the tests
A critical point is where f'(x) = 0 or where the derivative fails to exist. Every maximum and minimum in the interior of a domain is a critical point — but not every critical point is a maximum or minimum, which is why a test is needed.
The first derivative test. Look at the sign of f' on either side.
- Positive then negative: the function rose then fell. Maximum.
- Negative then positive: fell then rose. Minimum.
- Same sign both sides: it paused and continued. Neither. f(x) = x^3 at x=0 does this — the derivative is zero, and the curve keeps rising.
The second derivative test, usually quicker.
- f''(x) \lt 0: the curve bends downward, so a flat point is a peak. Maximum.
- f''(x) \gt 0: bends upward. Minimum.
- f''(x) = 0: inconclusive. Fall back on the first derivative test.
Local versus global. A local maximum is the highest point in its neighbourhood. A global maximum is the highest anywhere in the domain. To find the global one on a closed interval you must check the critical points and the endpoints, because the highest value may sit at the boundary where the derivative was never zero.
Forgetting the endpoints is the most common error in optimisation, and it is not just a textbook mistake — a manufacturing constraint like "the sheet is only 2 m wide" is an endpoint, and the best feasible design often sits right against it.
2. The can problem, worked
A cylinder of radius r and height h has
V = \pi r^2 h = 330, \qquad A = 2\pi r^2 + 2\pi r h
The top and bottom discs give 2\pi r^2; the curved side is a rolled-up rectangle of width 2\pi r and height h.
Step 1: reduce to one variable. Use the volume constraint to eliminate h:
h = \frac{330}{\pi r^2}
A(r) = 2\pi r^2 + 2\pi r\cdot\frac{330}{\pi r^2} = 2\pi r^2 + \frac{660}{r}
Step 2: differentiate and set to zero.
A'(r) = 4\pi r - \frac{660}{r^2} = 0 \quad\Longrightarrow\quad 4\pi r^3 = 660 \quad\Longrightarrow\quad r^3 = \frac{165}{\pi} = 52.52
r = 3.74\ \text{cm}
Step 3: confirm it is a minimum. A''(r) = 4\pi + \frac{1320}{r^3}, which is positive for any positive r. Curve bends upward, so this is a minimum. ✓
Step 4: the height. h = \frac{330}{\pi(3.74)^2} = 7.51\ \text{cm}.
Notice: h = 2r. The optimal can is exactly as tall as it is wide — the cylinder that fits snugly in a cube. This is a general result, not an artefact of 330 ml.
So why is a real drinks can taller and thinner? Because the model is incomplete, and saying so honestly is part of doing mathematics well. Real cans have thicker top and bottom sheets than sides, so the discs cost more per square centimetre than the model assumes, which pushes the optimum towards a smaller radius. They also have to fit a hand, stack on a shelf, and survive internal pressure. The mathematics gives the answer to the question you asked; getting a useful answer means asking a question that includes the real constraints.
3. More worked optimisations
The fence problem, revisited. Chapter 2.3 solved "40 m of fencing against a wall, maximise area" by completing the square and got 10 \times 20 for 200 m². By calculus: A(x) = 40x - 2x^2, so A'(x) = 40 - 4x = 0, giving x = 10. Same answer, and now the method works for shapes where completing the square would not.
The box from a sheet. Cut squares of side x from the corners of a 30 \times 20 cm sheet and fold up the sides.
V(x) = x(30-2x)(20-2x) = 4x^3 - 100x^2 + 600x
V'(x) = 12x^2 - 200x + 600 = 0
Divide by 4 and use the quadratic formula from Chapter 2.3:
3x^2 - 50x + 150 = 0 \quad\Longrightarrow\quad x = \frac{50 \pm \sqrt{2500-1800}}{6} = \frac{50\pm26.46}{6}
That gives x = 12.74 or x = 3.92. The first is impossible — cutting 12.74 cm from each end of a 20 cm side leaves a negative width — so x = 3.92 cm, giving a volume of about 1,056 cm³.
Discarding the physically meaningless root is your job, not the algebra's, exactly as in Chapter 2.3's projectile problem.
Least time, and why light bends. Fermat's principle says light takes the path of least time. Crossing from air into water it slows, so the fastest path is not the straight one — it bends, spending more distance in the faster medium. Minimising the total time with calculus produces exactly Snell's law, \frac{\sin\theta_1}{\sin\theta_2} = \frac{v_1}{v_2}. A lifeguard running along sand then swimming faces the identical problem and should run past the straight-line point before entering the water.
4. Curve sketching: reading a function from its derivatives
Given a function, you can describe its graph completely without plotting a single point.
f(x) = x^3 - 3x^2 + 2
First derivative: f'(x) = 3x^2 - 6x = 3x(x-2), zero at x=0 and x=2.
Second derivative: f''(x) = 6x - 6, zero at x=1.
At x=0: f'' = -6 \lt 0, so a local maximum, at height f(0) = 2. At x=2: f'' = 6 \gt 0, so a local minimum, at height f(2) = -2. At x=1: the concavity switches, so an inflection point at height f(1) = 0.
End behaviour from Chapter 2.2: odd degree, positive leading coefficient, so it comes from -\infty on the left and goes to +\infty on the right.
That is the whole curve: up from below, peak at (0,2), down through the inflection at (1,0), trough at (2,-2), then up forever. No table of values needed.
5. The Mean Value Theorem
A result that sounds like a technicality and quietly justifies a great deal.
If f is continuous on [a,b] and differentiable inside, there is at least one point c where
f'(c) = \frac{f(b)-f(a)}{b-a}
In words: at some instant, the instantaneous rate equalled the average rate.
The everyday version: if you drove 180 km in 2 hours, your average was 90 km/h, so at some moment your speedometer read exactly 90. This is not a guess; it is forced by continuity.
And it is how average-speed cameras work. Two cameras 20 km apart on a motorway, and a car that covers the gap in 10 minutes averaged 120 km/h. The Mean Value Theorem says it must have been doing 120 at some instant, so the ticket is mathematically justified even though nobody measured the instantaneous speed.
Its real importance is as a proof tool. It is what establishes that a function with zero derivative everywhere must be constant — which sounds obvious and is the key step in proving the Fundamental Theorem of Calculus in Chapter 5.5.
6. L'Hôpital's rule
For a limit that gives \frac{0}{0} or \frac{\infty}{\infty}:
\lim_{x\to a}\frac{f(x)}{g(x)} = \lim_{x\to a}\frac{f'(x)}{g'(x)}
provided the second limit exists.
Example. \lim_{x\to0}\frac{\sin x}{x}, the important limit from Chapter 5.1. Both top and bottom go to zero. Differentiate each separately:
\lim_{x\to0}\frac{\cos x}{1} = 1
Confirming the geometric argument in one line.
Example. \lim_{x\to\infty}\frac{x^2}{e^x} is \frac{\infty}{\infty}. Apply twice:
\to \lim\frac{2x}{e^x} \to \lim\frac{2}{e^x} = 0
So e^x beats x^2 decisively, which is Chapter 1.4's claim that exponentials outrun polynomials, now proved rather than tabulated.
Two cautions. It applies only to \frac{0}{0} and \frac{\infty}{\infty} — using it elsewhere gives wrong answers. And you differentiate top and bottom separately, not with the quotient rule.
The rule is named for the Marquis de l'Hôpital, who published it in 1696 in the first calculus textbook. He had bought the results from Johann Bernoulli under a contract that let him publish them as his own — an arrangement both parties understood, and which l'Hôpital acknowledged in his preface, though the name has stuck to the wrong man ever since.
7. Approximation with the tangent line
Near a point, a smooth curve is nearly its tangent line. That gives a fast approximation:
f(x) \approx f(a) + f'(a)(x-a)
Example. Estimate \sqrt{4.1} without a calculator. Take f(x) = \sqrt x at a=4, where f(4) = 2 and f'(4) = \frac{1}{2\sqrt4} = 0.25.
\sqrt{4.1} \approx 2 + 0.25(0.1) = 2.025
The true value is 2.024846. Accurate to four decimal places from a single multiplication.
This is why "for small x" approximations are everywhere in physics: \sin x \approx x, \ln(1+x)\approx x, (1+x)^n \approx 1+nx. Each is a tangent line at zero. Chapter 5.8 extends this to more terms and gets Taylor series, which is how a computer actually evaluates these functions.
Every formula above, built from scratch
None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.
What derivatives are for
Tangent and normal lines at x=a:
y = f(a) + f'(a)(x-a) \qquad\text{and}\qquad y = f(a) - \frac{1}{f'(a)}(x-a)
Linear approximation, the tangent line used as a stand-in for the curve:
f(a+h) \approx f(a) + hf'(a)
This is why \sqrt{101} \approx 10 + \frac{1}{20} = 10.05 (true value 10.0499), and it is the first term of the Taylor series in §9.
Turning points. At a maximum or minimum of a smooth function, the tangent is horizontal, so f'(x) = 0. Then the second derivative decides which:
f''(x) > 0 \Rightarrow \text{minimum}, \qquad f''(x) < 0 \Rightarrow \text{maximum}, \qquad f''(x) = 0 \Rightarrow \text{inconclusive}
Why the second derivative decides. f'' measures how the slope is changing. If the slope is increasing through zero, it went from negative to positive — down then up — which is a valley. If decreasing, up then down: a peak.
Points of inflection are where f'' changes sign: the curve stops bending one way and starts bending the other.
Newton's method for solving f(x) = 0:
x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
Where it comes from. Stand at x_n and replace the curve by its tangent line. The tangent hits zero where f(x_n) + f'(x_n)(x-x_n) = 0, and solving that for x gives the formula. Repeat. Near a simple root it doubles the number of correct digits every step, which is why it is in every calculator's square-root routine.
Related rates. Differentiate a relationship with respect to time, and rates on one side turn into rates on the other. If a spherical balloon has V = \frac43\pi r^3, then
\frac{dV}{dt} = 4\pi r^2\frac{dr}{dt}
so knowing how fast you are pumping air in tells you how fast the radius grows — more slowly as the balloon gets bigger, since the same volume now spreads over a larger surface.
8. Where this shows up in your life
Every engineering design that minimises material, weight or cost under a constraint.
Every machine learning model that trains. Training means minimising a loss function, and the condition is exactly \nabla f = 0 — the multivariable version from Chapter 5.7, pursued by gradient descent in Chapter 10.4.
Every average-speed camera on a motorway.
Every economics course. Marginal cost is the derivative of total cost, marginal revenue the derivative of revenue, and profit is maximised where the two are equal — which is exactly \frac{d}{dq}(\text{profit}) = 0.
Every lens, mirror and fibre-optic cable. Fermat's least-time principle.
Every package and container design. The can problem, with the real constraints added back.
Derivatives break a total into its instantaneous rate. The opposite operation — building a total up from its rates — is integration, and the discovery that these two are inverses is the single most important theorem in mathematics.