MathLabs

Grade 12

Applications of the Derivative

How the sign and zeros of the derivative reveal where a function increases, decreases, and reaches its extrema, culminating in an algorithm for global maxima/minima on an interval and real optimization problems.

IntuitionReading the shape of a curve from its slope

Picture the elevation profile of a hiking trail plotted as f(x)f(x), where xx is the distance walked. When you are climbing, the trail's slope f′(x)f'(x) is positive; when descending, f′(x)f'(x) is negative; and right at a summit or a valley bottom, the ground is momentarily flat, so f′(x)=0f'(x)=0. The whole theory of "monotonicity and extrema" is exactly this everyday observation turned into a precise, provable statement: the sign of the derivative tells you where a function rises and falls, and the zeros of the derivative mark the candidate turning points.

Interactive cubic function plot with sliders for coefficients a, b, c, d; the curve shows a local maximum near x=-1 and a local minimum near x=1.
The cubic f(x)=x3−3x+2f(x)=x^3-3x+2. Drag the sliders a,b,c,da,b,c,d of f(x)=ax3+bx2+cx+df(x)=ax^3+bx^2+cx+d and watch how the intervals where the curve rises or falls, and the location of its "hilltop" and "valley", change together with the shape of the graph.

SchoolMonotonicity and extrema on an interval

Definition: Increasing, decreasing, and local extrema

A function ff is increasing on an interval KK if for all x1,x2∈Kx_1,x_2\in K with x1<x2x_1<x_2 we have f(x1)<f(x2)f(x_1)<f(x_2), and decreasing if instead f(x1)>f(x2)f(x_1)>f(x_2). A point x0x_0 interior to the domain is a local maximum if there is a δ>0\delta>0 with f(x)≤f(x0)f(x)\le f(x_0) for every xx within δ\delta of x0x_0; a local minimum is defined the same way with the inequality reversed. Points where f′(x0)=0f'(x_0)=0 or f′(x0)f'(x_0) fails to exist are called critical points — the only candidates for local extrema.

f′(x)>0  ∀ x∈(a,b)  ⟹  ∀ x1<x2∈(a,b), f(x1)<f(x2)f'(x) > 0 \;\forall\, x \in (a,b) \implies \forall\, x_1 < x_2 \in (a,b),\ f(x_1) < f(x_2)

Checking that inequality directly from the definition is awkward for a complicated ff. The next theorem replaces it with a test you can actually compute: look at the sign of f′(x)f'(x).

f′(x0)=0, f′′(x0)>0  ⟹  f(x)≥f(x0);f′(x0)=0, f′′(x0)<0  ⟹  f(x)≤f(x0)f'(x_0)=0,\ f''(x_0)>0 \implies f(x)\ge f(x_0); \qquad f'(x_0)=0,\ f''(x_0)<0 \implies f(x)\le f(x_0)
Reading monotonicity, extrema, and concavity from the derivatives
Sign conditionConclusion
f′(x)>0f'(x)>0 on (a,b)(a,b)ff is increasing on (a,b)(a,b)
f′(x)<0f'(x)<0 on (a,b)(a,b)ff is decreasing on (a,b)(a,b)
f′(x0)=0f'(x_0)=0, sign of f′f' changes across x0x_0x0x_0 is a local extremum
f′(x0)=0f'(x_0)=0, f′′(x0)>0f''(x_0)>0x0x_0 is a local minimum (graph curves upward)
f′(x0)=0f'(x_0)=0, f′′(x0)<0f''(x_0)<0x0x_0 is a local maximum (graph curves downward)
f′′(x0)=0f''(x_0)=0, sign of f′′f'' changes across x0x_0x0x_0 is an inflection point

UndergraduateTwo theorems: from the Mean Value Theorem to a test for extrema

Let ff be continuous on [a,b][a,b] and differentiable on (a,b)(a,b). If f′(x)≥0f'(x)\ge 0 for every x∈(a,b)x\in(a,b), and f′(x)=0f'(x)=0 at only finitely many points, then ff is increasing on [a,b][a,b]. If instead f′(x)≤0f'(x)\le 0 under the same condition, ff is decreasing on [a,b][a,b].

Why is it true?

A positive derivative means every tangent line points uphill; a curve that keeps following uphill tangents cannot come back down. Lagrange's Mean Value Theorem turns that picture into a rigorous inequality between any two points.

Proof

Take any x1<x2x_1<x_2 in [a,b][a,b]. Since ff is continuous on [x1,x2][x_1,x_2] and differentiable on (x1,x2)(x_1,x_2), Lagrange's Mean Value Theorem gives a point c∈(x1,x2)c\in(x_1,x_2) with f(x2)−f(x1)=f′(c)(x2−x1)f(x_2)-f(x_1)=f'(c)(x_2-x_1).

