Definitions
Nearby Words

# Convex function

In mathematics, a real-valued function f defined on an interval (or on any convex subset of some vector space) is called convex, concave upwards, concave up or convex cup, if for any two points x and y in its domain C and any t in [0,1], we have
$f\left(tx+\left(1-t\right)y\right)leq t f\left(x\right)+\left(1-t\right)f\left(y\right).$

In other words, a function is convex if and only if its epigraph (the set of points lying on or above the graph) is a convex set.

Pictorially, a function is called 'convex' if the function lies below the straight line segment connecting two points, for any two points in the interval.

A function is called strictly convex if

$f\left(tx+\left(1-t\right)y\right) < t f\left(x\right)+\left(1-t\right)f\left(y\right),$
for any t in (0,1) and $x neq y.$

A function $f$ is said to be concave if $- f$ is convex.

## Properties

A convex function f defined on some open interval C is continuous on C and differentiable at all but at most countably many points. If C is closed, then f may fail to be continuous at the endpoints of C.

A function is midpoint convex on an interval C if

$fleft\left(frac\left\{x+y\right\}\left\{2\right\} right\right) le frac\left\{f\left(x\right)+f\left(y\right)\right\}\left\{2\right\}$
for all x and y in C. This condition is only slightly weaker than convexity. For example, a real valued measurable function that is midpoint convex will be convex. In particular, a continuous function that is midpoint convex will be convex.

A differentiable function of one variable is convex on an interval if and only if its derivative is monotonically non-decreasing on that interval.

A continuously differentiable function of one variable is convex on an interval if and only if the function lies above all of its tangents: f(y) ≥ f(x) + f '(x) (yx) for all x and y in the interval. In particular, if f '(c) = 0, then c is a global minimum of f(x).

A twice differentiable function of one variable is convex on an interval if and only if its second derivative is non-negative there; this gives a practical test for convexity. If its second derivative is positive then it is strictly convex, but the converse does not hold. For example, the second derivative of f(x) = x4 is f "(x) = 12 x2, which is zero for x = 0, but x4 is strictly convex.

More generally, a continuous, twice differentiable function of several variables is convex on a convex set if and only if its Hessian matrix is positive semidefinite on the interior of the convex set.

Any local minimum of a convex function is also a global minimum. A strictly convex function will have at most one global minimum.

For a convex function f, the sublevel sets {x | f(x) < a} and {x | f(x) ≤ a} with aR are convex sets. However, a function whose sublevel sets are convex sets may fail to be a convex function; such a function is called a quasiconvex function.

Jensen's inequality applies to every convex function f. If $X$ is a random variable taking values in the domain of f, then $E f\left(X\right) geq f\left(EX\right).$ (Here $E$ denotes the mathematical expectation.)

## Convex function calculus

• If $f$ and $g$ are convex functions, then so are $m\left(x\right) = max\left\{f\left(x\right),g\left(x\right) \right\}$ and $h\left(x\right) = f\left(x\right) + g\left(x\right) .$
• If $f$ and $g$ are convex functions and if $g$ is increasing, then $h\left(x\right) = g\left(f\left(x\right)\right)$ is convex.
• Convexity is invariant under affine maps: that is, if $f\left(x\right)$ is convex with $xinmathbb\left\{R\right\}^n$, then so is $g\left(y\right) = f\left(Ay+b\right)$, where $Ainmathbb\left\{R\right\}^\left\{n times m\right\},; binmathbb\left\{R\right\}^m.$
• If $f\left(x,y\right)$ is convex in $\left(x,y\right)$ and $C$ is a convex nonempty set, then $g\left(x\right) = inf_\left\{yin C\right\} f\left(x,y\right)$ is convex in $x,$ provided $g\left(x\right) > -infty$ for some $x.$

## Examples

• The function $f\left(x\right)=x^2$ has $f$(x)=2>0 at all points, so f'' is a (strictly) convex function.
• The absolute value function $f\left(x\right)=|x|$ is convex, even though it does not have a derivative at the point x = 0.
• The function $f\left(x\right)=|x|^p$ for 1 ≤ p is convex.
• The function f with domain [0,1] defined by f(0)=f(1)=1, f(x)=0 for 0<x<1 is convex; it is continuous on the open interval (0,1), but not continuous at 0 and 1.
• The function x3 has second derivative 6x; thus it is convex on the set where x ≥ 0 and concave on the set where x ≤ 0.
• Every linear transformation taking values in $mathbb\left\{R\right\}$ is convex but not strictly convex, since if f is linear, then $f\left(a + b\right) = f\left(a\right) + f\left(b\right).$ This statement also holds if we replace "convex" by "concave".
• Every affine function taking values in $mathbb\left\{R\right\}$, i.e., each function of the form $f\left(x\right) = a^T x + b$, is simultaneously convex and concave.
• Every norm is a convex function, by the triangle inequality.
• If $f$ is convex, the perspective function $g\left(x,t\right) = tf\left(x/t\right)$ is convex for $t > 0.$
• Examples of functions that are monotonically increasing but not convex include $f\left(x\right) = sqrt x$ and $g\left(x\right) = log\left(x\right).$
• Examples of functions that are convex but not monotonically increasing include $h\left(x\right) = x^2$ and $k\left(x\right)=-x$.
• The function f(x) = 1/x2, with f(0)=+∞, is convex on the interval (0,+∞) and convex on the interval (-∞,0), but not convex on the interval (-∞,+∞), because of the singularity at x = 0.

## References

• [1]
• *

*

*

*

• Hiriart-Urruty, Jean-Baptiste, and Lemaréchal, Claude. (2004). Fundamentals of Convex analysis. Berlin: Springer.
• Krasnosel'skii M.A., Rutickii Ya.B. (1961). Convex Functions and Orlicz Spaces. Groningen: P.Noordhoff Ltd.
• Borwein, Jonathan, and Lewis, Adrian. (2000). Convex Analysis and Nonlinear Optimization. Springer.