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 f is a function of one
real variable defined on an interval, and let R(x_1, x_2) = \frac{f(x_2) - f(x_1)}{x_2 - x_1} (note that R(x_1, x_2) is the slope of the purple line in the first drawing; the function R is
symmetric in (x_1, x_2), means that R does not change by exchanging x_1 and x_2). f is convex if and only if R(x_1, x_2) is
monotonically non-decreasing in x_1, for every fixed x_2 (or vice versa). This characterization of convexity is quite useful to prove the following results. • A convex function f of one real variable defined on some
open interval C is
continuous on C . Moreover, f admits
left and right derivatives, and these are
monotonically non-decreasing. In addition, the left derivative is left-continuous and the right-derivative is right-continuous. As a consequence, f is
differentiable at all but at most
countably many points, the set on which f is not differentiable can however still be dense. If C is closed, then f may fail to be continuous at the endpoints of C (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. • A differentiable function of one variable is convex on an interval if and only if its graph lies above all of its
tangents: f(x) \geq f(y) + f'(y) (x-y) for all x and y 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 f(x) = x^4 is f''(x) = 12x^{2}, which is zero for x = 0, but x^4 is strictly convex. • This property and the above property in terms of "...its derivative is monotonically non-decreasing..." are not equal since if f'' is non-negative on an interval X then f' is monotonically non-decreasing on X while its converse is not true, for example, f' is monotonically non-decreasing on X while its derivative f'' is not defined at some points on X. • If f is a convex function of one real variable, and f(0)\le 0, then f is
superadditive on the
positive reals, that is f(a + b) \geq f(a) + f(b) for positive real numbers a and b. {{math proof|proof= Since f is convex, by using one of the convex function definitions above and letting x_2 = 0, it follows that for all real 0 \leq t \leq 1, \begin{align} f(tx_1) & = f(t x_1 + (1-t) \cdot 0) \\ & \leq t f(x_1) + (1-t) f(0) \\ & \leq t f(x_1). \\ \end{align} From f(tx_1)\leq t f(x_1), it follows that \begin{align} f(a) + f(b) & = f \left((a+b) \frac{a}{a+b} \right) + f \left((a+b) \frac{b}{a+b} \right) \\ & \leq \frac{a}{a+b} f(a+b) + \frac{b}{a+b} f(a+b) \\ & = f(a+b).\\ \end{align} Namely, f(a) + f(b) \leq f(a+b). }} • A function f is midpoint convex on an interval C if for all x_1, x_2 \in C f\!\left(\frac{x_1 + x_2}{2}\right) \leq \frac{f(x_1) + f(x_2)}{2}. 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
Sierpiński. In particular, a continuous function that is midpoint convex will be convex.
Functions of several variables • A function that is marginally convex in each individual variable is not necessarily (jointly) convex. For example, the function f(x, y) = x y is
marginally linear, and thus marginally convex, in each variable, but not (jointly) convex. • A function f : X \to [-\infty, \infty] valued in the
extended real numbers [-\infty, \infty] = \R \cup \{\pm\infty\} is convex if and only if its
epigraph \{(x, r) \in X \times \R ~:~ r \geq f(x)\} is a convex set. • A differentiable function f defined on a convex domain is convex if and only if f(x) \geq f(y) + \nabla f(y)^T \cdot (x-y) holds for all x, y 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 f, the
sublevel sets \{x : f(x) and \{x : f(x) \leq a\} with a \in \R are convex sets. A function that satisfies this property is called a '''''' and may fail to be a convex function. • Consequently, the set of
global minimisers of a convex function f is a convex set: {\operatorname{argmin}}\,f - convex. • Any
local minimum of a convex function is also a
global minimum. A convex function will have at most one global minimum. •
Jensen's inequality applies to every convex function f. If X is a random variable taking values in the domain of f, then \operatorname{E}(f(X)) \geq f(\operatorname{E}(X)), where \operatorname{E} 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 x and y, (that is, a function satisfying f(a x, a y) = a f(x, y) for all positive real a, x, y > 0) that is convex in one variable must be convex in the other variable. ==Operations that preserve convexity==