Convexity and the Second Derivative
Why does a graph shaped like a bowl always sit above its own tangent lines? This simple geometric fact — that convex curves never dip below their tangents — turns out to be exactly equivalent to an analytic statement about derivatives. It is the hinge on which a huge amount of calculus, optimization, and analysis turns. Convexity is the property that separates functions whose critical points are automatically global minima from functions with complicated landscapes of local extrema. It is also the reason inequalities like the arithmetic-geometric mean inequality or Jensen's inequality hold. The central discovery of this article is that convexity, a purely geometric condition about chords and tangent lines, can be completely characterized by monotonicity of the derivative. When a second derivative exists, it can also be characterized by its sign. This converts a global, quantifier-heavy geometric definition into a pointwise, computable criterion: check whether . The bridge between the geometric and the analytic pictures is built using the Mean Value Theorem and the established link between Monotonicity and the Sign of the Derivative. The payoff is twofold. First, we get a rigorous second derivative test: at a critical point where is strictly positive, has a strict local minimum. Dually, where is strictly negative, has a strict local maximum. Second, we get a structural understanding of the entire graph of . This includes where it curves upward, where it curves downward, and where it switches (an inflection point). Such understanding is indispensable for accurate curve-sketching. It is also essential for later work on Taylor Polynomials and Local Approximation, where the second derivative controls the quadratic term of the local approximation. This article gives the precise definition of convexity for a function on an interval. It proves the equivalence with monotonicity of , and proves the second-derivative criterion. It also proves the second-derivative test for local extrema. Full hypotheses and complete proofs are included, along with worked examples with asymmetric data. A counterexample shows exactly where each hypothesis is load-bearing.
- A function is convex on an interval if every chord lies on or above the graph; equivalently, the graph lies on or above every tangent line.
- Convexity is nondecreasing (assuming differentiable on the interval) — a direct corollary of the Mean Value Theorem.
- If exists and throughout an interval, is convex there; if , is strictly convex.
- The second derivative test: at a critical point with , has a strict local min; with , a strict local max; is inconclusive.
- An inflection point is a point where convexity switches from one type to the other; if exists there and is continuous nearby, must vanish at such a point, but the converse can fail.
- Strict inequalities in the hypothesis do not always give strict inequalities in the conclusion, and vice versa — the classic trap is assuming forces an inflection point.
- Key idea: convexity is a global geometric statement about chords and tangents that collapses, via the Mean Value Theorem, into the simple pointwise condition .
Where this lives today
Convexity detected via is the workhorse test in optimization theory: convex objective functions guarantee that any local minimum found by gradient descent is a global minimum, which is the theoretical bedrock of convex optimization used throughout machine learning, statistics (maximum likelihood estimation for exponential families), and operations research (linear and quadratic programming). In economics, concavity of utility functions (equivalently convexity of ) encodes diminishing marginal utility, and the second-derivative sign test identifies optimal consumption bundles. In physics, the convexity of potential energy functions near equilibrium (via a positive second derivative, i.e. a positive "spring constant") is precisely the condition for stable equilibrium, a direct application of the second derivative test. In probability and information theory, Jensen's inequality — a direct consequence of the chord definition of convexity — underlies bounds on entropy, moment inequalities, and the AM–GM inequality. In numerical analysis and CS, convexity certificates (checking symbolically or numerically) are used to certify that a numerical solver's found critical point is trustworthy, and convex functions admit especially efficient root-finding and optimization algorithms (e.g. Newton's method converges globally on convex problems under mild conditions).
Ask the tutor: How does the second derivative controlling convexity foreshadow the role of the quadratic term in a Taylor expansion?
Let be an interval and let . We say is convex on if for all and all ,
We say is strictly convex on if the inequality is strict whenever and . We say is (strictly) concave if is (strictly) convex. Geometrically: the point traces the chord joining to as ranges over , so convexity says every chord lies on or above the graph. A point in the interior of is an inflection point of if is convex on one side of and concave on the other — i.e., there exist with convex on and concave on , or vice versa.
Intuition
Picture the graph of as a wire bent into some shape. Convexity says: stretch a rubber band between any two points on the wire, and the band (the chord) stays above the wire everywhere in between. This is a statement about all pairs of points simultaneously — a global condition. Yet intuitively, "curving upward like a bowl" feels like a local property, something you could in principle detect by zooming in on a single point and checking how fast the slope is changing there. The derivative is the instantaneous slope. If is increasing as increases, the tangent lines are rotating counterclockwise as we sweep left to right — exactly the rotation pattern that keeps chords above the curve. This is the first bridge: convex nondecreasing. The second derivative measures the rate at which the slope changes, so is the infinitesimal version of " nondecreasing," which the Mean Value Theorem promotes to the full statement about on the whole interval, which in turn (via another application of MVT) promotes to the full chord statement about . At a critical point (), convexity near means the tangent line at is horizontal and the curve stays above it — so must be a local minimum. This is the geometric heart of the second derivative test.
Let be an open interval and let be differentiable on .
(A) is convex on if and only if is nondecreasing on .
(B) is strictly convex on if and only if is strictly increasing on .
(C) If in addition is twice differentiable on , then:
- is convex on if and only if for all .
- If for all , then is strictly convex on (the converse is false in general).
(The analogous statements for concave functions hold with all inequalities reversed, applying the theorem to .)
We break the proof into steps, each a self-contained lemma, using the Mean Value Theorem as the sole analytic engine and the established equivalence between sign of a derivative and monotonicity from Monotonicity and the Sign of the Derivative for part (C).
Step 1: An equivalent three-point form of convexity. Claim: is convex on if and only if for all with ,
Proof of claim. Write where (so ). Convexity applied to gives
Subtracting and dividing by :
This is the left inequality of . For the right inequality, rewrite the same convexity inequality as
and divide by to get , the right inequality. Conversely, if holds for all in , reversing the algebra above (for any in and , set , , , which lies strictly between and ) recovers the defining inequality of convexity. This proves the claim, with strict inequalities throughout corresponding to strict convexity by the identical argument with replaced by . (end of Step 1)
Step 2 (A, ): Convex implies nondecreasing. Suppose is convex on . Let in ; we must show . Pick any with (possible since is an interval, hence contains ). By with :
Now let in the leftmost expression: since is differentiable at , . This gives
Similarly, let in the rightmost expression: , giving
Chaining these: , so . Since were arbitrary, is nondecreasing on .
Step 3 (A, ): nondecreasing implies convex. Suppose is nondecreasing on . We verify for arbitrary in . By the Mean Value Theorem applied to on and on (valid since is differentiable, hence continuous, on these closed sub-intervals contained in ), there exist and with
Since and is nondecreasing, , i.e.
This gives the outer inequality of a rearranged form of ; we still must derive the two inequalities in involving the chord over . Note that
is a weighted average of and : explicitly, with ,
which is verified directly: , and dividing through appropriately recovers this weighted-average identity (a short algebraic check: reduces correctly since makes the two terms combine to ). Since a weighted average of two numbers lies between them, and by the first is the second, we get
which is exactly . By Step 1, is convex on .
Step 4 (B): Strict version. If is strictly increasing, the inequality in Step 3 becomes strict (since ), making strict, and the weighted-average argument then gives strict inequalities in ; by the strict case of Step 1's claim, is strictly convex. Conversely, if is strictly convex, then holds strictly for all ; running the limiting argument of Step 2 with fixed and inserting a strict inequality point shows whenever such a exists strictly between — which it always does since is an interval — giving strictly. (The key point: the two limiting inequalities from Step 2 remain non-strict in the limit even when the pre-limit inequality is strict, but here we get the sharper strict middle term sandwiched strictly, which forces combined with the already-established from part (A); hence .) This establishes (B).
Step 5 (C): The second-derivative criterion. Now suppose is twice differentiable on , so exists on . By the result Monotonicity and the Sign of the Derivative applied to the function (which is differentiable with ):
i.e. is nondecreasing on if and only if for all . Combined with part (A), this gives:
For the strict statement: the same cited result gives that for all implies strictly increasing (this is the direction of that theorem that does not require a converse), i.e. everywhere implies strictly increasing, which by part (B) implies strictly convex. The converse fails — a strictly convex need not have everywhere — as exhibited in the counterexample below, so we assert only the one-directional implication.
∎Worked examples
Example 1 — locating convexity/concavity regions and an inflection point for an asymmetric cubic-quartic mix. Let
(This is chosen non-symmetrically so no shortcut from symmetry is available.) Compute derivatives:
(Check: . ✓.)
Since for all , with equality only at , we get everywhere, and for all . By Theorem (C), is convex on all of , and since off a single point, is in fact strictly convex on (strict convexity survives a single zero of ; we verify this directly: is strictly increasing on since is strictly increasing, so by Theorem (B), is strictly convex — this shows the "only if" direction of the strict statement in (C) can fail to be needed when we argue via (B) directly). Is an inflection point? By definition we need to change from convex to concave or vice versa across . But we just showed is convex on all of , including both sides of — there is no switch. So is a zero of but not an inflection point. This is a clean illustration that is necessary for an inflection at (when is continuous, as we prove in the Scope section) but not sufficient. Finally, since vanishes only at , and is strictly convex, is the unique critical point and (by strict convexity, chords lie strictly above the graph, forcing the tangent-below-graph property globally) it is the global minimum. Value: .
Example 2 — second derivative test with an asymmetric transcendental-polynomial function, including an inconclusive case. Let
First derivative (product rule):
Critical points: (since always). Second derivative: differentiate using the product rule,
Factor: .
At : . Since and , the second derivative test (proved below) gives that is a strict local maximum, with value
At : , and . The second derivative test is inconclusive at . We resolve it by direct inspection: for near , always, and , so the sign of near is the sign of , which is positive for near (indeed for all ). So on both sides of (with equality only at itself) — is nondecreasing through with a "flat" critical point that is neither a local max nor a local min (it is a saddle-type critical point where the graph merely levels off while continuing to rise). This shows concretely why genuinely gives no information without further work, matching the theorem's own disclaimer. As a bonus, check where changes sign to locate inflection points: . The roots of are (by the quadratic formula: ), numerically and . Together with the root , has three real zeros: , and generically changes sign at each (a short sign-chart check on , noting always, confirms each is a genuine sign change), giving three inflection points — a richer structure than the purely polynomial Example 1.
Let be twice differentiable on an open interval containing , with .
- If , then has a strict local minimum at .
- If , then has a strict local maximum at .
- If , the test is inconclusive: examples exist in each of the categories (strict local min, strict local max, neither).
Using the technique of direct estimation from the definition of the second derivative as a limit (avoiding any circular appeal to Theorem (C) restricted to a one-sided neighborhood, so this is proved independently and can even be used as an alternate route to local statements of Theorem (C)): Suppose . By definition,
using . Since this limit is a positive number, there exists such that for all with ,
(This is the standard "limit positive eventually positive" fact: taking in the definition of the limit produces such a .) This means: for , ; and for , (dividing by a negative flips the sign). So is negative immediately to the left of and positive immediately to the right of , on . By the theorem Monotonicity and the Sign of the Derivative, is strictly decreasing on and strictly increasing on . Hence for any with : if , (strict decrease means values to the left are larger); if , (strict increase means values to the right are larger). In both cases , so is a strict local minimum. The case is identical with all inequalities reversed (or apply the above to , noting and a local min of at is a local max of at ). For inconclusiveness: exhibit , , , all with , , . Direct check: has a strict local (indeed global) min at ; a strict local max; is strictly increasing everywhere (since with equality only at an isolated point, which by the strict-monotonicity criterion still gives strict increase) hence has neither a local max nor min at . This exhibits all three possible outcomes, proving the inconclusiveness claim.
∎Dropping differentiability of entirely. Consider on . This function is convex (the chord between any two points on the V-shape lies on or above the graph — a direct check: for of the same sign, is affine there and the chord equals the graph; for , the chord is a straight segment lying above the "kink" at since is dips down only exactly to the corner). But is not differentiable at , so Theorem (C) — which requires twice differentiable on the whole open interval — simply does not apply at that point; there is no contradiction, but it shows the hypothesis "differentiable on " (used even in part (A)) is not a mere technicality; without it, the entire chain of reasoning through collapses since does not exist.
Dropping " implies strict convexity" as an "if and only if." The converse claimed false in Theorem (C) — that strictly convex does not imply everywhere — is witnessed by on . We showed in the proof of the Second Derivative Test that this function is convex; in fact by Theorem (B) applied to (strictly increasing since is strictly increasing), is strictly convex on all of . Yet
which vanishes at , so it is false that everywhere. This is a genuine counterexample to the converse direction, confirming exactly what Theorem (C) asserts (only one direction of that particular implication) and warning against over-claiming the biconditional there.
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| differentiable on open | Convex nondecreasing (Theorem A) | Nothing extra needed; this direction is a full "iff" |
| twice differentiable on open | Convex (Theorem C) | Still a full "iff" |
| on | strictly convex | Converse fails: strictly convex functions can have isolated zeros of (Example: ) |
| at a single point | No conclusion by itself | may be local min, local max, neither, or an inflection point — all four are possible |
| not differentiable somewhere on | Definition of convexity (chords) still makes sense | Theorem (A)/(C) simply do not apply there; must fall back to the chord definition directly |
| Closed interval endpoints | Convexity as a chord condition extends fine to closed intervals | The derivative-based criterion needs one-sided derivatives at endpoints, a mild extension not covered by the open-interval statement above |
The mathematician behind it
Origins · 1 minJean Gaston Darboux and how this was discovered
Darboux is best known for the Mean Value Theorem-adjacent result that derivatives satisfy the intermediate value property even when discontinuous (the Darboux property), a fact quietly underlying careful treatments of when must vanish at a genuine inflection point. He worked at the École Normale Supérieure and the Sorbonne, shaping the rigorous French school of analysis that formalized exactly the kind of – reasoning used to convert the geometric notion of convexity into the analytic criterion on .
Does convexity require to be differentiable at all?
No. The chord definition (every secant line lies on or above the graph) makes sense for any function on an interval, differentiable or not — the classic example is , which is convex but fails to be differentiable at . The derivative-based characterizations in this article (convex nondecreasing, or ) require differentiability, or twice-differentiability, respectively, as explicit hypotheses; they are tools for verifying convexity efficiently when derivatives exist, not part of the definition itself.
Why is "nondecreasing," not "increasing," the correct condition for plain (non-strict) convexity?
Plain convexity allows straight-line (affine) pieces in the graph, and an affine function has constant derivative, which is nondecreasing but not strictly increasing. For instance is convex (check the chord condition directly) with nondecreasing (constant , then jump to constant ) but not strictly increasing on any interval containing the kink. If you want to rule out flat pieces, you need strict convexity, which correctly corresponds to strictly increasing , as proved in part (B) of the theorem.
Is the second derivative test the same thing as the first derivative test?
They are different tools proving the same kind of conclusion by different means. The first derivative test examines the sign of on both sides of a critical point directly, and works even when fails to exist or vanishes. The second derivative test is often computationally faster (evaluate one number, ) but is inconclusive exactly when , in which case you must fall back to the first derivative test or examine higher derivatives (as foreshadowed by Taylor Polynomials and Local Approximation, where the first nonzero derivative at determines the local behavior).
How does convexity relate to Jensen's inequality?
Jensen's inequality is the natural extension of the two-point chord definition to finitely many points (and to expectations of random variables): if is convex and with weights , , then
The case is exactly the definition of convexity given in this article; the general case follows by induction on , splitting off one term and applying the two-point definition to the remaining weighted average. This is the mechanism behind AM–GM, entropy bounds, and many moment inequalities in probability.
Can a function be convex on an interval but have no second derivative anywhere?
Yes, though it takes some care to arrange, and such examples are more delicate than they first appear; the key fact used in this article's proof of Theorem (A) is that convexity only requires (first derivative) to exist and be nondecreasing — it does not require to exist. A convex function's derivative , being monotonic, is guaranteed by a classical real-analysis fact to be differentiable almost everywhere (a theorem of Lebesgue), but it can genuinely fail to be differentiable on a (measure-zero) set of points, so need not exist everywhere even though convexity holds everywhere in the chord sense.
Why does the theorem require the interval to be open?
Openness ensures every point of has points of on both sides, which is exactly what is needed to freely pick strictly between and in Step 2 of the proof, and to apply the Mean Value Theorem on sub-intervals whose closures still sit inside in Step 3. On a closed interval , one typically needs one-sided derivatives at the endpoints to state the fully analogous criterion; the chord (Jensen-style) definition of convexity itself works perfectly well on closed or even non-open intervals without any change.
What exactly distinguishes an inflection point from a mere zero of ?
An inflection point is defined purely in terms of convexity switching type on either side of the point — it is a statement about , not directly about . When exists and is continuous near a genuine inflection point , the Intermediate Value Theorem forces (since must pass through zero to switch sign, assuming it switches sign cleanly), but the converse can fail, as shown explicitly in Example 1 where yet no switch occurs. Always confirm an actual, persistent sign change of on both sides before calling a point an inflection point.