The biggest box from a sheet of card, the fastest route to a swimmer, and the theorem that catches speeding drivers
At the top of a smooth hill the ground is level. That one observation, f′(x) = 0 at an interior maximum or minimum, turns “what is the best?” into an equation you can solve. Fold the biggest box, find the quickest way to a swimmer in trouble, then meet the theorem that guarantees an average speed was, at some instant, an actual speed.
Cut a square from each corner of a sheet and fold up the sides. Scrub the cut and watch the volume rise and fall on the graph, then press find the best box to send the cut to the exact maximum.
Drag the 3D view to turn the box. The indigo block is the space the box holds. For a square sheet the best cut is exactly one sixth of the side, whatever its size; for a W × H sheet it is the smaller root of V′(x) = 12x² − 4(W + H)x + WH.
With squares of side x removed from a W × H sheet, the box has base (W − 2x) × (H − 2x) and height x, so
V(x) = x(W − 2x)(H − 2x), 0 ≤ x ≤ min(W, H)/2.
V is zero at both ends of that interval, so its maximum is inside, where the tangent is level. Expanding, V(x) = 4x³ − 2(W + H)x² + WHx and
V′(x) = 12x² − 4(W + H)x + WH = 0 ⇒ x* = [(W + H) − √(W² − WH + H²)] / 6.
The other root lies beyond min(W, H)/2, outside the sheet. For a square of side s the formula gives x* = s/6 and a largest volume of 2s³/27. A check with the second derivative, V″(x*) = 24x* − 4(W + H) < 0, confirms a maximum.
The pattern is always the same. Write the quantity to optimise as a function of one variable, using the constraints to eliminate the others; find where its derivative is zero or undefined; then compare those critical points with the endpoints. The extreme value theorem promises that a continuous function on a closed interval has a largest and a smallest value, so one of these candidates must win.
Running is faster than swimming, so the straight line is not the quickest route. Drag the lifeguard, the swimmer and the entry point, change the two speeds, and race the routes against each other.
Drag the lifeguard, the swimmer, or the white diamond on the shoreline (or drag along the lower graph). Angles are measured from the normal to the shore. Set both speeds equal and the quickest route becomes the straight line.
Put the shoreline on the x-axis, the lifeguard at (g₁, −g₂) on the sand and the swimmer at (s₁, s₂) in the water. Entering at (x, 0) takes
T(x) = √((x − g₁)² + g₂²) / v₁ + √((s₁ − x)² + s₂²) / v₂.
Differentiating, each term gives a cosine of the path’s angle with the shore, which is the sine of its angle with the normal:
T′(x) = sin θ₁ / v₁ − sin θ₂ / v₂ = 0 ⇔ sin θ₁ / v₁ = sin θ₂ / v₂.
T is a sum of two convex functions, so this critical point is the one and only minimum. The equation is exactly the law of refraction for light passing from one medium to another, with v₁ and v₂ the speeds of light in each. Ibn Sahl described the law around 984; Willebrord Snellius found it again in 1621, and in 1662 Pierre de Fermat derived it from his principle that light takes the path of least time, the lifeguard’s principle.
In 2003 Timothy Pennings published “Do Dogs Know Calculus?” in The College Mathematics Journal. He threw a ball into Lake Michigan from the beach, timed his Welsh Corgi, Elvis, running and swimming, and found that the points where Elvis plunged in were remarkably close to the optimal entry points. Elvis, of course, was not differentiating anything; the calculus describes the behaviour, not the dog’s reasoning.
Drag the endpoints a and b. The secant’s slope is the average rate of change, and every point c where the tangent runs parallel to it is found and marked. Try levelling the ends, and try the |x| preset, where the promise breaks.
Drag near either endpoint to move it. The points c are the zeros of f′(x) − m with f′(x) = 60 + 36cos(3x) found symbolically; violet rings mark corners or cusps where f′ does not exist.
Mean value theorem. If f is continuous on [a, b] and differentiable on (a, b), then for at least one c strictly between a and b,
f′(c) = (f(b) − f(a)) / (b − a).
Rolle’s theorem is the special case f(a) = f(b): somewhere in between, f′(c) = 0. Its proof is short. A continuous f on [a, b] attains a maximum and a minimum; if both are at the endpoints, f is constant and any c works; otherwise one of them is inside, where the tangent is level. The general theorem follows by applying Rolle to f minus its secant line, g(x) = f(x) − [f(a) + m(x − a)], which has g(a) = g(b) = 0.
Both hypotheses matter. For |x| on [−1, 2] the average slope is 1/3, but the derivative is −1 or +1 and never anything in between: the corner at 0 lets f′ jump over the value it needed. √x on [0, 4] shows the other side of the fine print: its derivative is infinite at 0, but only differentiability on the open interval is required, and c = 1 does the job.
The theorem is the bridge from local to global facts. It is why f′ = 0 everywhere forces f to be constant, why f′ > 0 makes f increasing, and why two antiderivatives of the same function differ by a constant. Average-speed enforcement relies on it too: if a car covers 30 km between two cameras in 15 minutes, its average speed is 120 km/h, so at some moment the speedometer read exactly 120. Michel Rolle published his theorem for polynomials in 1691; the general statement is usually credited to Lagrange, and Cauchy gave it a rigorous proof in the 1820s.
Spot a mistake or have an idea?