Convex when the chord floats above the graph — for differentiable f this is the same as f′ increasing, and the second derivative decides it. Up to Jensen's inequality.
a=−1,b=1 — the chord floats above the parabolaShow proof
Expanding the difference gives tx2+(1−t)y2−(tx+(1−t)y)2=t(1−t)(x−y)2. (Squaring (tx+(1−t)y) and collecting terms factors t(1−t) out of the x2 and y2 coefficients.)
Since t∈[0,1], we have t(1−t)≥0, and (x−y)2≥0 as a square. So the right-hand side is nonnegative.
That is, (tx+(1−t)y)2≤tx2+(1−t)y2 — the definition of convexity holds, so x2 is convex. This is also why the max gap is 1 for a=−1,b=1 in the picture above.
Prove that if f is differentiable and f′ is increasing, then f is convex.
Take x1<x2<x3. The mean value theorem on [x1,x2] and [x2,x3] gives c1∈(x1,x2) and c2∈(x2,x3) with f′(c1)=x2−x1f(x2)−f(x1) and f′(c2)=x3−x2f(x3)−f(x2). Since c1<c2 and f′ is increasing, f′(c1)≤f′(c2).
Rearranging the slope inequality x2−x1f(x2)−f(x1)≤x3−x2f(x3)−f(x2) gives f(x2)≤x3−x1(x3−x2)f(x1)+(x2−x1)f(x3) — the middle value lies below the chord joining the endpoints.
With x2=tx1+(1−t)x3 we have x3−x1x3−x2=t and x3−x1x2−x1=1−t, so the inequality becomes f(tx1+(1−t)x3)≤tf(x1)+(1−t)f(x3) — the definition of convexity. Note that f′′≥0 makes f′ increasing by applying the mean value theorem to f′.
Derive the AM–GM inequality for two numbers from the concavity of log.
log2a+b≥2loga+logb=logab
the chord picture applies to log just the sameShow proof
Since (log)′′(x)=−x21<0, the concave version of the second-derivative test (the reverse of the inequality in problem 2) makes log concave — the chord lies below the graph.
Jensen's inequality (concave version) with t=21 gives log2a+b≥2loga+logb.
The right-hand side is 21(loga+logb)=logab, so exponentiating gives 2a+b≥ab — the AM–GM inequality. (Exponentiation is increasing, so the inequality is preserved.)