Convex functions

A function f(x) is convex if for any real numbers a<b, each point (c,d) on the line segment joining (a,f(a)) and (b,f(b))lies above or at the point (c,f(c)) on the graph of fwith the same x-coordinate.

Algebraically, this condition says that

 \begin{displaymath}
f((1-t)a+tb) \le (1-t)f(a) + t f(b).
\end{displaymath} (1)

whenever a<b and for all $t \in [0,1]$. (The left hand side represents the height of the graph of the function above the x-value x=(1-t)a+tb which is a fraction tof the way from a to b, and the right hand side represents the height of the line segment above the same x-value.)

Those who know what a convex set in geometry is can interpret the condition as saying that the set $S=\{(x,y):y \ge f(x)\}$ of points above the graph of fis a convex set. Loosely speaking, this will hold if the graph of fcurves in the shape of a smile instead of a frown. For example, the function f(x)=x2 is convex, as is f(x)=xn for any positive even integer.

One can also speak of a function f(x) being convex on an interval I. This means that the condition (1) above holds at least when $a,b \in I$ (and a<b and $t \in [0,1]$). For example, one can show that f(x)=x3 is convex on $[0,\infty)$, and that $f(x)=\sin x$ is convex on $(-\pi,0)$.

Finally one says that a function f(x) on an interval Iis strictly convex, if

f((1-t)a+tb) < (1-t)f(a) + t f(b)

whenever $a,b \in I$ and a<b and $t \in (0,1)$. In other words, the line segment connecting two points on the graph of f should lie entirely above the graph of f, except where it touches at its endpoints.

For convenience, here is a brief list of some convex functions. In these, k represents a positive integer, r,s represent real constants, and x is the variable. In fact, all of these are strictly convex on the interval given, except for xr and -xr when r is 0 or 1.
\begin{align*}x^{2k}, &\text{ on all of ${\mathbb R}$ } \\
x^r,&\text{ on $[0,...
... ${\mathbb R}$ } \\
r/(s+x) &\text{ on $(-s,\infty)$ , if $r>0$ }
\end{align*}

A sum of convex functions is convex. Adding a constant or linear function to a function does not affect convexity.


Remarks (for those who know about continuity and derivatives):
If one wants to prove rigorously that a function is convex, instead of just guessing it from the graph, it is often easier to use one of the criteria below instead of the definition of convexity.

1.
Let f(x) be a continuous function on an interval I. Then f(x) is convex if and only if $(f(a)+f(b))/2 \ge f((a+b)/2)$holds for all $a,b \in I$. Also, f(x) is strictly convex if and only if (f(a)+f(b))/2 > f((a+b)/2)whenever $a,b \in I$ and a<b.

2.
Let f(x) be a differentiable function on an interval I. Then f(x) is convex if and only if f'(x) is increasing on I. Also, f(x) is strictly convex if and only if f'(x) is strictly increasing on the interior of I.

3.
Let f(x) be a twice differentiable function on an interval I. Then f(x) is convex if and only if $f''(x) \ge 0$ for all $x \in I$. Also, f(x) is strictly convex if and only if f''(x) > 0for all x in the interior of I.