# Convex function

A convex function is a real-valued function defined on a convex set whose graph lies below every chord joining two of its points: algebraically, for all points x and y in its domain and all θ with 0 ≤ θ ≤ 1,

\[ f(\theta x + (1-\theta)y) \le \theta f(x) + (1-\theta)f(y). \]

The domain must itself be convex, meaning it contains the whole segment between any two of its points, for the left side to be defined<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>. The function is concave if −f is convex, and strictly convex if the inequality is strict for x ≠ y and 0 < θ < 1<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup><sup> • </sup><sup>[2](https://jhc.sjtu.edu.cn/~kuanyang/teaching/CS2601/notes/lec05.html)</sup>.

| Key fact | Detail |
|---|---|
| Defining inequality | f(θx + (1−θ)y) ≤ θf(x) + (1−θ)f(y) for all x, y in a convex domain and θ ∈ [0, 1]<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup> |
| Epigraph test | f is convex if and only if its epigraph, the set {(x, t) : f(x) ≤ t}, is a convex set<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup> |
| Second-derivative test | A twice-differentiable function on an interval is convex if f″(x) ≥ 0 throughout<sup>[3](https://people.cs.uchicago.edu/~laci/06dm/lecturenotes.pdf)</sup> |
| Jensen's inequality | For convex f and a random variable X with existing expectations, f(E X) ≤ E f(X)<sup>[4](https://math.cmu.edu/users/ttkocz/teaching/1920/prob-grad-notes.pdf)</sup> |
| Basic examples | x², eˣ convex; √x, ln x concave; sin x concave on [0, π] and convex on [π, 2π]<sup>[3](https://people.cs.uchicago.edu/~laci/06dm/lecturenotes.pdf)</sup> |
| Affine boundary case | A function both convex and concave is affine; affine functions are both, but neither strictly<sup>[5](https://mjo.osborne.economics.utoronto.ca/index.php/tutorial/index/1/CV1)</sup><sup> • </sup><sup>[2](https://jhc.sjtu.edu.cn/~kuanyang/teaching/CS2601/notes/lec05.html)</sup> |
| Optimization role | Convexity guarantees that local solutions are globally optimal and enables polynomial-time algorithms under mild assumptions<sup>[6](https://doi.org/10.1080/02331934.2026.2672525)</sup> |

## Equivalent characterizations

The two-point inequality is only the starting point. Several other conditions pick out exactly the same functions, and each is useful in a different setting.

**Epigraph.** The epigraph of f is the set of points on or above the graph, epi f = {(x, t) : x ∈ dom f, f(x) ≤ t}. A function is convex if and only if its epigraph is a convex set, and concave if and only if its hypograph {(x, t) : t ≤ f(x)} is convex<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>. This links functions to convex sets: for example, the α-sublevel sets {x : f(x) ≤ α} of a convex function are convex, though convex sublevel sets do not by themselves force the function to be convex<sup>[7](https://web.stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf)</sup>.

**First-order condition.** If f is differentiable on an open convex domain, then f is convex if and only if

\[ f(y) \ge f(x) + \nabla f(x)^{\top}(y - x) \]

for all x and y in the domain. The first-order Taylor approximation at any point is a global underestimator of the function, and conversely. This is what lets local information, a value and a gradient at one point, produce a global bound, and it implies that any point with ∇f(x) = 0 is a global minimizer<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>.

**Second-derivative and midpoint tests.** For a twice-differentiable function on an interval, f″ ≥ 0 everywhere is sufficient for convexity, and strict positivity gives strict convexity<sup>[3](https://people.cs.uchicago.edu/~laci/06dm/lecturenotes.pdf)</sup><sup> • </sup><sup>[8](https://www.tropp.caltech.edu/notes/Tro24-Probability-Theory-LN.pdf)</sup>. Convexity can also be checked from the midpoint condition f((a+b)/2) ≤ (f(a)+f(b))/2 alone, provided the function is continuous; without continuity the midpoint condition defines the weaker class of Jensen-convex (J-convex) functions<sup>[3](https://people.cs.uchicago.edu/~laci/06dm/lecturenotes.pdf)</sup><sup> • </sup><sup>[9](https://www.sciencedirect.com/topics/engineering/convex-function)</sup>. A convex function is in fact continuous on the relative interior of its domain, so discontinuities can occur only at the boundary<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>.

## Jensen's inequality

The defining inequality extends from two points to any convex combination. If f is convex, x₁, …, x_k lie in its domain, and θ₁, …, θ_k ≥ 0 with θ₁ + ⋯ + θ_k = 1, then f(θ₁x₁ + ⋯ + θ_kx_k) ≤ θ₁f(x₁) + ⋯ + θ_kf(x_k); the extension to infinite sums, integrals, and expected values follows<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>. In probabilistic form, if f is convex and X is a random variable for which E X and E f(X) exist, then

\[ f(\mathbb{E}X) \le \mathbb{E}f(X). \]

For a concave function the inequality reverses<sup>[4](https://math.cmu.edu/users/ttkocz/teaching/1920/prob-grad-notes.pdf)</sup>. One standard proof uses the tangent-line property: a tangent at x₀ lies below the graph, so f(X) ≥ f(E X) + f′(E X)(X − E X), and taking expectations makes the correction term vanish. A second proof represents a convex function as the pointwise supremum of the affine functions below it and applies linearity of expectation to each<sup>[4](https://math.cmu.edu/users/ttkocz/teaching/1920/prob-grad-notes.pdf)</sup>. The inequality also holds conditionally: φ(E[X | 𝒢]) ≤ E[φ(X) | 𝒢] for any conditioning information 𝒢<sup>[10](https://maths.dur.ac.uk/users/nicholas.georgiou/ASP25/prelim/_book/expectation-and-probability.html)</sup>.

The consequences reach across probability and analysis. Applying Jensen to f(t) = t^(q/p) for 1 ≤ p ≤ q shows that the Lᵖ norm ||X||_p is nondecreasing in p<sup>[4](https://math.cmu.edu/users/ttkocz/teaching/1920/prob-grad-notes.pdf)</sup>. With the strictly convex function g(t) = t² it gives (E[X | 𝒢])² ≤ E[X² | 𝒢]<sup>[10](https://maths.dur.ac.uk/users/nicholas.georgiou/ASP25/prelim/_book/expectation-and-probability.html)</sup>. When f is strictly convex and the law of X takes at least two values, the inequality is strict<sup>[8](https://www.tropp.caltech.edu/notes/Tro24-Probability-Theory-LN.pdf)</sup>.

## History

The modern definition and the mean-value inequality carry the name of the Danish mathematician [Johan Jensen](https://www.edgepedia.org/johan-jensen-danish-mathematician). His paper *Sur les fonctions convexes et les inégalités entre les valeurs moyennes* was delivered as a lecture to the Danish Mathematical Society on 17 January 1905 and printed in *Acta Mathematica*, volume 30, dated 19 December 1905 and published in 1906<sup>[11](https://www.cs.cmu.edu/~suvrit/teach/papers/1906_jensen_sur_les_fonctions_convexes_et_les_inegalites_entre_valeurs_moyennes.pdf)</sup>. Jensen presented convexity through the midpoint inequality and treated linear functions as the common boundary case between the convex and concave classes<sup>[11](https://www.cs.cmu.edu/~suvrit/teach/papers/1906_jensen_sur_les_fonctions_convexes_et_les_inegalites_entre_valeurs_moyennes.pdf)</sup>. The underlying inequality for smooth functions predates him: Hölder proved it in 1889 assuming f twice differentiable with f″ ≥ 0 on the interval<sup>[12](https://www.sciencedirect.com/topics/mathematics/jensen-inequality)</sup>. Jensen's own stated aim was a series of general inequalities containing nearly all previously known ones as special cases, beginning with Cauchy's demonstration that the geometric mean of positive numbers does not exceed their arithmetic mean<sup>[11](https://www.cs.cmu.edu/~suvrit/teach/papers/1906_jensen_sur_les_fonctions_convexes_et_les_inegalites_entre_valeurs_moyennes.pdf)</sup>.

## Role in optimization

Convex functions are the object that makes convex optimization tractable. A convex optimization problem minimizes a convex objective subject to affine equality constraints and convex inequality constraints<sup>[13](https://jhc.sjtu.edu.cn/~kuanyang/teaching/CS2601/notes/lec06.html)</sup>. Convexity guarantees that any local solution is globally optimal and enables polynomial-time algorithms under mild assumptions<sup>[6](https://doi.org/10.1080/02331934.2026.2672525)</sup>. Problems with hundreds of variables and nonlinear, nondifferentiable objectives can be solved efficiently by interior-point methods that exploit the convex structure<sup>[14](https://web.stanford.edu/~boyd/papers/CRCD_prog.html)</sup>.

The practical reach of the first-order condition illustrates why. Because every tangent line underestimates a convex function everywhere, a single gradient evaluation certifies a global lower bound, and a vanishing gradient certifies a global minimum<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>. Machine learning loss surfaces, by contrast, are generally nonconvex, and classical gradient-method theory there required extension to handle saddle points before it matched practice<sup>[15](https://arxiv.org/abs/1902.04811)</sup>.

## Variants and related notions

**Strict convexity.** A strictly convex function satisfies the defining inequality strictly for distinct points and 0 < θ < 1, and has at most one minimum point<sup>[2](https://jhc.sjtu.edu.cn/~kuanyang/teaching/CS2601/notes/lec05.html)</sup><sup> • </sup><sup>[16](https://ndl.ethernet.edu.et/bitstream/123456789/60465/1/124.pdf)</sup>. Strict convexity has its own first-order characterization, with a strict inequality in the tangent-line condition<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>.

**J-convexity.** Requiring only the midpoint inequality, without continuity, defines functions convex in Jensen's sense, or J-convex; the epigraph definition of convexity in general real linear spaces follows Rockafellar's *Convex Analysis* (1970)<sup>[9](https://www.sciencedirect.com/topics/engineering/convex-function)</sup><sup> • </sup><sup>[17](https://mizar.uwb.edu.pl/JFM/Vol15/convfun1.html)</sup>. Rockafellar's treatment also takes the convex-combination inequality as a definition of convexity for extended-real-valued functions and states [Jensen's inequality](https://www.edgepedia.org/jensens-inequality) for weighted combinations with λᵢ > 0 summing to 1<sup>[18](https://djvu.online/file/68u51YEBQaqiP)</sup>.

**Extended-valued form.** In convex analysis a convex function is often extended to all of ℝⁿ by setting it to +∞ outside its domain, which lets sums and the defining inequality be written without repeatedly qualifying the domain; the indicator function of a convex set, equal to 0 on the set and +∞ elsewhere, is the standard example<sup>[1](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)</sup>.

## References

1. [Stephen Boyd and Lieven Vandenberghe, *Convex Optimization*, Cambridge University Press, Chapter 3](https://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)
2. [Lecture 5, Convex Functions, CS2601, Shanghai Jiao Tong University](https://jhc.sjtu.edu.cn/~kuanyang/teaching/CS2601/notes/lec05.html)
3. [Laci Babai, Chapter 3: Convex Functions and Jensen's Inequality, University of Chicago lecture notes](https://people.cs.uchicago.edu/~laci/06dm/lecturenotes.pdf)
4. [Arunav Gupta et al., Probability (graduate class) notes, Carnegie Mellon University, Section 6.2](https://math.cmu.edu/users/ttkocz/teaching/1920/prob-grad-notes.pdf)
5. [Martin J. Osborne, Mathematical methods for economic theory: 3.1 Concave and convex functions of a single variable, University of Toronto](https://mjo.osborne.economics.utoronto.ca/index.php/tutorial/index/1/CV1)
6. [Abbas Khademi, "The convexity zoo: a taxonomy of function classes in optimization", *Optimization*](https://doi.org/10.1080/02331934.2026.2672525)
7. [Boyd and Vandenberghe, Convex Optimization lecture slides, Section 3](https://web.stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf)
8. [Joel Tropp, Probability Theory lecture notes, Caltech CMS 117, Lecture 9](https://www.tropp.caltech.edu/notes/Tro24-Probability-Theory-LN.pdf)
9. [Convex Function, ScienceDirect Topics overview](https://www.sciencedirect.com/topics/engineering/convex-function)
10. [Nicholas Georgiou, APTS Applied Stochastic Processes, Chapter 2: Expectation and probability, University of Durham](https://maths.dur.ac.uk/users/nicholas.georgiou/ASP25/prelim/_book/expectation-and-probability.html)
11. [J. L. W. V. Jensen, "Sur les fonctions convexes et les inégalités entre les valeurs moyennes", *Acta Mathematica* 30 (1906)](https://www.cs.cmu.edu/~suvrit/teach/papers/1906_jensen_sur_les_fonctions_convexes_et_les_inegalites_entre_valeurs_moyennes.pdf)
12. [jensen inequality - an overview | sciencedirect topics](https://www.sciencedirect.com/topics/mathematics/jensen-inequality)
13. [Lecture 6, CS2601, Shanghai Jiao Tong University](https://jhc.sjtu.edu.cn/~kuanyang/teaching/CS2601/notes/lec06.html)
14. [S. Boyd and L. Vandenberghe, "Convex Optimization for Engineering Analysis and Design", Proceedings of the American Control Conference, 1995](https://web.stanford.edu/~boyd/papers/CRCD_prog.html)
15. [Chi Jin, Praneeth Netrapalli, Rong Ge, Sham M. Kakade, Michael I. Jordan, "On Nonconvex Optimization for Machine Learning: Gradients, Stochasticity, and Saddle Points", arXiv:1902.04811](https://arxiv.org/abs/1902.04811)
16. [Convex analysis text, Section 3.1, National Digital Library of Ethiopia repository](https://ndl.ethernet.edu.et/bitstream/123456789/60465/1/124.pdf)
17. [Grigory E. Ivanov, "Definition of Convex Function and Jensen's Inequality", Journal of Formalized Mathematics 15 (2003)](https://mizar.uwb.edu.pl/JFM/Vol15/convfun1.html)
18. [R. Tyrrell Rockafellar, *Convex Analysis*, Princeton University Press, 1970, Theorem 4.3](https://djvu.online/file/68u51YEBQaqiP)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Statistics and probability › Probability theory › Expectation, moments, and inequalities › Jensen, Hölder, and convexity inequalities*

*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 19, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
