In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, a
real-valued function
In mathematics, a real-valued function is a function whose values are real numbers. In other words, it is a function that assigns a real number to each member of its domain.
Real-valued functions of a real variable (commonly called ''real fun ...
is called convex if the
line segment
In geometry, a line segment is a part of a straight line that is bounded by two distinct end points, and contains every point on the line that is between its endpoints. The length of a line segment is given by the Euclidean distance between ...
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
In geometry, a subset of a Euclidean space, or more generally an affine space over the reals, is convex if, given any two points in the subset, the subset contains the whole line segment that joins them. Equivalently, a convex set or a convex r ...
. A twice-differentiable function of a single variable is convex
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (shortened as "iff") is a biconditional logical connective between statements, where either both statements are true or both are false.
The connective is bicondi ...
its second derivative is nonnegative on its entire domain. Well-known examples of convex functions of a single variable include the
quadratic function
In mathematics, a quadratic polynomial is a polynomial of degree two in one or more variables. A quadratic function is the polynomial function defined by a quadratic polynomial. Before 20th century, the distinction was unclear between a polynomial ...
and the
exponential function
The exponential function is a mathematical function denoted by f(x)=\exp(x) or e^x (where the argument is written as an exponent). Unless otherwise specified, the term generally refers to the positive-valued function of a real variable, a ...
. In simple terms, a convex function refers to a function whose graph is shaped like a cup
, while a
concave function
In mathematics, a concave function is the negative of a convex function. A concave function is also synonymously called concave downwards, concave down, convex upwards, convex cap, or upper convex.
Definition
A real-valued function f on an in ...
's graph is shaped like a cap
.
Convex functions play an important role in many areas of mathematics. They are especially important in the study of
optimization
Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
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
The calculus of variations (or Variational Calculus) is a field of mathematical analysis that uses variations, which are small changes in functions
and functionals, to find maxima and minima of functionals: mappings from a set of functions t ...
. In
probability theory
Probability theory is the branch of mathematics concerned with probability. Although there are several different probability interpretations, probability theory treats the concept in a rigorous mathematical manner by expressing it through a set o ...
, a convex function applied to the
expected value
In probability theory, the expected value (also called expectation, expectancy, mathematical expectation, mean, average, or first moment) is a generalization of the weighted average. Informally, the expected value is the arithmetic mean of a l ...
of a
random variable
A random variable (also called random quantity, aleatory variable, or stochastic variable) is a mathematical formalization of a quantity or object which depends on random events. It is a mapping or a function from possible outcomes (e.g., the po ...
is always bounded above by the expected value of the convex function of the random variable. This result, known as
Jensen's inequality
In mathematics, Jensen's inequality, named after the Danish mathematician Johan Jensen, relates the value of a convex function of an integral to the integral of the convex function. It was proved by Jensen in 1906, building on an earlier pr ...
, can be used to deduce inequalities such as the
arithmetic–geometric mean inequality and
Hölder's inequality.
Definition
Let
be a
convex subset
In geometry, a subset of a Euclidean space, or more generally an affine space over the reals, is convex if, given any two points in the subset, the subset contains the whole line segment that joins them. Equivalently, a convex set or a convex ...
of a real
vector space
In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called ''vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but can ...
and let
be a function.
Then
is called if and only if any of the following equivalent conditions hold:
- For all and all :
The right hand side represents the straight line between and in the graph of as a function of increasing from to or decreasing from to sweeps this line. Similarly, the argument of the function in the left hand side represents the straight line between and in or the -axis of the graph of So, this condition requires that the straight line between any pair of points on the curve of to be above or just meets the graph.
- For all and all such that :
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, and ) between the straight line passing through a pair of points on the curve of (the straight line is represented by the right hand side of this condition) and the curve of the first condition includes the intersection points as it becomes or at or or In fact, the intersection points do not need to be considered in a condition of convex using because and 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
is also the statement used to define that are valued in the
extended real number line
In mathematics, the affinely extended real number system is obtained from the real number system \R by adding two infinity elements: +\infty and -\infty, where the infinities are treated as actual numbers. It is useful in describing the algebra ...
where such a function
is allowed to take
as a value. The first statement is not used because it permits
to take
or
as a value, in which case, if
or
respectively, then
would be undefined (because the multiplications
and
are undefined). The sum
is also undefined so a convex extended real-valued function is typically only allowed to take exactly one of
and
as a value.
The second statement can also be modified to get the definition of , where the latter is obtained by replacing
with the strict inequality
Explicitly, the map
is called if and only if for all real
and all
such that
:
A strictly convex function
is a function that the straight line between any pair of points on the curve
is above the curve
except for the intersection points between the straight line and the curve.
The function
is said to be (resp. ) if
(
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
Concave or concavity may refer to:
Science and technology
* Concave lens
* Concave mirror
Mathematics
* Concave function, the negative of a convex function
* Concave polygon, a polygon which is not convex
* Concave set
* The concavity
In ca ...
is often referred as ''concave down'' or ''convex upward''. If the term "convex" is used without an "up" or "down" keyword, then it refers strictly to a cup shaped graph
. As an example,
Jensen's inequality
In mathematics, Jensen's inequality, named after the Danish mathematician Johan Jensen, relates the value of a convex function of an integral to the integral of the convex function. It was proved by Jensen in 1906, building on an earlier pr ...
refers to an inequality involving a convex or convex-(up), function.
Properties
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
is a function of one
real
Real may refer to:
Currencies
* Brazilian real (R$)
* Central American Republic real
* Mexican real
* Portuguese real
* Spanish real
* Spanish colonial real
Music Albums
* ''Real'' (L'Arc-en-Ciel album) (2000)
* ''Real'' (Bright album) (2010)
...
variable defined on an interval, and let
(note that
is the slope of the purple line in the above drawing; the function
is
symmetric
Symmetry (from grc, συμμετρία "agreement in dimensions, due proportion, arrangement") in everyday language refers to a sense of harmonious and beautiful proportion and balance. In mathematics, "symmetry" has a more precise definiti ...
in
means that
does not change by exchanging
and
).
is convex if and only if
is
monotonically non-decreasing
In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
in
for every fixed
(or vice versa). This characterization of convexity is quite useful to prove the following results.
* A convex function
of one real variable defined on some
open interval
In mathematics, a (real) interval is a set of real numbers that contains all real numbers lying between any two numbers of the set. For example, the set of numbers satisfying is an interval which contains , , and all numbers in between. Other ...
is
continuous
Continuity or continuous may refer to:
Mathematics
* Continuity (mathematics), the opposing concept to discreteness; common examples include
** Continuous probability distribution or random variable in probability and statistics
** Continuous ...
on
admits
left and right derivatives, and these are
monotonically non-decreasing
In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
. As a consequence,
is
differentiable
In mathematics, a differentiable function of one real variable is a function whose derivative exists at each point in its domain. In other words, the graph of a differentiable function has a non-vertical tangent line at each interior point in its ...
at all but at most
countably many
In mathematics, a set is countable if either it is finite or it can be made in one to one correspondence with the set of natural numbers. Equivalently, a set is ''countable'' if there exists an injective function from it into the natural number ...
points, the set on which
is not differentiable can however still be dense. If
is closed, then
may fail to be continuous at the endpoints of
(an example is shown in the
examples section).
* A
differentiable
In mathematics, a differentiable function of one real variable is a function whose derivative exists at each point in its domain. In other words, the graph of a differentiable function has a non-vertical tangent line at each interior point in its ...
function of one variable is convex on an interval if and only if its
derivative
In mathematics, the derivative of a function of a real variable measures the sensitivity to change of the function value (output value) with respect to a change in its argument (input value). Derivatives are a fundamental tool of calculus. F ...
is
monotonically non-decreasing
In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
on that interval. If a function is differentiable and convex then it is also
continuously differentiable
In mathematics, a differentiable function of one real variable is a function whose derivative exists at each point in its domain. In other words, the graph of a differentiable function has a non-vertical tangent line at each interior point in its ...
(due to
Darboux's theorem
Darboux's theorem is a theorem in the mathematical field of differential geometry and more specifically differential forms, partially generalizing the Frobenius integration theorem. It is a foundational result in several fields, the chief among ...
).
* A differentiable function of one variable is convex on an interval if and only if its graph lies above all of its
tangent
In geometry, the tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points on the curve. More ...
s:
for all
and
in the interval.
* A twice differentiable function of one variable is convex on an interval if and only if its
second derivative
In calculus, the second derivative, or the second order derivative, of a function is the derivative of the derivative of . Roughly speaking, the second derivative measures how the rate of change of a quantity is itself changing; for example, ...
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 point
In differential calculus and differential geometry, an inflection point, point of inflection, flex, or inflection (British English: inflexion) is a point on a smooth plane curve at which the curvature changes sign. In particular, in the case of ...
s). If its second derivative is positive at all points then the function is strictly convex, but the
converse
Converse may refer to:
Mathematics and logic
* Converse (logic), the result of reversing the two parts of a definite or implicational statement
** Converse implication, the converse of a material implication
** Converse nonimplication, a logical c ...
does not hold. For example, the second derivative of
is
, which is zero for
but
is strictly convex.
**This property and the above property in terms of "...its derivative is monotonically non-decreasing..." are not equal since if
is non-negative on an interval
then
is monotonically non-decreasing on
while its converse is not true, for example,
is monotonically non-decreasing on
while its derivative
is not defined at some points on
.
* If
is a convex function of one real variable, and
, then
is
superadditive In mathematics, a function f is superadditive if
f(x+y) \geq f(x) + f(y)
for all x and y in the domain of f.
Similarly, a sequence \left\, n \geq 1, is called superadditive if it satisfies the inequality
a_ \geq a_n + a_m
for all m and n.
The ter ...
on the
positive reals
In mathematics, the set of positive real numbers, \R_ = \left\, is the subset of those real numbers that are greater than zero. The non-negative real numbers, \R_ = \left\, also include zero. Although the symbols \R_ and \R^ are ambiguously used fo ...
, that is
for positive real numbers
and
.
* A function is midpoint convex on an interval
if for all
This condition is only slightly weaker than convexity. For example, a real-valued
Lebesgue measurable function
In mathematics and in particular measure theory, a measurable function is a function between the underlying sets of two measurable spaces that preserves the structure of the spaces: the preimage of any measurable set is measurable. This is in ...
that is midpoint-convex is convex: this is a theorem of
Sierpinski. In particular, a continuous function that is midpoint convex will be convex.
Functions of several variables
* A function