In mathematics, a realvalued function ƒ 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
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 or on the straight line segment connecting two points, for any two points in the interval.
A function is called strictly convex if
for any t in (0, 1) and x ≠ y.
A function ƒ is said to be concave if −ƒ is convex.
Contents 
A convex function ƒ 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 ƒ may fail to be continuous at the endpoints of C.
A function is midpoint convex on an interval C if
for all x and y in C. This condition is only slightly weaker than convexity. For example, a real valued Lebesgue measurable function that is midpoint convex will be convex.^{[1]} 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 nondecreasing 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: ƒ(y) ≥ ƒ(x) + ƒ '(x) (y − x) for all x and y in the interval. In particular, if ƒ '(c) = 0, then c is a global minimum of ƒ(x).
A twice differentiable function of one variable is convex on an interval if and only if its second derivative is nonnegative 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 ƒ(x) = x^{4} is ƒ "(x) = 12 x^{2}, which is zero for x = 0, but x^{4} 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 ƒ, the sublevel sets {x  ƒ(x) < a} and {x  ƒ(x) ≤ a} with a ∈ R 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 ƒ. If X is a random variable taking values in the domain of ƒ, then (Here denotes the mathematical expectation.)
The concept of strong convexity extends the notion of strict convexity, and a strongly convex function is also strictly convex, but not viceversa. A function f is called strongly convex with parameter m > 0 if it is differentiable and the following equation holds for all points x,y in its domain:
This is equivalent to the following
It is actually not necessary for a function to be differentiable in order to be strongly convex. A third equivalent definition for a strongly convex function, with parameter m, is that, for all x,y in the domain and
(note that for .)
If the function f is twice continuously differentiable, then f is strongly convex with parameter m if and only if for all x in the domain, where I is the identity and is the Hessian matrix, and the inequality means that is positive definite. This is equivalent to requiring that the minimum eigenvalue of be at least m for all x. If the domain is just the real line, then is just the second derivative , so the condition becomes . If m = 0, then this means the Hessian is positive semidefinite (or if the domain is the real line, it means that ), which implies the function is convex, and perhaps strictly convex, but not strongly convex.
Assuming still that the function is twice continuously differentiable, we show that bounding the minimum eigenvalue of implies that it is strongly convex. Start by using Taylor's Theorem:
for some (unknown) . Then by the assumption about the eigenvalues, and hence we recover the second strong convexity equation above.
The distinction between convex, strictly convex, and strongly convex can be subtle at first glimpse. If f is twice continuously differentiable and the domain is the real line, then we can characterize it as follows:
For example, consider a function f that is strictly convex, and suppose there is a sequence of points (x_{n}) such that . Even though , the function is not strongly convex because will become arbitrarily small.
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.
