The chord definition of convexity is global: you must compare the function value at every convex combination to the corresponding chord height. Checking this for all pairs of points is impractical. Differentiability turns convexity into a local condition: one inequality on f′ or f′′ at each point replaces the infinitely many chord comparisons.
Condition 1: convexity via monotonicity of f′
Theorem. Let f be differentiable on an open interval I. Then f is convex on I if and only if f′ is monotonically non-decreasing on I.
Proof (⇒): convex ⇒ f′ non-decreasing
Assume f is convex on I. Take x1<x2 in I; the goal is f′(x1)≤f′(x2).
Recall from the convex checkpoint the equivalent secant-slope characterisation: for any a<b<c in I,
b−af(b)−f(a)≤c−bf(c)−f(b).(1)
Apply (1) with a=x1, b=x2, c=x2+h for small h>0:
x2−x1f(x2)−f(x1)≤hf(x2+h)−f(x2).
Taking h→0+ on the right gives f′(x2).
Apply (1) again with a=x1, b=x1+h, c=x2 for small h>0:
hf(x1+h)−f(x1)≤x2−x1−hf(x2)−f(x1+h).
Taking h→0+ on the left gives f′(x1), and the right side tends to x2−x1f(x2)−f(x1).
Chaining:
f′(x1)≤x2−x1f(x2)−f(x1)≤f′(x2).
So f′(x1)≤f′(x2). □
Proof (⇐): f′ non-decreasing ⇒ convex
Assume f′ is non-decreasing on I. Take x<y in I and λ∈(0,1); set z:=λx+(1−λ)y, so x<z<y.
Note that z−x=(1−λ)(y−x) and y−z=λ(y−x).
By the Mean Value Theorem:
f(z)−f(x)=f′(c1)(z−x)for some c1∈(x,z),
f(y)−f(z)=f′(c2)(y−z)for some c2∈(z,y).
Since c1<z<c2 and f′ is non-decreasing, f′(c1)≤f′(c2). Therefore:
z−xf(z)−f(x)=f′(c1)≤f′(c2)=y−zf(y)−f(z).
Substituting z−x=(1−λ)(y−x) and y−z=λ(y−x):
1−λf(z)−f(x)≤λf(y)−f(z).
Multiply through by λ(1−λ)>0:
λ(f(z)−f(x))≤(1−λ)(f(y)−f(z)).
Rearranging:
λf(z)−λf(x)≤(1−λ)f(y)−(1−λ)f(z),
f(z)≤λf(x)+(1−λ)f(y).□
This is exactly the chord inequality, so f is convex.
Condition 2: convexity via the second derivative
Theorem. Let f∈C2(I). Then f is convex on I if and only if f′′(x)≥0 for all x∈I.
Proof. By Condition 1, f is convex on I if and only if f′ is non-decreasing on I. By the Monotonicity Test applied to f′, f′ is non-decreasing on I if and only if (f′)′=f′′≥0 on I. Chaining the two equivalences gives the result. □
Strict convexity
Corollary. If f′′(x)>0 for all x∈I, then f is strictly convex on I.
Proof. Strictly positive f′′ means f′ is strictly increasing (Monotonicity Test, case 1). In the (⇐) proof above, c1<c2 then forces f′(c1)<f′(c2), so every inequality in the chain is strict, giving strict convexity. □
The converse fails: f(x)=x4 satisfies f′′(0)=0 yet is strictly convex — the condition f′′>0 everywhere is sufficient but not necessary for strict convexity.
Recognising convex functions
The second-derivative test makes convexity a matter of sign checking:
| Function | Domain | f′′ | Convex? |
|---|
| x2 | R | 2>0 | Strictly convex |
| x4 | R | 12x2≥0 | Strictly convex (see note above) |
| ex | R | ex>0 | Strictly convex |
| −lnx | (0,∞) | 1/x2>0 | Strictly convex |
| lnx | (0,∞) | −1/x2<0 | Strictly concave |
| x3 | R | 6x, changes sign | Neither convex nor concave |
For f(x)=x3: f′′(x)>0 on (0,∞) and f′′(x)<0 on (−∞,0), so f is convex on (0,∞) and concave on (−∞,0), but not on all of R.
Summary
- Condition 1: f differentiable on I is convex ⟺ f′ is non-decreasing on I.
- (⇒): The secant-slope property of convex functions squeezes f′(x1)≤f′(x2).
- (⇐): MVT produces c1<c2 with f′(c1)≤f′(c2), which algebraically yields the chord inequality.
- Condition 2: f∈C2(I) is convex ⟺ f′′≥0 on I (combining Condition 1 with the Monotonicity Test for f′).
- Strict convexity: f′′>0 everywhere ⇒ strictly convex; the converse can fail at isolated points.
- To check convexity in practice: compute f′′ and determine its sign on the interval of interest.