Because f′(c)≥0f'(c)\ge 0 and x2−x1>0x_2-x_1>0, the right-hand side is ≥0\ge 0, so f(x2)≥f(x1)f(x_2)\ge f(x_1). This already shows ff is non-decreasing on [a,b][a,b].

To upgrade "non-decreasing" to strictly "increasing" despite the finitely many zeros of f′f', list those zeros as t1<t2<⋯<tkt_1<t_2<\dots<t_k inside (x1,x2)(x_1,x_2). On each open piece between consecutive points of the list {x1,t1,…,tk,x2}\{x_1,t_1,\dots,t_k,x_2\}, f′f' is strictly positive, so the same Mean Value Theorem argument applied to any two points inside that piece gives a strict inequality f(u)<f(v)f(u)<f(v) for u<vu<v there.

By continuity of ff, the strict inequalities on consecutive pieces chain together: if x1<u<t1<v<x2x_1<u<t_1<v<x_2 say, then f(x1)<f(u)<f(t1)≤f(v)<f(x2)f(x_1)<f(u)<f(t_1)\le f(v)<f(x_2), and since this holds for every choice of u,vu,v arbitrarily close to the endpoints, f(x1)<f(x2)f(x_1)<f(x_2) follows. Hence ff is (strictly) increasing on [a,b][a,b]. The decreasing case follows by applying this argument to −f-f.

If ff is differentiable at an interior point x0x_0 of its domain and x0x_0 is a local extremum of ff, then f′(x0)=0f'(x_0)=0. Conversely, if f′(x0)=0f'(x_0)=0 and ff is twice differentiable near x0x_0 with f′′(x0)≠0f''(x_0)\ne 0, then x0x_0 is a local minimum when f′′(x0)>0f''(x_0)>0, and a local maximum when f′′(x0)<0f''(x_0)<0.

Why is it true?

At an extremum the tangent line must be horizontal, because the curve cannot keep rising (or falling) past a peak (or valley) without turning around; the second derivative then measures which way the curve bends at that flat point, telling a valley from a peak.

Proof

(Necessity.) Suppose x0x_0 is a local maximum; the local-minimum case is symmetric. There is δ>0\delta>0 with f(x)≤f(x0)f(x)\le f(x_0) for all xx with ∣x−x0∣<δ|x-x_0|<\delta. For h∈(0,δ)h\in(0,\delta), f(x0+h)−f(x0)h≤0\dfrac{f(x_0+h)-f(x_0)}{h}\le 0, and letting h→0+h\to 0^+ gives f′(x0)≤0f'(x_0)\le 0. For h∈(−δ,0)h\in(-\delta,0), the numerator is ≤0\le 0 and the denominator is negative, so f(x0+h)−f(x0)h≥0\dfrac{f(x_0+h)-f(x_0)}{h}\ge 0, and letting h→0−h\to 0^- gives f′(x0)≥0f'(x_0)\ge 0. Since ff is differentiable at x0x_0, both one-sided limits agree, forcing f′(x0)=0f'(x_0)=0.

(Sufficiency, case f′′(x0)>0f''(x_0)>0.) Since f′(x0)=0f'(x_0)=0 and f′′f'' exists near x0x_0, the definition of f′′f'' as the derivative of f′f' gives f′(x)=f′(x0)+f′′(x0)(x−x0)+o(x−x0)=f′′(x0)(x−x0)+o(x−x0)f'(x)=f'(x_0)+f''(x_0)(x-x_0)+o(x-x_0)=f''(x_0)(x-x_0)+o(x-x_0) as x→x0x\to x_0. Because f′′(x0)>0f''(x_0)>0, this expression is negative for xx slightly less than x0x_0 and positive for xx slightly greater than x0x_0.

So f′f' changes sign from −- to ++ across x0x_0: by the monotonicity theorem, ff is decreasing just to the left of x0x_0 and increasing just to the right, which is exactly the definition of a local minimum at x0x_0.

The case f′′(x0)<0f''(x_0)<0 is identical with all inequalities reversed, giving f′f' changing from ++ to −-, hence a local maximum. When f′′(x0)=0f''(x_0)=0 the expansion above gives no information about the sign of f′f' near x0x_0, so the test is inconclusive and one must examine the sign of f′f' directly (as the pitfall below illustrates with f(x)=x3f(x)=x^3).

AdvancedGlobal extrema on a closed interval, and asymptotes

