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), where x is the distance walked. When you are climbing, the trail's slope f′(x) is positive; when descending, f′(x) is negative; and right at a summit or a valley bottom, the ground is momentarily flat, so f′(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+2. Drag the sliders a,b,c,d of f(x)=ax3+bx2+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 f is increasing on an interval K if for all x1,x2∈K with x1<x2 we have f(x1)<f(x2), and decreasing if instead f(x1)>f(x2). A point x0 interior to the domain is a local maximum if there is a δ>0 with f(x)≤f(x0) for every x within δ of x0; a local minimum is defined the same way with the inequality reversed. Points where f′(x0)=0 or f′(x0) 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)
Checking that inequality directly from the definition is awkward for a complicated f. The next theorem replaces it with a test you can actually compute: look at the sign off′(x).
Let f be continuous on [a,b] and differentiable on (a,b). If f′(x)≥0 for every x∈(a,b), and f′(x)=0 at only finitely many points, then f is increasing on [a,b]. If instead f′(x)≤0 under the same condition, f is decreasing on [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<x2 in [a,b]. Since f is continuous on [x1,x2] and differentiable on (x1,x2), Lagrange's Mean Value Theorem gives a point c∈(x1,x2) with f(x2)−f(x1)=f′(c)(x2−x1).
Because f′(c)≥0 and x2−x1>0, the right-hand side is ≥0, so f(x2)≥f(x1). This already shows f is non-decreasing on [a,b].
To upgrade "non-decreasing" to strictly "increasing" despite the finitely many zeros of f′, list those zeros as t1<t2<⋯<tk inside (x1,x2). On each open piece between consecutive points of the list {x1,t1,…,tk,x2}, 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) for u<v there.
By continuity of f, the strict inequalities on consecutive pieces chain together: if x1<u<t1<v<x2 say, then f(x1)<f(u)<f(t1)≤f(v)<f(x2), and since this holds for every choice of u,v arbitrarily close to the endpoints, f(x1)<f(x2) follows. Hence f is (strictly) increasing on [a,b]. The decreasing case follows by applying this argument to −f.
If f is differentiable at an interior point x0 of its domain and x0 is a local extremum of f, then f′(x0)=0. Conversely, if f′(x0)=0 and f is twice differentiable near x0 with f′′(x0)=0, then x0 is a local minimum when f′′(x0)>0, and a local maximum when f′′(x0)<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 x0 is a local maximum; the local-minimum case is symmetric. There is δ>0 with f(x)≤f(x0) for all x with ∣x−x0∣<δ. For h∈(0,δ), hf(x0+h)−f(x0)≤0, and letting h→0+ gives f′(x0)≤0. For h∈(−δ,0), the numerator is ≤0 and the denominator is negative, so hf(x0+h)−f(x0)≥0, and letting h→0− gives f′(x0)≥0. Since f is differentiable at x0, both one-sided limits agree, forcing f′(x0)=0.
(Sufficiency, case f′′(x0)>0.) Since f′(x0)=0 and f′′ exists near x0, the definition of f′′ as the derivative of f′ gives f′(x)=f′(x0)+f′′(x0)(x−x0)+o(x−x0)=f′′(x0)(x−x0)+o(x−x0) as x→x0. Because f′′(x0)>0, this expression is negative for x slightly less than x0 and positive for x slightly greater than x0.
So f′ changes sign from − to + across x0: by the monotonicity theorem, f is decreasing just to the left of x0 and increasing just to the right, which is exactly the definition of a local minimum at x0.
The case f′′(x0)<0 is identical with all inequalities reversed, giving f′ changing from + to −, hence a local maximum. When f′′(x0)=0 the expansion above gives no information about the sign of f′ near x0, so the test is inconclusive and one must examine the sign of f′ directly (as the pitfall below illustrates with f(x)=x3).
AdvancedGlobal extrema on a closed interval, and asymptotes
A function continuous on a closed, bounded interval [a,b] always attains a global maximum M and a global minimum m somewhere on [a,b] (Weierstrass's extreme value theorem). Local extrema found by the sign of f′ are only candidates for these global values — the global maximum or minimum could instead sit at an endpoint a or b, where the sign-change argument does not apply. The practical algorithm is therefore: list the finitely many critical points x1,…,xk in (a,b), evaluate f there and at both endpoints, and compare.
When the domain is unbounded, curves can approach a line without ever touching it — an asymptote. The line x=x0 is a vertical asymptote if limx→x0±f(x)=±∞; the line y=L is a horizontal asymptote if limx→+∞f(x)=L or limx→−∞f(x)=L; and the line y=ax+b (with a=0) is an oblique asymptote if a=limx→∞xf(x) and b=limx→∞[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′ 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 12 cm, equal squares of side x are cut from each of the four corners, and the flaps are folded up to form an open-top box. Find the value of x that maximizes the box's volume, and the maximum volume.
Solution
The base of the box has side 12−2x (each side loses two flaps of width x), and the height is x, so the volume is V(x)=x(12−2x)2 for x∈(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). Setting V′(x)=0 gives x=6 (excluded, it is an endpoint of the domain) or x=2.
Since V′(x)=6(6−x)(2−x) up to a positive constant near the relevant range, V′(x)>0 for 0<x<2 and V′(x)<0 for 2<x<6: the sign of V′ changes from + to − at x=2, so by the sign test, x=2 is a local (and, since it is the only critical point in (0,6), global) maximum.
The maximum volume is V(2)=2⋅(12−4)2=2⋅64=128 cm3.
Example: Maximum height of a thrown ball
A ball thrown straight up has height (in meters) given by h(t)=−5t2+20t+1, where t 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+20. Setting h′(t)=0 gives t=2 seconds, the only critical point.
Since h′′(t)=−10<0 for all t, the second-derivative test confirms t=2 is a local maximum; because h is a downward-opening parabola, this local maximum is also the global maximum over all t≥0.
Substituting back, h(2)=−5(2)2+20(2)+1=−20+40+1=21. So the ball reaches its maximum height of 21 meters at t=2 seconds — after that, h′(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−3x increasing?
If f′(x0)=0 and f′′(x0)>0, what is x0?
A ball thrown up has height h(t)=−5t2+20t+1 meters. At what time t does it reach maximum height?
Cutting squares of side x from a 12 cm square sheet and folding up the sides forms an open-top box. Which x maximizes the volume?