Calculus How To

Convex Function: Definition, Example

Share on

Types of Functions >

What is a Convex Function?
Closed Convex Function

Convex Function Definition

A convex function has a very distinct ‘smiley face’ appearance. A line drawn between any two points on the interval will never dip below the graph.
convex function graph

It’s more precisely defined as a function where, for every interval on its domain, the midpoint isn’t larger than (higher than) the arithmetic mean of the values (heights) at the ends of the interval.

A few examples of convex functions:

  • eax
  • − log(x)
  • x|a|, a ≥1

Graphical Examples of Convex and Non Convex Functions

The easiest way to figure out if a graph is convex or not is by attempting to draw lines connecting random intervals.

On the left is a convex curve; the green lines, no matter where we draw them, will always be above the curve or lie on it.
convex function examples

On the right, we are able to draw a number of lines between points on the graph which actually do dip below the graph. (Two are shown, drawn in green and blue). This curve is not convex at all on the interval being graphed.

Mathematical Definition of a Convex Function

The use of Greek letters makes the technical definition of a convex function look as if it was something complicated; but in fact, all it says is what was stated above: for any two points, the average of their value must be larger than the values of their midpoints.

We write that this way:
a function f(x) is convex on an interval [a,b] if for any two points x, y on the interval, and 0 ≤ λ ≤ 1

Closed Function

In convex analysis, a closed function is a convex function with an epigraph that is a closed set.

The epigraph is the set of points laying on or above the function’s graph. A convex function has an epigraph that is a convex set. If you’re unfamiliar with epigraphs and convex sets, this image shows you the basic idea behind those terms (Duchi, 2016):

closed function

Top: a convex and a non-convex set. Bottom: a convex function and it’s epigraph (which is a convex set).

Perhaps not surprisingly (based on the above images), any continuous convex function is also a closed function.

While the concept of a closed functions can technically be applied to both convex and concave functions, it is usually applied just to convex functions. Therefore, they are also called closed convex functions. For concave functions, the hypograph (the set of points lying on or below its graph) is a closed set.

Closed Function Examples

As well as convex functions, continuous on a closed domain, there are many other functions that have closed set epigraphs. For example, all differentiable convex functions with Domain f = Rn are also closed.

The following general families of functions are all closed:

A couple of specific examples of a closed function:

  • f(x) = -log (1 – x2) with domain f = {x| |x| <1}
  • f(x) = x log x with domain f = ℝ+ and f(0) = 0


Ahmadi, A.A. ORF 523 Lecture Notes: Lecture 7. Theory of Convex Functions. Retrieved from on March 2, 2019
Duchi, J. (2016). Convex Analysis Background. Park City Mathematics Institute.
Lecture 4: Closed Functions. Retrieved January 6, 2020 from:
Grasmair, Markus. Basic Properties of Convex Functions.
Louditski, A. Lecture 3: Convex Functions. Retrieved January 6, 2019 from:
Rockafellar, R. (1996). Convex Analysis (Princeton Landmarks in Mathematics and Physics). Princeton University.
Vandenberghe, L. (2019). Conjugate Functions.

Stephanie Glen. "Convex Function: Definition, Example" From Calculus for the rest of us!

Need help with a homework or test question? With Chegg Study, you can get step-by-step solutions to your questions from an expert in the field. Your first 30 minutes with a Chegg tutor is free!

Leave a Reply

Your email address will not be published. Required fields are marked *