A real-valued function is convex if the line segment between any two distinct points of 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.
Figure: A convex function’s epigraph 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. Some well-known examples of convex single variable functions include: (1) linear functions, (2) quadratic functions and (3) exponential functions.
0.1 Convex Function
Let \(X\) be a convex subset of a real vector space and let \(f:X\rightarrow \mathbb{R}\) be a function. Then \(f\) is convex if and only if for all \(0< t< 1\) and all \(x_{1}, x_{2}\in X\) \[ f(tx_{1}+(1-t)x_{2})\leq tf(x_{1})+(1-t)f(x_{2}). \] Here the RHS represents the straight line between \((x_{1}, f(x_{1}))\) and \((x_{2}, f(x_{2}))\) in the graph of \(f\)as a function of \(t\).