Legendre transformation

In mathematics and physics, the Legendre transformation, named after Adrien-Marie Legendre, is an involutive transformation on the real-valued convex functions of one real variable. In physical problems, it 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 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 formula_1 of a function formula_2 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 in Euler's derivative notation as
or, equivalently, as formula_6 and formula_7 in Lagrange'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.
Let formula_8 be an interval, and formula_9 a convex function; then its "Legendre transform" is the function formula_10 defined by
where formula_12 denotes the supremum, and the domain formula_13 is
The transform is always well-defined when formula_15 is convex.
The generalization to convex functions formula_16 on a convex set formula_17 is straightforward: formula_18 has domain
and is defined by
where formula_21 denotes the dot product of formula_22 and formula_23.
The function formula_1 is called the convex conjugate function of formula_2. For historical reasons (rooted in analytic mechanics), the conjugate variable is often denoted formula_26, instead of formula_22. If the convex function formula_2 is defined on the whole line and is everywhere differentiable, then
can be interpreted as the negative of the formula_30-intercept of the tangent line to the graph of formula_2 that has slope formula_26.
The Legendre transformation is an application of the duality relationship between points and lines. The functional relationship specified by formula_2 can be represented equally well as a set of formula_34 points, or as a set of tangent lines specified by their slope and intercept values.
Understanding the transform in terms of derivatives.
For a differentiable convex function formula_2
on the real line with an invertible first derivative, the Legendre transform formula_36
can be specified, up to an additive constant, by the condition that the functions' first 
derivatives are inverse functions of each other. Explicitly, for a differentiable convex function formula_2 on the real line with a first derivative formula_38 with inverse formula_39, the Legendre transform formula_36 (with derivative formula_41 with inverse formula_42) can be specified, up to an additive constant, by the condition that formula_38 and formula_44 are inverse functions of each other, "i.e.", formula_45 and formula_46.
To see this, first note that if formula_47 is differentiable and formula_48 is a critical point
of the function of formula_49, then the
supremum is achieved at formula_50 (by convexity). 
Therefore, formula_51.
Suppose that formula_38 is invertible and let formula_53 denote its inverse.
Then for each formula_54, the point formula_55 is the unique critical point of
formula_56. Indeed, formula_57 and so formula_58.
Hence we have formula_59 for each formula_54. 
By differentiating with respect to formula_54 we find 
Since formula_63 this simplifies to formula_64.
In other words, formula_41 and formula_38 are inverses.
In general, if formula_67 is an inverse of formula_68, then formula_69 
and so integration provides a constant formula_70 so that formula_71.
In practical terms, given formula_15, the parametric plot of formula_73 versus formula_74 amounts to the graph of formula_75 versus formula_26.
In some cases (e.g. thermodynamic potentials, below), a non-standard requirement is used, amounting to an alternative definition of with a "minus sign",
Examples.
Example 1.
The exponential function formula_101 has formula_102
as a Legendre transform, since their respective first derivatives and are inverse functions of each other.
This example illustrates that the respective domains of a function and its Legendre transform need not agree.
Example 2.
Let 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
If the capacitor is not connected to any circuit, then the "charges" on the plates remain constant as they move, and the force is the negative gradient of the electrostatic energy
However, suppose, instead, that the "voltage" between the plates is maintained constant by connection to a battery, which is a reservoir for charge at constant potential difference; now the "charge is variable" instead of the voltage, its Legendre conjugate. To find the force, first compute the non-standard Legendre transform,
The force now becomes the negative gradient of this Legendre transform, still pointing in the same direction,
The two conjugate energies happen to stand opposite to each other, only because of the linearity of the capacitance—except now is no longer a constant. They reflect the two different pathways of storing energy into the capacitor, resulting in, for instance, the same "pull" between a capacitor's plates.
Probability theory.
In large deviations theory, the "rate function" is defined as the Legendre transformation of the logarithm of the moment generating function of a random variable. An important application of the rate function is in the calculation of tail probabilities of sums of i.i.d. random variables.
Microeconomics.
Legendre transformation arises naturally in microeconomics in the process of finding the "supply" of some product given a fixed price on the market knowing the cost function , i.e. the cost for the producer to make/mine/etc. units of the given product.
A simple theory explains the shape of the supply curve based solely on the cost function. Let us suppose the market price for a one unit of our product is . For a company selling this good, the best strategy is to adjust the production so that its profit is maximized. We can maximize the profit
by differentiating with respect to and solving
 represents the optimal quantity of goods that the producer is willing to supply, which is indeed the supply itself:
