A convex function on an interval is a real-valued
function
satisfying
for
and
(Boyd and Vandenberghe 2004, p. 67). For a continuous
function, it suffices to check the midpoint condition
for every pair of points in the interval
(Rudin 1976, p. 101; cf. Gradshteyn and Ryzhik 2000, p. 1132).
If
is twice differentiable on an open
interval
,
then a necessary and sufficient
condition for convexity is
for all
(Boyd and Vandenberghe 2004, p. 71).
If the defining inequality is strict whenever
and
,
then
is called strictly convex (Boyd and Vandenberghe 2004, p. 67).
A convex function is continuous on the interior of its interval,
but continuity at an included endpoint
need not hold (Boyd and Vandenberghe 2004, p. 68). For example, the function
on
given by
and
for
is convex and discontinuous at 0.
Examples of convex functions include for
or even
,
for
, and
for all
. If the sign of the inequality is reversed, the function is
called concave.