The Legendre transform is a mathematical transformation that replaces the independent variables of a function with variables representing its slopes. For a differentiable, strictly convex function , it constructs a new function , where is determined by . Its more general form, the Legendre–Fenchel transform, defines as the supremum of , without requiring differentiability or strict convexity. The transformation connects the geometry of convex functions with dual descriptions in optimization, mechanics, and thermodynamics.
Definition
For a function , its Legendre–Fenchel transform, also called its convex conjugate, is
where is the Euclidean inner product. Allowing the value makes it possible to include constraints: setting outside an allowed set excludes those points from the supremum.
The effective domain of consists of the vectors for which this supremum is finite. Even when is finite everywhere, its conjugate need not be.
More generally, if is defined on a real vector space , the conjugate is defined on an appropriate dual space :
Here denotes evaluation of a linear functional, rather than necessarily an inner product. In infinite-dimensional settings, the choice of topology and continuous dual matters.
The terminology is not completely uniform. “Legendre transform” often means the smooth, invertible construction, while “Legendre–Fenchel transform” emphasizes the supremum definition. Many texts use “Legendre transform” for both.
Smooth construction and geometric meaning
Suppose that is differentiable on an open convex domain. An interior maximizer of must satisfy
If is strictly convex, its derivative is strictly increasing, so this equation has at most one solution. For in the derivative’s range, write that solution as . Then
Differentiating gives
Thus the original and transformed functions exchange the roles of position and slope:
Strict convexity ensures uniqueness, but does not by itself guarantee that every real slope occurs.
Geometrically, the tangent line to at , with slope , has equation
The transform therefore records the negative vertical intercept of each supporting tangent line. The same convex curve can be described either by its points or by its supporting lines.
For a differentiable convex function of several variables, the corresponding relation uses the gradient:
If is twice continuously differentiable and its Hessian matrix is positive definite, the gradient map is locally invertible. At corresponding points,
These identities explain why reciprocal response coefficients often appear in dual descriptions.
Examples
Quadratic functions
For
the maximizing condition is , so
More generally, if is a symmetric positive-definite matrix and
then
Conjugation therefore inverts the matrix governing a positive-definite quadratic form.
Exponential function
For the exponential function , the equation gives when . Consequently,
At , the supremum is approached as , but is not attained. Thus a conjugate can have a finite value even when no maximizing point exists.
Absolute value
For ,
This illustrates how the generalized transform handles a function that is neither differentiable everywhere nor strictly convex. An interval of slopes corresponds to the single corner at .
Convex conjugacy and recovery
For each fixed , the expression is affine in . Its supremum is therefore convex. Accordingly, a conjugate is convex even if the original function is not. In finite dimensions it is also lower semicontinuous.
Fenchel–Young inequality
The definition immediately yields
This is the Fenchel–Young inequality. For a proper convex function, equality holds precisely when
where is the subdifferential:
Subgradients generalize slopes at corners. When is differentiable, , recovering the smooth construction.
Biconjugation
Applying conjugation twice gives
The Fenchel–Moreau theorem states that a proper, lower-semicontinuous convex function equals its biconjugate:
Here “proper” means that the function never takes the value and is finite somewhere.
For a nonconvex function that admits a finite affine lower bound, the biconjugate is its greatest lower-semicontinuous convex minorant. Conjugation therefore generally discards nonconvex information: applying the transform twice need not recover the original function.
Role in optimization
Convex conjugates are central to convex optimization and Lagrangian duality. They turn minimization over one variable into an expression involving dual variables.
For example, consider
where is a linear map and are proper convex functions. The associated Fenchel dual problem is
Weak duality holds without requiring equality of the optimal values. Under suitable domain and continuity conditions, strong duality identifies the primal and dual values. Such equality should not be assumed solely because the objective is convex.
Two useful connections are:
If is zero on a nonempty convex set and elsewhere, then
This is the support function of .
If is a norm, its conjugate is zero on the closed unit ball of the dual norm and outside it.
These identities explain why constraints and penalty functions frequently exchange roles in dual formulations.
Classical mechanics
In classical mechanics, the Legendre transform relates a Lagrangian to a Hamiltonian . Positions and time are held fixed while velocities are transformed into momenta:
If the velocity-to-momentum relation can be inverted, then
with the velocities expressed in terms of .
For
one obtains
The Euler–Lagrange equations then become Hamilton’s equations,
A nonsingular velocity Hessian guarantees local invertibility, but does not necessarily make this construction a global convex conjugate. Agreement with the supremum definition requires additional convexity and domain conditions. Singular Lagrangians, including those arising in gauge theories, require a constrained treatment.
Thermodynamics
In thermodynamics, Legendre transformations replace natural variables of a thermodynamic potential with their conjugate quantities.
For a simple compressible system with fixed particle number, internal energy satisfies
where is temperature, is thermodynamic entropy, is pressure, and is volume.
Transforming selected variables produces the familiar potentials:
| Potential | Definition | Differential at fixed particle number |
|---|---|---|
| Helmholtz free energy | ||
| Enthalpy | ||
| Gibbs free energy |
These are partial transformations: only selected independent variables are replaced.
Sign conventions require care. At fixed volume, for example, equilibrium Helmholtz free energy can be written as
It is therefore the negative convex conjugate of with respect to entropy. Thermodynamic transformations are often written as , rather than ; these conventions describe related constructions but cannot be interchanged without adjusting signs.
At phase coexistence, the conjugate-variable relation may cease to be one-to-one. Nondifferentiability and affine regions are then handled more naturally by the Legendre–Fenchel formulation than by ordinary derivative inversion.
Probability and large deviations
For a real random variable , define the logarithmic moment-generating function
where the expectation is finite. Its conjugate is
In large deviations theory, describes the exponential decay of probabilities of atypical sample averages. For independent, identically distributed observations whose moment-generating function is finite in a neighborhood of zero, Cramér’s theorem identifies this conjugate as the rate function.
For a normal distribution with mean and variance ,
Unlike a Fourier transform or a Laplace transform, the Legendre transform is defined by optimization, not by integration. Its connection with integral transforms arises through asymptotic methods in which a dominant exponent is found by maximization.
Historical development and limitations
The transformation is named after Adrien-Marie Legendre, whose work introduced changes between variables and derivatives in the study of differential equations. Its later use in mechanics and thermodynamics made it a standard method for changing descriptions of a system. In the twentieth century, Werner Fenchel developed the generalized conjugate-function framework, which became foundational in convex analysis.
The principal limitations concern invertibility and information loss. A smooth formula based on may fail because a slope is not attained, several points share a slope, or the derivative map is singular. The supremum formulation remains meaningful in these cases, but may produce infinite values or lose nonconvex features. The function’s domain, boundary behavior, convexity, and the chosen sign convention are therefore part of the transformation’s definition, not merely technical details.