A function continuous on a closed, bounded interval [a,b][a,b] always attains a global maximum MM and a global minimum mm somewhere on [a,b][a,b] (Weierstrass's extreme value theorem). Local extrema found by the sign of f′f' are only candidates for these global values — the global maximum or minimum could instead sit at an endpoint aa or bb, where the sign-change argument does not apply. The practical algorithm is therefore: list the finitely many critical points x1,…,xkx_1,\dots,x_k in (a,b)(a,b), evaluate ff there and at both endpoints, and compare.

M=max⁡[a,b]f=max⁡{f(a),f(x1),…,f(xk),f(b)},m=min⁡[a,b]f=min⁡{f(a),f(x1),…,f(xk),f(b)}M=\max_{[a,b]}f=\max\{f(a),f(x_1),\dots,f(x_k),f(b)\},\qquad m=\min_{[a,b]}f=\min\{f(a),f(x_1),\dots,f(x_k),f(b)\}

When the domain is unbounded, curves can approach a line without ever touching it — an asymptote. The line x=x0x=x_0 is a vertical asymptote if lim⁡x→x0±f(x)=±∞\lim_{x\to x_0^\pm}f(x)=\pm\infty; the line y=Ly=L is a horizontal asymptote if lim⁡x→+∞f(x)=L\lim_{x\to+\infty}f(x)=L or lim⁡x→−∞f(x)=L\lim_{x\to-\infty}f(x)=L; and the line y=ax+by=ax+b (with a≠0a\ne 0) is an oblique asymptote if a=lim⁡x→∞f(x)xa=\lim_{x\to\infty}\dfrac{f(x)}{x} and b=lim⁡x→∞[f(x)−ax]b=\lim_{x\to\infty}[f(x)-ax] both exist and are finite. These three cases cover every way a rational function's graph can "settle down" far from the origin.

UndergraduateReal-world applications: optimization in engineering and physics

Turning the sign of f′f' into an algorithm is what makes derivatives a working tool rather than a curiosity: whenever a real quantity (cost, area, volume, height) can be written as a function of one variable, differentiating and applying the tests above locates the best possible choice. The two examples below come from manufacturing and from projectile motion.

Example: Maximizing the volume of an open-top box

From a square sheet of cardboard with side 1212 cm, equal squares of side xx are cut from each of the four corners, and the flaps are folded up to form an open-top box. Find the value of xx that maximizes the box's volume, and the maximum volume.

Solution

The base of the box has side 12−2x12-2x (each side loses two flaps of width xx), and the height is xx, so the volume is V(x)=x(12−2x)2V(x)=x(12-2x)^2 for x∈(0,6)x\in(0,6).

Expand or differentiate directly with the product rule: V′(x)=(12−2x)2+x⋅2(12−2x)(−2)=(12−2x)[(12−2x)−4x]=(12−2x)(12−6x)V'(x)=(12-2x)^2+x\cdot 2(12-2x)(-2)=(12-2x)\big[(12-2x)-4x\big]=(12-2x)(12-6x). Setting V′(x)=0V'(x)=0 gives x=6x=6 (excluded, it is an endpoint of the domain) or x=2x=2.

Since V′(x)=6(6−x)(2−x)V'(x)=6(6-x)(2-x) up to a positive constant near the relevant range, V′(x)>0V'(x)>0 for 0<x<20<x<2 and V′(x)<0V'(x)<0 for 2<x<62<x<6: the sign of V′V' changes from ++ to −- at x=2x=2, so by the sign test, x=2x=2 is a local (and, since it is the only critical point in (0,6)(0,6), global) maximum.

The maximum volume is V(2)=2⋅(12−4)2=2⋅64=128V(2)=2\cdot(12-4)^2=2\cdot 64=128 cm3^3.

Example: Maximum height of a thrown ball

A ball thrown straight up has height (in meters) given by h(t)=−5t2+20t+1h(t)=-5t^2+20t+1, where tt is time in seconds. Find the time at which the ball reaches its maximum height, and that maximum height.

Solution

The velocity is h′(t)=−10t+20h'(t)=-10t+20. Setting h′(t)=0h'(t)=0 gives t=2t=2 seconds, the only critical point.

Since h′′(t)=−10<0h''(t)=-10<0 for all tt, the second-derivative test confirms t=2t=2 is a local maximum; because hh is a downward-opening parabola, this local maximum is also the global maximum over all t≥0t\ge 0.

Substituting back, h(2)=−5(2)2+20(2)+1=−20+40+1=21h(2)=-5(2)^2+20(2)+1=-20+40+1=21. So the ball reaches its maximum height of 2121 meters at t=2t=2 seconds — after that, h′(t)<0h'(t)<0 and the ball is falling back down, matching the physical picture of a projectile decelerating under gravity, momentarily stopping, then descending.

On which set is f(x)=x3−3xf(x)=x^3-3x increasing?

If f′(x0)=0f'(x_0)=0 and f′′(x0)>0f''(x_0)>0, what is x0x_0?

A ball thrown up has height h(t)=−5t2+20t+1h(t)=-5t^2+20t+1 meters. At what time tt does it reach maximum height?

Cutting squares of side xx from a 1212 cm square sheet and folding up the sides forms an open-top box. Which xx maximizes the volume?

References

  1. Michael Spivak (2008). Calculus
  2. Stephen Boyd, Lieven Vandenberghe (2004). Convex Optimization