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).
A convex function is also called concave upward. For a differentiable function on an open interval , convexity is equivalent to the function
graph lying on or above every tangent line (Boyd
and Vandenberghe 2004, p. 69). If
is twice differentiable
on
, then a necessary and
sufficient condition for convexity is
for all
(Boyd and Vandenberghe 2004, p. 71). The strict
inequality
throughout
is sufficient for strict convexity.
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.