Convex Function

Basis
Last updated: Tags: Calculus, Convexity

Many inequalities in analysis and probability reduce to a single geometric observation: for a “bowl-shaped” function, the straight line between two points on the graph never dips below the graph itself. Formalising that observation gives you the notion of a convex function.

The chord condition

Let IRI \subseteq \mathbb{R} be an interval and f:IRf : I \to \mathbb{R}.

Definition. ff is convex on II if for every x,yIx, y \in I and every λ[0,1]\lambda \in [0, 1],

f ⁣(λx+(1λ)y)    λf(x)+(1λ)f(y).(1)f\!\left(\lambda x + (1-\lambda)y\right) \;\leq\; \lambda f(x) + (1-\lambda)f(y). \tag{1}

The point λx+(1λ)y\lambda x + (1-\lambda)y is a convex combination of xx and yy: as λ\lambda ranges over [0,1][0,1] it traces the segment from yy to xx. The right-hand side λf(x)+(1λ)f(y)\lambda f(x) + (1-\lambda)f(y) is the corresponding point on the chord from (x,f(x))(x, f(x)) to (y,f(y))(y, f(y)).

In words: the graph of ff lies at or below every chord.

Strict convexity

Definition. ff is strictly convex on II if inequality (1)(1) is strict whenever xyx \neq y and λ(0,1)\lambda \in (0, 1):

f ⁣(λx+(1λ)y)  <  λf(x)+(1λ)f(y).f\!\left(\lambda x + (1-\lambda)y\right) \;<\; \lambda f(x) + (1-\lambda)f(y).

Strict convexity rules out any flat portion of the graph lying on a chord. Every strictly convex function is convex, but not vice versa (the identity f(x)=xf(x) = x is convex but not strictly convex).

Concavity

ff is (strictly) concave if f-f is (strictly) convex, i.e. if the inequality in (1)(1) is reversed. Concave functions are “cap-shaped”: every chord lies at or below the graph.

Examples

FunctionDomainConvex?Strictly?
x2x^2R\mathbb{R}YesYes
exe^xR\mathbb{R}YesYes
x\|x\|R\mathbb{R}YesNo (flat at x=0x = 0 on the chord from a-a to aa)
lnx\ln x(0,)(0, \infty)No (concave)
x2-x^2R\mathbb{R}No (concave)
cc (constant)R\mathbb{R}YesNo

Verifying x2x^2. For λ[0,1]\lambda \in [0,1] and x,yRx, y \in \mathbb{R}:

(λx+(1λ)y)2    λx2+(1λ)y2(\lambda x + (1-\lambda)y)^2 \;\leq\; \lambda x^2 + (1-\lambda)y^2

is equivalent to λ(1λ)(xy)20\lambda(1-\lambda)(x-y)^2 \geq 0, which holds for all λ[0,1]\lambda \in [0,1] and is strict when xyx \neq y and λ(0,1)\lambda \in (0,1). So x2x^2 is strictly convex.

Equivalent two-point form

Dividing both sides of (1)(1) by setting t=λt = \lambda and rearranging, convexity can also be read as: for any three points x<z<yx < z < y in II,

f(z)f(x)zx    f(y)f(x)yx    f(y)f(z)yz.\frac{f(z) - f(x)}{z - x} \;\leq\; \frac{f(y) - f(x)}{y - x} \;\leq\; \frac{f(y) - f(z)}{y - z}.

Each fraction is the slope of a secant, so this says: the secant slopes from a fixed left point are non-decreasing as the right endpoint moves right. This monotone-slope property is fully equivalent to (1)(1) and is often the quickest way to check convexity from a graph.

Summary

  • ff is convex on II if every chord from (x,f(x))(x, f(x)) to (y,f(y))(y, f(y)) lies at or above the graph: f(λx+(1λ)y)λf(x)+(1λ)f(y)f(\lambda x + (1-\lambda)y) \leq \lambda f(x) + (1-\lambda)f(y) for all x,yIx, y \in I, λ[0,1]\lambda \in [0,1].
  • Strict convexity requires a strict inequality for xyx \neq y and λ(0,1)\lambda \in (0,1).
  • Concavity reverses the inequality; ff is concave iff f-f is convex.
  • Standard examples: x2x^2 and exe^x are strictly convex; lnx\ln x is strictly concave.