Differential Conditions for Convexity

Basis
Last updated: Tags: Calculus, Convexity

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′f' or f′′f'' at each point replaces the infinitely many chord comparisons.

Condition 1: convexity via monotonicity of f′f'

Theorem. Let ff be differentiable on an open interval II. Then ff is convex on II if and only if f′f' is monotonically non-decreasing on II.

Proof (⇒\Rightarrow): convex ⇒\Rightarrow f′f' non-decreasing

Assume ff is convex on II. Take x1<x2x_1 < x_2 in II; the goal is f′(x1)≤f′(x2)f'(x_1) \leq f'(x_2).

Recall from the convex checkpoint the equivalent secant-slope characterisation: for any a<b<ca < b < c in II,

f(b)−f(a)b−a  ≤  f(c)−f(b)c−b.(1)\frac{f(b) - f(a)}{b - a} \;\leq\; \frac{f(c) - f(b)}{c - b}. \tag{1}

Apply (1)(1) with a=x1a = x_1, b=x2b = x_2, c=x2+hc = x_2 + h for small h>0h > 0:

f(x2)−f(x1)x2−x1  ≤  f(x2+h)−f(x2)h.\frac{f(x_2) - f(x_1)}{x_2 - x_1} \;\leq\; \frac{f(x_2 + h) - f(x_2)}{h}.

Taking h→0+h \to 0^+ on the right gives f′(x2)f'(x_2).

Apply (1)(1) again with a=x1a = x_1, b=x1+hb = x_1 + h, c=x2c = x_2 for small h>0h > 0:

f(x1+h)−f(x1)h  ≤  f(x2)−f(x1+h)x2−x1−h.\frac{f(x_1 + h) - f(x_1)}{h} \;\leq\; \frac{f(x_2) - f(x_1 + h)}{x_2 - x_1 - h}.

Taking h→0+h \to 0^+ on the left gives f′(x1)f'(x_1), and the right side tends to f(x2)−f(x1)x2−x1\dfrac{f(x_2) - f(x_1)}{x_2 - x_1}.

Chaining:

f′(x1)  ≤  f(x2)−f(x1)x2−x1  ≤  f′(x2).f'(x_1) \;\leq\; \frac{f(x_2) - f(x_1)}{x_2 - x_1} \;\leq\; f'(x_2).

So f′(x1)≤f′(x2)f'(x_1) \leq f'(x_2). □\square

Proof (⇐\Leftarrow): f′f' non-decreasing ⇒\Rightarrow convex

Assume f′f' is non-decreasing on II. Take x<yx < y in II and λ∈(0,1)\lambda \in (0, 1); set z≔λx+(1−λ)yz \coloneqq \lambda x + (1 - \lambda)y, so x<z<yx < z < y.

Note that z−x=(1−λ)(y−x)z - x = (1-\lambda)(y - x) and y−z=λ(y−x)y - z = \lambda(y - x).

By the Mean Value Theorem:

f(z)−f(x)  =  f′(c1)(z−x)for some c1∈(x,z),f(z) - f(x) \;=\; f'(c_1)(z - x) \quad\text{for some } c_1 \in (x, z), f(y)−f(z)  =  f′(c2)(y−z)for some c2∈(z,y).f(y) - f(z) \;=\; f'(c_2)(y - z) \quad\text{for some } c_2 \in (z, y).

Since c1<z<c2c_1 < z < c_2 and f′f' is non-decreasing, f′(c1)≤f′(c2)f'(c_1) \leq f'(c_2). Therefore:

f(z)−f(x)z−x  =  f′(c1)  ≤  f′(c2)  =  f(y)−f(z)y−z.\frac{f(z) - f(x)}{z - x} \;=\; f'(c_1) \;\leq\; f'(c_2) \;=\; \frac{f(y) - f(z)}{y - z}.

Substituting z−x=(1−λ)(y−x)z - x = (1-\lambda)(y-x) and y−z=λ(y−x)y - z = \lambda(y-x):

