Convex function

From HandWiki
Convex function on an interval.
Short description: Real function with secant line between points above the graph itself
A function (in black) is convex if and only if the region above its graph (in green) is a convex set.
A graph of the bivariate convex function x2 + xy + y2.
Convex vs. Not convex

In mathematics, a real-valued function is called convex if the line segment between any two points on the graph of the function lies above the graph between the two points. Equivalently, a function is convex if its epigraph (the set of points on or above the graph of the function) is a convex set. A twice-differentiable function of a single variable is convex if and only if its second derivative is nonnegative on its entire domain.[1] Well-known examples of convex functions of a single variable include the quadratic function [math]\displaystyle{ x^2 }[/math] and the exponential function [math]\displaystyle{ e^x }[/math]. In simple terms, a convex function refers to a function whose graph is shaped like a cup [math]\displaystyle{ \cup }[/math], while a concave function's graph is shaped like a cap [math]\displaystyle{ \cap }[/math].

Convex functions play an important role in many areas of mathematics. They are especially important in the study of optimization problems where they are distinguished by a number of convenient properties. For instance, a strictly convex function on an open set has no more than one minimum. Even in infinite-dimensional spaces, under suitable additional hypotheses, convex functions continue to satisfy such properties and as a result, they are the most well-understood functionals in the calculus of variations. In probability theory, a convex function applied to the expected value of a random variable is always bounded above by the expected value of the convex function of the random variable. This result, known as Jensen's inequality, can be used to deduce inequalities such as the arithmetic–geometric mean inequality and Hölder's inequality.


File:Convex 01.ogg

Let [math]\displaystyle{ X }[/math] be a convex subset of a real vector space and let [math]\displaystyle{ f: X \to \R }[/math] be a function.

Then [math]\displaystyle{ f }[/math] is called convex if and only if any of the following equivalent conditions hold:

  1. For all [math]\displaystyle{ 0 \leq t \leq 1 }[/math] and all [math]\displaystyle{ x_1, x_2 \in X }[/math]: [math]\displaystyle{ f\left(t x_1 + (1-t) x_2\right) \leq t f\left(x_1\right) + (1-t) f\left(x_2\right) }[/math] The right hand side represents the straight line between [math]\displaystyle{ \left(x_1, f\left(x_1\right)\right) }[/math] and [math]\displaystyle{ \left(x_2, f\left(x_2\right)\right) }[/math] in the graph of [math]\displaystyle{ f }[/math] as a function of [math]\displaystyle{ t; }[/math] increasing [math]\displaystyle{ t }[/math] from [math]\displaystyle{ 0 }[/math] to [math]\displaystyle{ 1 }[/math] or decreasing [math]\displaystyle{ t }[/math] from [math]\displaystyle{ 1 }[/math] to [math]\displaystyle{ 0 }[/math] sweeps this line. Similarly, the argument of the function [math]\displaystyle{ f }[/math] in the left hand side represents the straight line between [math]\displaystyle{ x_1 }[/math] and [math]\displaystyle{ x_2 }[/math] in [math]\displaystyle{ X }[/math] or the [math]\displaystyle{ x }[/math]-axis of the graph of [math]\displaystyle{ f. }[/math] So, this condition requires that the straight line between any pair of points on the curve of [math]\displaystyle{ f }[/math] to be above or just meets the graph.[2]
  2. For all [math]\displaystyle{ 0 \lt t \lt 1 }[/math] and all [math]\displaystyle{ x_1, x_2 \in X }[/math] such that [math]\displaystyle{ x_1 \neq x_2 }[/math]: [math]\displaystyle{ f\left(t x_1 + (1-t) x_2\right) \leq t f\left(x_1\right) + (1-t) f\left(x_2\right) }[/math] The difference of this second condition with respect to the first condition above is that this condition does not include the intersection points (for example, [math]\displaystyle{ \left(x_1, f\left(x_1\right)\right) }[/math] and [math]\displaystyle{ \left(x_2, f\left(x_2\right)\right) }[/math]) between the straight line passing through a pair of points on the curve of [math]\displaystyle{ f }[/math] (the straight line is represented by the right hand side of this condition) and the curve of [math]\displaystyle{ f; }[/math] the first condition includes the intersection points as it becomes [math]\displaystyle{ f\left(x_1\right) \leq f\left(x_1\right) }[/math] or [math]\displaystyle{ f\left(x_2\right) \leq f\left(x_2\right) }[/math] at [math]\displaystyle{ t = 0 }[/math] or [math]\displaystyle{ 1, }[/math] or [math]\displaystyle{ x_1 = x_2. }[/math] In fact, the intersection points do not need to be considered in a condition of convex using [math]\displaystyle{ f\left(t x_1 + (1-t) x_2\right) \leq t f\left(x_1\right) + (1-t) f\left(x_2\right) }[/math] because [math]\displaystyle{ f\left(x_1\right) \leq f\left(x_1\right) }[/math] and [math]\displaystyle{ f\left(x_2\right) \leq f\left(x_2\right) }[/math] are always true (so not useful to be a part of a condition).

