
In the landscape of mathematical analysis, the concepts of convexity and concavity play a central role. They shape how we understand optimisation, economics, geometry, and even numerical methods. This guide offers a clear, reader‑friendly exploration of convex and concave functions, including definitions, visual intuition, key properties, and practical applications. Whether you are a student laying the foundations or a practitioner applying these ideas to real problems, you will find structured explanations, worked examples, and tips for recognising convexity and concavity in diverse contexts.
What Are Convex and Concave Functions?
Convex and concave functions describe how a function curves when plotted as a graph. Intuitively, a convex function lies below its chords, while a concave function lies above its chords. More formally:
- Convex function: A function f defined on an interval I is convex if, for any x, y in I and any θ in [0, 1],
f(θx + (1 − θ)y) ≤ θf(x) + (1 − θ)f(y). - Concave function: A function f defined on an interval I is concave if, for any x, y in I and any θ in [0, 1],
f(θx + (1 − θ)y) ≥ θf(x) + (1 − θ)f(y).
These definitions capture the essence of “no dents” and “no undue bumps” in a function’s graph. If a function satisfies the convex inequality for every pair of points, it is convex; if it satisfies the concave inequality, it is concave. A function can be both convex and concave if and only if it is affine (a linear function plus a constant). In that special case, the graph is a straight line, and the function is simultaneously convex and concave.
Visual Intuition: Graphs and Shapes
Graphical intuition helps when you first encounter convex and concave functions. A graph of a convex function curves upwards like a bowl. The segment between any two points on the graph lies above or on the graph itself. By contrast, a concave function curves downwards like a cap. The segment between any two points on the graph lies below or on the graph.
In higher dimensions, convexity extends to sets and to functions of several variables. A convex function f: R^n → R has the property that its epigraph—the set of points lying on or above the graph, formally {(x, t) : t ≥ f(x)}—is a convex set. This geometric view connects the ideas of shape and feasibility, which is particularly important in optimisation.
Key Characterisations: Derivatives, Slopes, and Second Derivatives
While the definitions above are conceptually straightforward, powerful characterisations exist for differentiable functions. These tools make it easier to recognise convexity or concavity in practice:
Second Derivative Test (twice differentiable functions)
- If f is twice differentiable on an interval and f”(x) ≥ 0 for all x in the interval, then f is convex on that interval.
- If f is twice differentiable on an interval and f”(x) ≤ 0 for all x in the interval, then f is concave on that interval.
- If f”(x) > 0 on an interval, the function is strictly convex there; if f”(x) < 0, the function is strictly concave.
These criteria bridge the intuitive curvature picture with precise mathematical statements. They also justify why many common functions, such as x^2 (convex) and −x^2 (concave), behave as expected.
First Derivative and Monotonicity of the Gradient
- For convex functions, the first derivative, when it exists, is monotonically nondecreasing. That is, the slope of the tangent line never decreases as you move along the domain.
- For concave functions, the first derivative, when it exists, is monotonically nonincreasing.
These properties are particularly useful in optimisation: a convex function has a unique global minimiser (under mild conditions), and finding it often reduces to locating a stationary point where the derivative is zero or using subgradients in non-differentiable cases.
Examples of Convex and Concave Functions
Understanding concrete instances helps solidify the concepts. Here are representative examples and quick verifications:
Convex Functions
- x^2: The parabola opens upwards; the second derivative is 2 > 0, hence convex.
- e^x: The graph curves upwards with all tangent lines lying below the graph; f”(x) = e^x > 0.
- a x^2 + b x + c with a > 0: Positive definite quadratic forms are convex; f”(x) = 2a > 0.
- Norms: The Euclidean norm ||x||_2 is convex as a function from R^n to R.
Concave Functions
- −x^2: The parabola opens downward; f”(x) = −2 < 0, hence concave.
- log x on (0, ∞): The second derivative is −1/x^2 < 0, so log x is concave on its domain.
- Affine functions: f(x) = ax + b are both convex and concave, illustrating the special case where a function is affine.
Operations and Preservation of Convexity
One of the reasons convexity is so useful in optimisation is that several operations preserve convexity. Understanding these rules helps identify convexity in complex models and ensures that optimisation tasks remain tractable.
Sum and Positive Scaling
- The sum of two convex functions is convex. If f and g are convex, then h(x) = f(x) + g(x) is convex.
- Nonnegative scalar multiplication preserves convexity: If α ≥ 0 and f is convex, then αf is convex.
- Consequently, linear combinations with nonnegative coefficients of convex functions remain convex.
Composition with Affine Mappings
- If f is convex and A is an affine map (A x = B x + c), then the composition f ∘ A is convex in the domain of x.
- Affine transformations do not alter convexity; they simply reparameterise the input space.
Preservation Under Pointwise Maximum
- The pointwise maximum of a finite collection of convex functions is convex. This is a standard construction used in modelling and optimisation.
Convexity vs Concavity under Minimisation and Maximisation
When minimising a convex function, any local minimum is a global minimum. Conversely, maximising a concave function shares the analogous property: any local maximum is a global maximum. These aspects underpin the efficiency of convex optimisation methods and explain why convexity is prized in algorithm design.
Jensen’s Inequality and Practical Consequences
Jensen’s inequality is a fundamental result that ties convexity to expectations and averages. If f is convex and X is a random variable with finite expected value, then
E[f(X)] ≥ f(E[X]).
For concave functions the inequality reverses. In optimisation, Jensen’s inequality provides bounds useful in analysis, risk assessment, and economic modelling. It explains why diversification can reduce risk under convex loss functions and how concavity affects risk sharing in economics.
Convexity and Concavity in Multivariable Functions
When extending to several variables, the definitions remain conceptually similar but require the straight-line condition to hold for all pairs of points in the domain. For a function f: R^n → R, convexity means that for all x, y in the domain and all θ in [0, 1],
f(θx + (1 − θ)y) ≤ θf(x) + (1 − θ)f(y).
In higher dimensions, convexity also connects to the idea of convex sets: a set C is convex if, for any x, y in C and θ in [0, 1], the point θx + (1 − θ)y lies in C. This geometric notion complements the analytic view of convex functions and is central to areas such as optimisation, machine learning, and computational geometry.
Practical Applications Across Fields
Convex and concave functions appear in a wide range of disciplines. Here are several notable applications, illustrating how these concepts drive efficient modelling and robust decision making.
Operations Research and Robust Optimisation
Convex models are favoured because they guarantee global optimality and allow efficient algorithms. Problems such as resource allocation, scheduling, and transport optimisation often cast cost functions as convex, enabling reliable convergence to the best solution even in large-scale systems.
Economics, Utility, and Risk
In economics, concave utility functions reflect diminishing marginal utility, a fundamental principle. Convexity is tied to risk aversion in loss functions and in portfolio optimisation, where convex loss functions ensure tractable minimisation and well‑behaved risk assessments. Jensen’s inequality also features prominently in price and risk aggregation.
Machine Learning and Data Fitting
Convex loss functions, such as the squared loss or logistic loss, yield convex optimisation problems that are solvable efficiently and reliably. Many algorithms exploit convexity to guarantee convergence to a global optimum. In high-dimensional data analysis, convex penalties (L1, L2) promote desirable properties like sparsity and smoothness, while preserving tractable optimisation landscapes.
Engineering and Numerical Methods
Algorithms for signal processing, control, and structural optimisation frequently rely on convex formulations. Convexity ensures stable numerical behaviour and predictable convergence, which is especially valuable in simulations and iterative solvers.
Common Misconceptions and Clarity on Special Cases
As with many mathematical concepts, there are common misconceptions about convexity and concavity. Clearing them up helps avoid errors in modelling and analysis.
- Every linear function is both convex and concave. True, because affine functions satisfy both inequalities with equality. This makes them a special, edge case in the broader theory.
- All non‑linear convex functions are smooth. Not necessarily. Convexity allows sharp corners or non-differentiable points (for example, the absolute value function f(x) = |x| is convex but not differentiable at x = 0).
- A concave function is always the negative of a convex function. Yes, concave f is equivalent to −g where g is convex. This dual relationship can simplify proofs and reasoning.
Testing for Convexity in Practice
Practical testing of convexity involves a mix of analytic checks, numerical experiments, and structural insights from the problem at hand. Here are reliable strategies to determine whether a function is convex or concave.
Analytical Checks
- Twice differentiable: examine the sign of f”(x). If f”(x) ≥ 0 for all x in the domain, the function is convex; if f”(x) ≤ 0, it is concave.
- First derivative monotonicity: if f’ exists, check whether f’ is nondecreasing (convex) or nonincreasing (concave).
- Epigraph and hypograph tests: verify that the set {(x, t) : t ≥ f(x)} is convex (epigraph) for convexity; equivalently, the set {(x, t) : t ≤ f(x)} should be convex for concavity.
Non-Differentiable Functions
- Subgradients: a function is convex if, at every x, there exists a subgradient g such that f(y) ≥ f(x) + g·(y − x) for all y. If such subgradients exist everywhere, convexity holds. Concavity uses the reverse inequality.
- Piecewise linear functions: many piecewise linear functions are convex if their segments lie above the convex hull of their breakpoints; the maximum of a finite set of affine functions is a classic convex example.
Numerical Tests for Practice
- Graphical checks on a fine grid: plot the function and visually inspect the curvature and chord behaviour.
- Chapeau test with multiple points: test the convex inequality at several pairs (x, y) and θ values to gain confidence, especially when derivatives are unknown.
Higher Dimensions: Why Multivariable Convexity Matters
In many real-world problems, variables are multi‑dimensional. The concepts extend to functions f: R^n → R and to sets in R^n. Convexity in multiple dimensions ensures that line segments between any two feasible points stay within the feasible region. This property is critical for the effectiveness of gradient methods, interior‑point methods, and other advanced optimisation techniques. When dealing with constraints, convex programming focuses on problems where the objective function is convex and the feasible set is convex, guaranteeing tractable global solutions.
Convex and Concave Functions in Real-Life Modelling
The language of convexity and concavity is not limited to pure mathematics. Researchers and practitioners use these concepts to model risk, performance, and resource limitations in real life. For instance, a loss function in predictive modelling is typically convex to ensure that optimization finds a unique best estimate. In economics, concave utility functions reflect diminishing marginal utility, helping to describe consumer behaviour and welfare analyses. The interplay between convex and concave functions informs algorithm design, allowing for robust, efficient solutions even when datasets are noisy or high‑dimensional.
Common Pitfalls and How to Avoid Them
When applying the ideas of convex and concave functions, be mindful of common pitfalls that can obscure the correct classification or lead to suboptimal modelling choices.
- Assuming convexity from a property that only holds on a subset of the domain. Convexity is a global property; a function may be convex on one interval but not on another.
- Overlooking non-differentiable points. A function can be convex despite having corners or sharp turns; derivative tests may fail there, but subgradient methods remain valid.
- Confusing local curvature with global convexity. Local convexity does not guarantee global convexity; the entire domain must satisfy the convexity condition.
Building Intuition: A Short Catalogue of Convexity Facts
To help you navigate the landscape quickly, here is a short catalogue of practical truths about convexity and concavity:
- Affine functions are both convex and concave—this is a special case that often appears as a boundary condition in problems.
- The sum, integral, and pointwise maximum of convex functions are convex, providing a toolkit for constructing complex models with guaranteed convexity.
- Nonpositive curvature in the graph (concave) implies that midpoints of chords lie above the graph; for convex, midpoints lie below the graph.
- Convexity interacts nicely with optimisation: convex problems have no spurious local minima, making them easier to solve reliably.
Putting It All Together: A Step‑by‑Step Approach to Convexity in Your Models
When you face a modelling task and want to determine whether convexity or concavity helps, follow these steps:
- Identify the domain of the function and the objective of your optimisation.
- Check for affine invariance: can you apply an affine transformation without altering the problem’s structure?
- Assess derivative information: if available, use the second derivative test or monotonicity of the gradient.
- Consider combining functions with known convexity properties: the sum of convex functions and nonnegative scalings preserve convexity.
- Use Jensen’s inequality to obtain bounds that may simplify analysis or provide risk assessments.
- When in doubt, explore numeric surrogates: test convex inequalities on representative samples to gain confidence.
Conclusion: The Power and Practicality of Convex and Concave Functions
The concepts of convex and concave functions form a cornerstone of modern mathematical thinking. They provide clear criteria for when optimisations are tractable, offer geometric and analytic intuition, and connect to a broad spectrum of applications in science, engineering, and economics. By recognising convexity and concavity—whether through second derivatives, derivative monotonicity, or constructive properties like the preservation under addition and composition—you gain a robust framework for modelling, analysis, and solution strategies. Remember: the elegance of convexity lies not only in the sharp mathematical statements but also in the reliable, global insights it yields for complex problems.