f(z)−f(x)1−λ  ≤  f(y)−f(z)λ.\frac{f(z) - f(x)}{1 - \lambda} \;\leq\; \frac{f(y) - f(z)}{\lambda}.

Multiply through by λ(1−λ)>0\lambda(1-\lambda) > 0:

λ(f(z)−f(x))  ≤  (1−λ)(f(y)−f(z)).\lambda\bigl(f(z) - f(x)\bigr) \;\leq\; (1-\lambda)\bigl(f(y) - f(z)\bigr).

Rearranging:

λf(z)−λf(x)  ≤  (1−λ)f(y)−(1−λ)f(z),\lambda f(z) - \lambda f(x) \;\leq\; (1-\lambda)f(y) - (1-\lambda)f(z), f(z)  ≤  λf(x)+(1−λ)f(y).□f(z) \;\leq\; \lambda f(x) + (1-\lambda)f(y). \quad \square

This is exactly the chord inequality, so ff is convex.

Condition 2: convexity via the second derivative

Theorem. Let f∈C2(I)f \in C^2(I). Then ff is convex on II if and only if f′′(x)≥0f''(x) \geq 0 for all x∈Ix \in I.

Proof. By Condition 1, ff is convex on II if and only if f′f' is non-decreasing on II. By the Monotonicity Test applied to f′f', f′f' is non-decreasing on II if and only if (f′)′=f′′≥0(f')' = f'' \geq 0 on II. Chaining the two equivalences gives the result. □\square

Strict convexity

Corollary. If f′′(x)>0f''(x) > 0 for all x∈Ix \in I, then ff is strictly convex on II.

Proof. Strictly positive f′′f'' means f′f' is strictly increasing (Monotonicity Test, case 1). In the (⇐)(\Leftarrow) proof above, c1<c2c_1 < c_2 then forces f′(c1)<f′(c2)f'(c_1) < f'(c_2), so every inequality in the chain is strict, giving strict convexity. □\square

The converse fails: f(x)=x4f(x) = x^4 satisfies f′′(0)=0f''(0) = 0 yet is strictly convex — the condition f′′>0f'' > 0 everywhere is sufficient but not necessary for strict convexity.

Recognising convex functions

The second-derivative test makes convexity a matter of sign checking:

FunctionDomainf′′f''Convex?
x2x^2R\mathbb{R}2>02 > 0Strictly convex
x4x^4R\mathbb{R}12x2≥012x^2 \geq 0Strictly convex (see note above)
exe^xR\mathbb{R}ex>0e^x > 0Strictly convex
−ln⁡x-\ln x(0,∞)(0, \infty)1/x2>01/x^2 > 0Strictly convex
ln⁡x\ln x(0,∞)(0, \infty)−1/x2<0-1/x^2 < 0Strictly concave
x3x^3R\mathbb{R}6x6x, changes signNeither convex nor concave

For f(x)=x3f(x) = x^3: f′′(x)>0f''(x) > 0 on (0,∞)(0, \infty) and f′′(x)<0f''(x) < 0 on (−∞,0)(-\infty, 0), so ff is convex on (0,∞)(0, \infty) and concave on (−∞,0)(-\infty, 0), but not on all of R\mathbb{R}.

Summary

  • Condition 1: ff differentiable on II is convex   ⟺  \iff f′f' is non-decreasing on II.
    • (⇒\Rightarrow): The secant-slope property of convex functions squeezes f′(x1)≤f′(x2)f'(x_1) \leq f'(x_2).
    • (⇐\Leftarrow): MVT produces c1<c2c_1 < c_2 with f′(c1)≤f′(c2)f'(c_1) \leq f'(c_2), which algebraically yields the chord inequality.
  • Condition 2: f∈C2(I)f \in C^2(I) is convex   ⟺  \iff f′′≥0f'' \geq 0 on II (combining Condition 1 with the Monotonicity Test for f′f').
  • Strict convexity: f′′>0f'' > 0 everywhere ⇒\Rightarrow strictly convex; the converse can fail at isolated points.
  • To check convexity in practice: compute f′′f'' and determine its sign on the interval of interest.