The second statement characterizing convex functions that are valued in the real line [math]\displaystyle{ \R }[/math] is also the statement used to define convex functions that are valued in the extended real number line [math]\displaystyle{ [-\infty, \infty] = \R \cup \{\pm\infty\}, }[/math] where such a function [math]\displaystyle{ f }[/math] is allowed to take [math]\displaystyle{ \pm\infty }[/math] as a value. The first statement is not used because it permits [math]\displaystyle{ t }[/math] to take [math]\displaystyle{ 0 }[/math] or [math]\displaystyle{ 1 }[/math] as a value, in which case, if [math]\displaystyle{ f\left(x_1\right) = \pm\infty }[/math] or [math]\displaystyle{ f\left(x_2\right) = \pm\infty, }[/math] respectively, then [math]\displaystyle{ t f\left(x_1\right) + (1 - t) f\left(x_2\right) }[/math] would be undefined (because the multiplications [math]\displaystyle{ 0 \cdot \infty }[/math] and [math]\displaystyle{ 0 \cdot (-\infty) }[/math] are undefined). The sum [math]\displaystyle{ -\infty + \infty }[/math] is also undefined so a convex extended real-valued function is typically only allowed to take exactly one of [math]\displaystyle{ -\infty }[/math] and [math]\displaystyle{ +\infty }[/math] as a value.

The second statement can also be modified to get the definition of strict convexity, where the latter is obtained by replacing [math]\displaystyle{ \,\leq\, }[/math] with the strict inequality [math]\displaystyle{ \,\lt . }[/math] Explicitly, the map [math]\displaystyle{ f }[/math] is called strictly convex if and only if for all real [math]\displaystyle{ 0 \lt t \lt 1 }[/math] and all [math]\displaystyle{ x_1, x_2 \in X }[/math] such that [math]\displaystyle{ x_1 \neq x_2 }[/math]: [math]\displaystyle{ f\left(t x_1 + (1-t) x_2\right) \lt t f\left(x_1\right) + (1-t) f\left(x_2\right) }[/math]

A strictly convex function [math]\displaystyle{ f }[/math] is a function that the straight line between any pair of points on the curve [math]\displaystyle{ f }[/math] is above the curve [math]\displaystyle{ f }[/math] except for the intersection points between the straight line and the curve.

The function [math]\displaystyle{ f }[/math] is said to be concave (resp. strictly concave) if [math]\displaystyle{ -f }[/math] ([math]\displaystyle{ f }[/math] multiplied by −1) is convex (resp. strictly convex).

Alternative naming

The term convex is often referred to as convex down or concave upward, and the term concave is often referred as concave down or convex upward.[3][4][5] If the term "convex" is used without an "up" or "down" keyword, then it refers strictly to a cup shaped graph [math]\displaystyle{ \cup }[/math]. As an example, Jensen's inequality refers to an inequality involving a convex or convex-(up), function.[6]


Many properties of convex functions have the same simple formulation for functions of many variables as for functions of one variable. See below the properties for the case of many variables, as some of them are not listed for functions of one variable.