If we consider the maximal profit as a function of price, formula_110, we see that it is the Legendre transform of the cost function formula_111.
Geometric interpretation.
For a strictly convex function, the Legendre transformation can be interpreted as a mapping between the graph of the function and the family of tangents of the graph. (For a function of one variable, the tangents are well-defined at all but at most countably many points, since a convex function is differentiable at all but at most countably many points.)
The equation of a line with slope formula_26 and formula_30-intercept formula_114 is given by formula_115 For this line to be tangent to the graph of a function formula_2 at the point formula_117 requires
and
Being the derivative of a strictly convex function, the function formula_120 is strictly monotone and thus injective. The second equation can be solved for formula_121 allowing elimination of formula_122 from the first, and solving for the formula_30-intercept formula_114 of the tangent as a function of its slope formula_125
where formula_127 denotes the Legendre transform of formula_128
The family of tangent lines of the graph of formula_2 parameterized by the slope formula_26 is therefore given by
or, written implicitly, by the solutions of the equation
The graph of the original function can be reconstructed from this family of lines as the envelope of this family by demanding
Eliminating formula_26 from these two equations gives
Identifying formula_30 with formula_15 and recognizing the right side of the preceding equation as the Legendre transform of formula_138 yields
Legendre transformation in more than one dimension.
For a differentiable real-valued function on an open subset of the Legendre conjugate of the pair is defined to be the pair , where is the image of under the gradient mapping , and is the function on given by the formula
where
is the scalar product on . The multidimensional transform can be interpreted as an encoding of the convex hull of the function's epigraph in terms of its supporting hyperplanes.
Alternatively, if is a vector space and is its dual vector space, then for each point of and of , there is a natural identification of the cotangent spaces with and with . If is a real differentiable function over , then its exterior derivative, , is a section of the cotangent bundle and as such, we can construct a map from to . Similarly, if is a real differentiable function over , then defines a map from to . If both maps happen to be inverses of each other, we say we have a Legendre transform. The notion of the tautological one-form is commonly used in this setting.
When the function is not differentiable, the Legendre transform can still be extended, and is known as the Legendre-Fenchel transformation. In this more general setting, a few properties are lost: for example, the Legendre transform is no longer its own inverse (unless there are extra assumptions, like convexity).
Legendre transformation on manifolds.
Let formula_142 be a smooth manifold, let formula_143 be a vector bundle, and let formula_144 be a smooth function. We think of formula_145 as a Lagrangian by analogy with the classical case where formula_146, formula_147 and formula_148 for some positive number formula_149 and function formula_150.
As usual, we denote by formula_151 the dual of formula_152, by formula_153 the fiber of formula_154 over formula_155, and by formula_156 the restriction of formula_145 to formula_153.
The "Legendre transformation" of formula_145 is the smooth morphism formula_160 defined by formula_161, where formula_162.
In other words, formula_163 is the covector that sends formula_164 to the directional derivative formula_165.
To describe the Legendre transformation locally, let formula_166 be a coordinate chart over which formula_152 is trivial. Picking a trivialization of formula_152 over formula_169, we obtain charts formula_170 and formula_171. In terms of these charts, we have formula_172, where formula_173 for all formula_174.
If, as in the classical case, the restriction of formula_144 to each fiber formula_153 is strictly convex and bounded below by a positive definite quadratic form minus a constant, then the Legendre transform formula_177 is a diffeomorphism. Suppose that formula_178 is a diffeomorphism and let formula_179 be the “Hamiltonian” function defined by formula_180 where formula_181. Using the natural isomorphism formula_182, we may view the Legendre transformation of formula_183 as a map formula_184. Then we have formula_185
Further properties.
Scaling properties.
The Legendre transformation has the following scaling properties: For ,
It follows that if a function is homogeneous of degree then its image under the Legendre transformation is a homogeneous function of degree , where . (Since , with , implies .) Thus, the only monomial whose degree is invariant under Legendre transform is the quadratic.
Behavior under linear transformations.
Let be a linear transformation. For any convex function on , one has
where is the adjoint operator of defined by
and is the "push-forward" of along 
A closed convex function is symmetric with respect to a given set of orthogonal linear transformations,
if and only if is symmetric with respect to .
Infimal convolution.
The infimal convolution of two functions and is defined as
Let be proper convex functions on . Then
Fenchel's inequality.
For any function and its convex conjugate "Fenchel's inequality" (also known as the "Fenchel–Young inequality") holds for every and , i.e., "independent" pairs,