In mathematics, the Legendre transformation (or Legendre transform), first introduced by Adrien-Marie Legendre in 1787 when studying the minimal surface problem, is an involutive transformation on real-valued functions that are convex on a real variable. Specifically, if a real-valued multivariable function is convex on one of its real independent variables, then the Legendre transform with respect to this variable is applicable to the function.
In physical problems, the Legendre transform is used to convert functions of one quantity (such as position, pressure, or temperature) into functions of the conjugate quantity (momentum, volume, and entropy, respectively). In this way, it is commonly used in classical mechanics to derive the Hamiltonian formalism out of the Lagrangian formalism (or vice versa) and in thermodynamics to derive the thermodynamic potentials, as well as in the solution of differential equations of several variables.
For sufficiently smooth functions on the real line, the Legendre transform of a function can be specified, up to an additive constant, by the condition that the functions' first derivatives are inverse functions of each other. This can be expressed as in Leibniz's notation.
The generalization of the Legendre transformation to affine spaces and non-convex functions is known as the convex conjugate (also called the Legendre–Fenchel transformation), which can be used to construct a function's convex hull.
Definition
Definition in one-dimensional real space Let be an interval, and a convex function; then the Legendre transform of is the function defined by
where denotes the supremum over , e.g., in is chosen such that is maximized at each , or is such that has a bounded value throughout (e.g., when is a linear function).
The function is called the convex conjugate function of . For historical reasons (rooted in analytic mechanics), the conjugate variable is often denoted , instead of . If the convex function is defined on the whole line and is everywhere differentiable, then
can be interpreted as the negative of the -intercept of the tangent line to the graph of that has slope .
Definition in n-dimensional real space The generalization to convex functions on a convex set is straightforward: has domain
and is defined by
where denotes the dot product of and .
The Legendre transformation is an application of the duality relationship between points and lines. The functional relationship specified by can be represented equally well as a set of points, or as a set of tangent lines specified by their slope and intercept values.
Understanding the Legendre transform in terms of derivatives
For a differentiable convex function on the real line with the first derivative and its inverse , the Legendre transform of , , can be specified, up to an additive constant, by the condition that the functions' first derivatives are inverse functions of each other, i.e., and .
To see this, first note that if as a convex function on the real line is differentiable and is a critical point of the function of , then the supremum is achieved at (by convexity, see the first figure in this Wikipedia page). Therefore, the Legendre transform of is .
Then, suppose that the first derivative is invertible and let the inverse be . Then for each , the point is the unique critical point of the function (i.e., ) because and the function's first derivative with respect to at is . Hence we have for each . By differentiating with respect to , we find
Since this simplifies to . In other words, and are inverses to each other.
In general, if as the inverse of then so integration gives , where is a constant.
In practical terms, given the parametric plot of versus amounts to the graph of versus
In some cases (e.g., thermodynamic potentials, below), a non-standard requirement is used, amounting to an alternative definition of with a minus sign,
Definition in physical contexts In analytical mechanics and thermodynamics, the Legendre transformation is usually defined as follows: suppose is a function of ; then we have
Performing the Legendre transformation on this function means that we take as the independent variable, so that the above expression can be written as
and according to the product rule we then have
and taking we have which means
When is a function of variables , then we can perform the Legendre transformation on each one or several variables: we have
where Then if we want to perform the Legendre transformation on, e.g. , then we take together with as independent variables, and with Leibniz's rule we have
So for the function we have
We can also do this transformation for variables . If we do it to all the variables, then we have
where
In analytical mechanics, people perform this transformation on variables of the Lagrangian to get the Hamiltonian:
In thermodynamics, this transformation is applied to variables according to the type of thermodynamic system desired; for example, starting from the energy representation cardinal function of state, the internal energy , we have
so we can perform the Legendre transformation on either or both of to yield
and each of these three expressions has a physical meaning.
This definition of the Legendre transformation is the one originally introduced by Legendre in his work in 1787, and is still applied by physicists nowadays. Indeed, this definition is mathematically rigorous if we treat all the variables and functions defined above (for example, ) as differentiable functions defined on an open set of or on a differentiable manifold, and their differentials (which are treated as cotangent vectors in the context of differentiable manifolds). This definition is equivalent to the modern mathematicians' definition as long as is differentiable and convex for the variables
Properties The Legendre transform of a convex function, of which double derivative values are all positive, is also a convex function of which double derivative values are all positive.Proof. Let us show this with a doubly differentiable function with all positive double derivative values and with a bijective (invertible) derivative. For a fixed , let maximize or make the function bounded over . Then the Legendre transformation of is , thus,by the maximizing or bounding condition . Note that depends on . (This can be visually shown in the 1st figure of this page above.) Thus where , meaning that is the inverse of that is the derivative of (so ). Note that is also differentiable with the following derivative (Inverse function rule),Thus, the Legendre transformation is the composition of differentiable functions, hence it is differentiable. Applying the product rule and the chain rule with the found equality yieldsgiving so is convex with its double derivatives are all positive. The Legendre transformation is an involution, i.e., . Proof. By using the above identities as , , and its derivative , Note that this derivation does not require the condition to have all positive values in double derivative of the original function .
Identities As shown above, for a convex function , with maximizing or making bounded at each to define the Legendre transform and with , the following identities hold.
, , .
Examples
Example 1
Consider the exponential function which has the domain . From the definition, the Legendre transform is
where remains to be determined. To evaluate the supremum, compute the derivative of with respect to and set equal to zero:
The second derivative is negative everywhere, so the maximal value is achieved at . Thus, the Legendre transform is given by
where the expression is defined for . By considering the limit of the expression as or the definition of the transform, we also have , so the domain of is This illustrates that the domains of a function and its Legendre transform can be different.
To find the Legendre transformation of the Legendre transformation of ,
where a variable is intentionally used as the argument of the function to show the involution property of the Legendre transform as We compute
thus the maximum occurs at because the second derivative over the domain of as As a result, is found as
thereby confirming that as expected.
Example 2 Let be defined on , where is a fixed constant.
For fixed, the function of , has the first derivative and second derivative ; there is one stationary point at , which is always a maximum.
Thus, and
The first derivatives of , 2, and of , , are inverse functions to each other. Clearly, furthermore,
namely .
Example 3 Let for .
For fixed, is continuous on compact, hence it always takes a finite maximum on it; it follows that the domain of the Legendre transform of is .
The stationary point at (found by setting that the first derivative of with respect to equal to zero) is in the domain if and only if . Otherwise the maximum is taken either at or because the second derivative of with respect to is negative as ; for a part of the domain the maximum that can take with respect to is obtained at while for it becomes the maximum at . Thus, it follows that
Example 4 The function is convex, for every (strict convexity is not required for the Legendre transformation to be well defined). Clearly is never bounded from above as a function of , unless . Hence is defined on and . (The definition of the Legendre transform requires the existence of the supremum, that requires upper bounds.)
One may check involutivity: of course, is always bounded as a function of , hence . Then, for all one has
and hence .
Example 5 As an example of a convex continuous function that is not everywhere differentiable, consider . This givesand thus on its domain .
Example 6: several variables Let
be defined on , where is a real, positive definite matrix.
Then is convex, and
has gradient and Hessian , which is negative; hence the stationary point is a maximum.
We have , and
Behavior of differentials under Legendre transforms The Legendre transform is linked to integration by parts, .
Let be a function of two independent variables and , with the differential
Assume that the function is convex in for all , so that one may perform the Legendre transform on in , with the variable conjugate to (for information, there is a relation where is a point in maximizing or making bounded for given and ). Since the new independent variable of the transform with respect to is , the differentials and in devolve to and in the differential of the transform, i.e., we build another function with its differential expressed in terms of the new basis and .
We thus consider the function so that
The function is the Legendre transform of , where only the independent variable has been supplanted by . This is widely used in thermodynamics, as illustrated below.
Applications
Analytical mechanics A Legendre transform is used in classical mechanics to derive the Hamiltonian formulation from the Lagrangian formulation, and conversely. A typical Lagrangian has the form
where are coordinates on , is a positive definite real matrix, and
For every fixed, is a convex function of , while plays the role of a constant.
Hence the Legendre transform of as a function of is the Hamiltonian function,
In a more general setting, are local coordinates on the tangent bundle of a manifold . For each , is a convex function of the tangent space . The Legendre transform gives the Hamiltonian as a function of the coordinates of the cotangent bundle ; the inner product used to define the Legendre transform is inherited from the pertinent canonical symplectic structure. In this abstract setting, the Legendre transformation corresponds to the tautological one-form.
Thermodynamics