Functions of one variable

  • Suppose [math]\displaystyle{ f }[/math] is a function of one real variable defined on an interval, and let [math]\displaystyle{ R(x_1, x_2) = \frac{f(x_2) - f(x_1)}{x_2 - x_1} }[/math] (note that [math]\displaystyle{ R(x_1, x_2) }[/math] is the slope of the purple line in the above drawing; the function [math]\displaystyle{ R }[/math] is symmetric in [math]\displaystyle{ (x_1, x_2), }[/math] means that [math]\displaystyle{ R }[/math] does not change by exchanging [math]\displaystyle{ x_1 }[/math] and [math]\displaystyle{ x_2 }[/math]). [math]\displaystyle{ f }[/math] is convex if and only if [math]\displaystyle{ R(x_1, x_2) }[/math] is monotonically non-decreasing in [math]\displaystyle{ x_1, }[/math] for every fixed [math]\displaystyle{ x_2 }[/math] (or vice versa). This characterization of convexity is quite useful to prove the following results.
  • A convex function [math]\displaystyle{ f }[/math] of one real variable defined on some open interval [math]\displaystyle{ C }[/math] is continuous on [math]\displaystyle{ C. }[/math] [math]\displaystyle{ f }[/math] admits left and right derivatives, and these are monotonically non-decreasing. As a consequence, [math]\displaystyle{ f }[/math] is differentiable at all but at most countably many points, the set on which [math]\displaystyle{ f }[/math] is not differentiable can however still be dense. If [math]\displaystyle{ C }[/math] is closed, then [math]\displaystyle{ f }[/math] may fail to be continuous at the endpoints of [math]\displaystyle{ C }[/math] (an example is shown in the examples section).
  • A differentiable function of one variable is convex on an interval if and only if its derivative is monotonically non-decreasing on that interval. If a function is differentiable and convex then it is also continuously differentiable (due to Darboux's theorem).
  • A differentiable function of one variable is convex on an interval if and only if its graph lies above all of its tangents:[7]:69 [math]\displaystyle{ f(x) \geq f(y) + f'(y) (x-y) }[/math] for all [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] in the interval.
  • 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. Visually, a twice differentiable convex function "curves up", without any bends the other way (inflection points). If its second derivative is positive at all points then the function is strictly convex, but the converse does not hold. For example, the second derivative of [math]\displaystyle{ f(x) = x^4 }[/math] is [math]\displaystyle{ f''(x) = 12x^{2} }[/math], which is zero for [math]\displaystyle{ x = 0, }[/math] but [math]\displaystyle{ x^4 }[/math] is strictly convex.
    • This property and the above property in terms of "...its derivative is monotonically non-decreasing..." are not equal since if [math]\displaystyle{ f'' }[/math] is non-negative on an interval [math]\displaystyle{ X }[/math] then [math]\displaystyle{ f' }[/math] is monotonically non-decreasing on [math]\displaystyle{ X }[/math] while its converse is not true, for example, [math]\displaystyle{ f' }[/math] is monotonically non-decreasing on [math]\displaystyle{ X }[/math] while its derivative [math]\displaystyle{ f'' }[/math] is not defined at some points on [math]\displaystyle{ X }[/math].
  • If [math]\displaystyle{ f }[/math] is a convex function of one real variable, and [math]\displaystyle{ f(0)\le 0 }[/math], then [math]\displaystyle{ f }[/math] is superadditive on the positive reals, that is [math]\displaystyle{ f(a + b) \geq f(a) + f(b) }[/math] for positive real numbers [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math].
  • A function is midpoint convex on an interval [math]\displaystyle{ C }[/math] if for all [math]\displaystyle{ x_1, x_2 \in C }[/math] [math]\displaystyle{ f\left(\frac{x_1 + x_2}{2}\right) \leq \frac{f(x_1) + f(x_2)}{2}. }[/math] This condition is only slightly weaker than convexity. For example, a real-valued Lebesgue measurable function that is midpoint-convex is convex: this is a theorem of Sierpinski.[8] In particular, a continuous function that is midpoint convex will be convex.

Functions of several variables

  • A function [math]\displaystyle{ f : X \to [-\infty, \infty] }[/math] valued in the extended real numbers [math]\displaystyle{ [-\infty, \infty] = \R \cup \{\pm\infty\} }[/math] is convex if and only if its epigraph [math]\displaystyle{ \{(x, r) \in X \times \R ~:~ r \geq f(x)\} }[/math] is a convex set.
  • A differentiable function [math]\displaystyle{ f }[/math] defined on a convex domain is convex if and only if [math]\displaystyle{ f(x) \geq f(y) + \nabla f(y)^T \cdot (x-y) }[/math] holds for all [math]\displaystyle{ x, y }[/math] in the domain.
  • A twice differentiable function of several variables is convex on a convex set if and only if its Hessian matrix of second partial derivatives is positive semidefinite on the interior of the convex set.
  • For a convex function [math]\displaystyle{ f, }[/math] the sublevel sets [math]\displaystyle{ \{x : f(x) \lt a\} }[/math] and [math]\displaystyle{ \{x : f(x) \leq a\} }[/math] with [math]\displaystyle{ a \in \R }[/math] are convex sets. A function that satisfies this property is called a quasiconvex function and may fail to be a convex function.
  • Consequently, the set of global minimisers of a convex function [math]\displaystyle{ f }[/math] is a convex set: [math]\displaystyle{ {\operatorname{argmin}}\,f }[/math] - convex.
  • Any local minimum of a convex function is also a global minimum. A strictly convex function will have at most one global minimum.[9]
  • Jensen's inequality applies to every convex function [math]\displaystyle{ f }[/math]. If [math]\displaystyle{ X }[/math] is a random variable taking values in the domain of [math]\displaystyle{ f, }[/math] then [math]\displaystyle{ \operatorname{E}(f(X)) \geq f(\operatorname{E}(X)), }[/math] where [math]\displaystyle{ \operatorname{E} }[/math] denotes the mathematical expectation. Indeed, convex functions are exactly those that satisfies the hypothesis of Jensen's inequality.
  • A first-order homogeneous function of two positive variables [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y, }[/math] (that is, a function satisfying [math]\displaystyle{ f(a x, a y) = a f(x, y) }[/math] for all positive real [math]\displaystyle{ a, x, y \gt 0 }[/math]) that is convex in one variable must be convex in the other variable.[10]

Operations that preserve convexity

  • [math]\displaystyle{ -f }[/math] is concave if and only if [math]\displaystyle{ f }[/math] is convex.
  • If [math]\displaystyle{ r }[/math] is any real number then [math]\displaystyle{ r + f }[/math] is convex if and only if [math]\displaystyle{ f }[/math] is convex.
  • Nonnegative weighted sums:
    • if [math]\displaystyle{ w_1, \ldots, w_n \geq 0 }[/math] and [math]\displaystyle{ f_1, \ldots, f_n }[/math] are all convex, then so is [math]\displaystyle{ w_1 f_1 + \cdots + w_n f_n. }[/math] In particular, the sum of two convex functions is convex.
    • this property extends to infinite sums, integrals and expected values as well (provided that they exist).
  • Elementwise maximum: let [math]\displaystyle{ \{f_i\}_{i \in I} }[/math] be a collection of convex functions. Then [math]\displaystyle{ g(x) = \sup\nolimits_{i \in I} f_i(x) }[/math] is convex. The domain of [math]\displaystyle{ g(x) }[/math] is the collection of points where the expression is finite. Important special cases:
    • If [math]\displaystyle{ f_1, \ldots, f_n }[/math] are convex functions then so is [math]\displaystyle{ g(x) = \max \left\{f_1(x), \ldots, f_n(x)\right\}. }[/math]
    • Danskin's theorem: If [math]\displaystyle{ f(x,y) }[/math] is convex in [math]\displaystyle{ x }[/math] then [math]\displaystyle{ g(x) = \sup\nolimits_{y\in C} f(x,y) }[/math] is convex in [math]\displaystyle{ x }[/math] even if [math]\displaystyle{ C }[/math] is not a convex set.
  • Composition:
    • If [math]\displaystyle{ f }[/math] and [math]\displaystyle{ g }[/math] are convex functions and [math]\displaystyle{ g }[/math] is non-decreasing over a univariate domain, then [math]\displaystyle{ h(x) = g(f(x)) }[/math] is convex. For example, if [math]\displaystyle{ f }[/math] is convex, then so is [math]\displaystyle{ e^{f(x)} }[/math] because [math]\displaystyle{ e^x }[/math] is convex and monotonically increasing.
    • If [math]\displaystyle{ f }[/math] is concave and [math]\displaystyle{ g }[/math] is convex and non-increasing over a univariate domain, then [math]\displaystyle{ h(x) = g(f(x)) }[/math] is convex.
    • Convexity is invariant under affine maps: that is, if [math]\displaystyle{ f }[/math] is convex with domain [math]\displaystyle{ D_f \subseteq \mathbf{R}^m }[/math], then so is [math]\displaystyle{ g(x) = f(Ax+b) }[/math], where [math]\displaystyle{ A \in \mathbf{R}^{m \times n}, b \in \mathbf{R}^m }[/math] with domain [math]\displaystyle{ D_g \subseteq \mathbf{R}^n. }[/math]
  • Minimization: If [math]\displaystyle{ f(x,y) }[/math] is convex in [math]\displaystyle{ (x,y) }[/math] then [math]\displaystyle{ g(x) = \inf\nolimits_{y\in C} f(x,y) }[/math] is convex in [math]\displaystyle{ x, }[/math] provided that [math]\displaystyle{ C }[/math] is a convex set and that [math]\displaystyle{ g(x) \neq -\infty. }[/math]
  • If [math]\displaystyle{ f }[/math] is convex, then its perspective [math]\displaystyle{ g(x, t) = t f \left(\tfrac{x}{t} \right) }[/math] with domain [math]\displaystyle{ \left\{(x,t) : \tfrac{x}{t} \in \operatorname{Dom}(f), t \gt 0 \right\} }[/math] is convex.
  • Let [math]\displaystyle{ X }[/math] be a vector space. [math]\displaystyle{ f : X \to \mathbf{R} }[/math] is convex and satisfies [math]\displaystyle{ f(0) \leq 0 }[/math] if and only if [math]\displaystyle{ f(ax+by) \leq a f(x) + bf(y) }[/math] for any [math]\displaystyle{ x, y \in X }[/math] and any non-negative real numbers [math]\displaystyle{ a, b }[/math] that satisfy [math]\displaystyle{ a + b \leq 1. }[/math]

Strongly convex functions

The concept of strong convexity extends and parametrizes the notion of strict convexity. A strongly convex function is also strictly convex, but not vice versa.

A differentiable function [math]\displaystyle{ f }[/math] is called strongly convex with parameter [math]\displaystyle{ m \gt 0 }[/math] if the following inequality holds for all points [math]\displaystyle{ x, y }[/math] in its domain:[11] [math]\displaystyle{ (\nabla f(x) - \nabla f(y) )^T (x-y) \ge m \|x-y\|_2^2 }[/math] or, more generally, [math]\displaystyle{ \langle \nabla f(x) - \nabla f(y), x-y \rangle \ge m \|x-y\|^2 }[/math] where [math]\displaystyle{ \langle \cdot, \cdot\rangle }[/math] is any inner product, and [math]\displaystyle{ \|\cdot\| }[/math] is the corresponding norm. Some authors, such as [12] refer to functions satisfying this inequality as elliptic functions.

An equivalent condition is the following:[13] [math]\displaystyle{ f(y) \ge f(x) + \nabla f(x)^T (y-x) + \frac{m}{2} \|y-x\|_2^2 }[/math]

It is not necessary for a function to be differentiable in order to be strongly convex. A third definition[13] for a strongly convex function, with parameter [math]\displaystyle{ m, }[/math] is that, for all [math]\displaystyle{ x, y }[/math] in the domain and [math]\displaystyle{ t \in [0,1], }[/math] [math]\displaystyle{ f(tx+(1-t)y) \le t f(x)+(1-t)f(y) - \frac{1}{2} m t(1-t) \|x-y\|_2^2 }[/math]

Notice that this definition approaches the definition for strict convexity as [math]\displaystyle{ m \to 0, }[/math] and is identical to the definition of a convex function when [math]\displaystyle{ m = 0. }[/math] Despite this, functions exist that are strictly convex but are not strongly convex for any [math]\displaystyle{ m \gt 0 }[/math] (see example below).

If the function [math]\displaystyle{ f }[/math] is twice continuously differentiable, then it is strongly convex with parameter [math]\displaystyle{ m }[/math] if and only if [math]\displaystyle{ \nabla^2 f(x) \succeq mI }[/math] for all [math]\displaystyle{ x }[/math] in the domain, where [math]\displaystyle{ I }[/math] is the identity and [math]\displaystyle{ \nabla^2f }[/math] is the Hessian matrix, and the inequality [math]\displaystyle{ \succeq }[/math] means that [math]\displaystyle{ \nabla^2 f(x) - mI }[/math] is positive semi-definite. This is equivalent to requiring that the minimum eigenvalue of [math]\displaystyle{ \nabla^2 f(x) }[/math] be at least [math]\displaystyle{ m }[/math] for all [math]\displaystyle{ x. }[/math] If the domain is just the real line, then [math]\displaystyle{ \nabla^2 f(x) }[/math] is just the second derivative [math]\displaystyle{ f''(x), }[/math] so the condition becomes [math]\displaystyle{ f''(x) \ge m }[/math]. If [math]\displaystyle{ m = 0 }[/math] then this means the Hessian is positive semidefinite (or if the domain is the real line, it means that [math]\displaystyle{ f''(x) \ge 0 }[/math]), which implies the function is convex, and perhaps strictly convex, but not strongly convex.

Assuming still that the function is twice continuously differentiable, one can show that the lower bound of [math]\displaystyle{ \nabla^2 f(x) }[/math] implies that it is strongly convex. Using Taylor's Theorem there exists [math]\displaystyle{ z \in \{ t x + (1-t) y : t \in [0,1] \} }[/math] such that [math]\displaystyle{ f(y) = f(x) + \nabla f(x)^T (y-x) + \frac{1}{2} (y-x)^T \nabla^2f(z) (y-x) }[/math] Then [math]\displaystyle{ (y-x)^T \nabla^2f(z) (y-x) \ge m (y-x)^T(y-x) }[/math] by the assumption about the eigenvalues, and hence we recover the second strong convexity equation above.

A function [math]\displaystyle{ f }[/math] is strongly convex with parameter m if and only if the function [math]\displaystyle{ x\mapsto f(x) -\frac m 2 \|x\|^2 }[/math] is convex.

The distinction between convex, strictly convex, and strongly convex can be subtle at first glance. If [math]\displaystyle{ f }[/math] is twice continuously differentiable and the domain is the real line, then we can characterize it as follows:

  • [math]\displaystyle{ f }[/math] convex if and only if [math]\displaystyle{ f''(x) \ge 0 }[/math] for all [math]\displaystyle{ x. }[/math]
  • [math]\displaystyle{ f }[/math] strictly convex if [math]\displaystyle{ f''(x) \gt 0 }[/math] for all [math]\displaystyle{ x }[/math] (note: this is sufficient, but not necessary).
  • [math]\displaystyle{ f }[/math] strongly convex if and only if [math]\displaystyle{ f''(x) \ge m \gt 0 }[/math] for all [math]\displaystyle{ x. }[/math]

For example, let [math]\displaystyle{ f }[/math] be strictly convex, and suppose there is a sequence of points [math]\displaystyle{ (x_n) }[/math] such that [math]\displaystyle{ f''(x_n) = \tfrac{1}{n} }[/math]. Even though [math]\displaystyle{ f''(x_n) \gt 0 }[/math], the function is not strongly convex because [math]\displaystyle{ f''(x) }[/math] will become arbitrarily small.

A twice continuously differentiable function [math]\displaystyle{ f }[/math] on a compact domain [math]\displaystyle{ X }[/math] that satisfies [math]\displaystyle{ f''(x)\gt 0 }[/math] for all [math]\displaystyle{ x\in X }[/math] is strongly convex. The proof of this statement follows from the extreme value theorem, which states that a continuous function on a compact set has a maximum and minimum.

Strongly convex functions are in general easier to work with than convex or strictly convex functions, since they are a smaller class. Like strictly convex functions, strongly convex functions have unique minima on compact sets.

Uniformly convex functions

A uniformly convex function,[14][15] with modulus [math]\displaystyle{ \phi }[/math], is a function [math]\displaystyle{ f }[/math] that, for all [math]\displaystyle{ x, y }[/math] in the domain and [math]\displaystyle{ t \in [0, 1], }[/math] satisfies [math]\displaystyle{ f(tx+(1-t)y) \le t f(x)+(1-t)f(y) - t(1-t) \phi(\|x-y\|) }[/math] where [math]\displaystyle{ \phi }[/math] is a function that is non-negative and vanishes only at 0. This is a generalization of the concept of strongly convex function; by taking [math]\displaystyle{ \phi(\alpha) = \tfrac{m}{2} \alpha^2 }[/math] we recover the definition of strong convexity.

It is worth noting that some authors require the modulus [math]\displaystyle{ \phi }[/math] to be an increasing function,[15] but this condition is not required by all authors.[14]


Functions of one variable

  • The function [math]\displaystyle{ f(x)=x^2 }[/math] has [math]\displaystyle{ f''(x)=2\gt 0 }[/math], so f is a convex function. It is also strongly convex (and hence strictly convex too), with strong convexity constant 2.
  • The function [math]\displaystyle{ f(x)=x^4 }[/math] has [math]\displaystyle{ f''(x)=12x^2\ge 0 }[/math], so f is a convex function. It is strictly convex, even though the second derivative is not strictly positive at all points. It is not strongly convex.
  • The absolute value function [math]\displaystyle{ f(x)=|x| }[/math] is convex (as reflected in the triangle inequality), even though it does not have a derivative at the point [math]\displaystyle{ x = 0. }[/math] It is not strictly convex.
  • The function [math]\displaystyle{ f(x)=|x|^p }[/math] for [math]\displaystyle{ p \ge 1 }[/math] is convex.
  • The exponential function [math]\displaystyle{ f(x)=e^x }[/math] is convex. It is also strictly convex, since [math]\displaystyle{ f''(x)=e^x \gt 0 }[/math], but it is not strongly convex since the second derivative can be arbitrarily close to zero. More generally, the function [math]\displaystyle{ g(x) = e^{f(x)} }[/math] is logarithmically convex if [math]\displaystyle{ f }[/math] is a convex function. The term "superconvex" is sometimes used instead.[16]
  • The function [math]\displaystyle{ f }[/math] with domain [0,1] defined by [math]\displaystyle{ f(0) = f(1) = 1, f(x) = 0 }[/math] for [math]\displaystyle{ 0 \lt x \lt 1 }[/math] is convex; it is continuous on the open interval [math]\displaystyle{ (0, 1), }[/math] but not continuous at 0 and 1.
  • The function [math]\displaystyle{ x^3 }[/math] has second derivative [math]\displaystyle{ 6 x }[/math]; thus it is convex on the set where [math]\displaystyle{ x \geq 0 }[/math] and concave on the set where [math]\displaystyle{ x \leq 0. }[/math]
  • Examples of functions that are monotonically increasing but not convex include [math]\displaystyle{ f(x)=\sqrt{x} }[/math] and [math]\displaystyle{ g(x)=\log x }[/math].
  • Examples of functions that are convex but not monotonically increasing include [math]\displaystyle{ h(x)= x^2 }[/math] and [math]\displaystyle{ k(x)=-x }[/math].
  • The function [math]\displaystyle{ f(x) = \tfrac{1}{x} }[/math] has [math]\displaystyle{ f''(x)=\tfrac{2}{x^3} }[/math] which is greater than 0 if [math]\displaystyle{ x \gt 0 }[/math] so [math]\displaystyle{ f(x) }[/math] is convex on the interval [math]\displaystyle{ (0, \infty) }[/math]. It is concave on the interval [math]\displaystyle{ (-\infty, 0) }[/math].
  • The function [math]\displaystyle{ f(x)=\tfrac{1}{x^2} }[/math] with [math]\displaystyle{ f(0)=\infty }[/math], is convex on the interval [math]\displaystyle{ (0, \infty) }[/math] and convex on the interval [math]\displaystyle{ (-\infty, 0) }[/math], but not convex on the interval [math]\displaystyle{ (-\infty, \infty) }[/math], because of the singularity at [math]\displaystyle{ x = 0. }[/math]

Functions of n variables

  • LogSumExp function, also called softmax function, is a convex function.
  • The function [math]\displaystyle{ -\log\det(X) }[/math] on the domain of positive-definite matrices is convex.[7]:74
  • Every real-valued linear transformation is convex but not strictly convex, since if [math]\displaystyle{ f }[/math] is linear, then [math]\displaystyle{ f(a + b) = f(a) + f(b) }[/math]. This statement also holds if we replace "convex" by "concave".
  • Every real-valued affine function, that is, each function of the form [math]\displaystyle{ f(x) = a^T x + b, }[/math] is simultaneously convex and concave.
  • Every norm is a convex function, by the triangle inequality and positive homogeneity.
  • The spectral radius of a nonnegative matrix is a convex function of its diagonal elements.[17]

See also


  1. "Lecture Notes 2". 
  2. "Concave Upward and Downward". 
  3. Stewart, James (2015). Calculus (8th ed.). Cengage Learning. pp. 223–224. ISBN 978-1305266643. 
  4. W. Hamming, Richard (2012). Methods of Mathematics Applied to Calculus, Probability, and Statistics (illustrated ed.). Courier Corporation. p. 227. ISBN 978-0-486-13887-9.  Extract of page 227
  5. Uvarov, Vasiliĭ Borisovich (1988). Mathematical Analysis. Mir Publishers. p. 126-127. ISBN 978-5-03-000500-3. 
  6. Prügel-Bennett, Adam (2020). The Probability Companion for Engineering and Computer Science (illustrated ed.). Cambridge University Press. p. 160. ISBN 978-1-108-48053-6.  Extract of page 160
  7. 7.0 7.1 Boyd, Stephen P.; Vandenberghe, Lieven (2004) (pdf). Convex Optimization. Cambridge University Press. ISBN 978-0-521-83378-3. Retrieved October 15, 2011. 
  8. Donoghue, William F. (1969). Distributions and Fourier Transforms. Academic Press. p. 12. ISBN 9780122206504. Retrieved August 29, 2012. 
  9. "If f is strictly convex in a convex set, show it has no more than 1 minimum". Math StackExchange. 21 Mar 2013. 
  10. Altenberg, L., 2012. Resolvent positive linear operators exhibit the reduction phenomenon. Proceedings of the National Academy of Sciences, 109(10), pp.3705-3710.
  11. Dimitri Bertsekas (2003). Convex Analysis and Optimization. Contributors: Angelia Nedic and Asuman E. Ozdaglar. Athena Scientific. p. 72. ISBN 9781886529458. 
  12. Philippe G. Ciarlet (1989). Introduction to numerical linear algebra and optimisation. Cambridge University Press. ISBN 9780521339841. 
  13. 13.0 13.1 Yurii Nesterov (2004). Introductory Lectures on Convex Optimization: A Basic Course. Kluwer Academic Publishers. pp. 63–64. ISBN 9781402075537. 
  14. 14.0 14.1 C. Zalinescu (2002). Convex Analysis in General Vector Spaces. World Scientific. ISBN 9812380671. 
  15. 15.0 15.1 H. Bauschke and P. L. Combettes (2011). Convex Analysis and Monotone Operator Theory in Hilbert Spaces. Springer. p. 144. ISBN 978-1-4419-9467-7. 
  16. Kingman, J. F. C. (1961). "A Convexity Property of Positive Matrices". The Quarterly Journal of Mathematics 12: 283–284. doi:10.1093/qmath/12.1.283. 
  17. Cohen, J.E., 1981. Convexity of the dominant eigenvalue of an essentially nonnegative matrix. Proceedings of the American Mathematical Society, 81(4), pp.657-658.


  • Bertsekas, Dimitri (2003). Convex Analysis and Optimization. Athena Scientific. 
  • Borwein, Jonathan, and Lewis, Adrian. (2000). Convex Analysis and Nonlinear Optimization. Springer.
  • Donoghue, William F. (1969). Distributions and Fourier Transforms. Academic Press. 
  • 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. 
  • Lauritzen, Niels (2013). Undergraduate Convexity. World Scientific Publishing. 
  • Luenberger, David (1984). Linear and Nonlinear Programming. Addison-Wesley. 
  • Luenberger, David (1969). Optimization by Vector Space Methods. Wiley & Sons. 
  • Rockafellar, R. T. (1970). Convex analysis. Princeton: Princeton University Press. 
  • Thomson, Brian (1994). Symmetric Properties of Real Functions. CRC Press. 
  • Zălinescu, C. (2002). Convex analysis in general vector spaces. River Edge, NJ: World Scientific Publishing  Co., Inc. pp. xx+367. ISBN 981-238-067-1. 

External links