The function f(x) is defined on the interval [a, b]. The difference px − f(x) takes a maximum at x'. Thus, f*(p) = px' − f(x').
In mathematics and physics, the Legendre transformation or Legendre transform, named after AdrienMarie Legendre, is an involutive transformation on the realvalued convex functions of one real variable. Its generalization to convex functions of affine spaces is sometimes called the Legendre–Fenchel transformation.
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 g of a function f can be specified, up to an additive constant, by the condition that the functions' first derivatives are inverse functions of each other,

Df = \left( Dg \right)^{1}~.
Contents

Definition 1

Properties 2

Examples 3

Example 1 3.1

Example 2 3.2

Example 3 3.3

Example 4 (many variables) 3.4

An equivalent definition in the differentiable case 4

Behavior of differentials under Legendre transforms 5

Applications 6

Hamilton–Lagrange mechanics 6.1

Thermodynamics 6.2

An example – variable capacitor 6.3

Probability theory 6.4

Geometric interpretation 7

Legendre transformation in more than one dimension 8

Further properties 9

Scaling properties 9.1

Behavior under translation 9.2

Behavior under inversion 9.3

Behavior under linear transformations 9.4

Infimal convolution 9.5

Fenchel's inequality 9.6

See also 10

References 11

Further reading 12

External links 13
Definition
Let I ⊂ R be an interval, and f : I → R a convex function; then its Legendre transform is the function f* : I* → R defined by

f^*(x^*) = \sup_{x\in I}(x^*xf(x)),\quad x^*\in I^*
with domain

I^*= \left \{x^*\in \mathbf{R}:\sup_{x\in I}(x^*xf(x))<\infty \right \} ~.
The transform is always welldefined when f(x) is convex.
The generalization to convex functions f : X → R on a convex set X ⊂ R^{n} is straightforward: f* : X* → R^{n} has domain

X^*= \left \{x^* \in \mathbf{R}^n:\sup_{x\in X}(\langle x^*,x\ranglef(x))<\infty \right \}
and is defined by

f^*(x^*) = \sup_{x\in X}(\langle x^*,x\ranglef(x)),\quad x^*\in X^* ~,
where \langle x^*,x \rangle denotes the dot product of x* and x.
The function f * is called the convex conjugate function of f. For historical reasons (rooted in analytic mechanics), the conjugate variable is often denoted p, instead of x*. If the convex function f is defined on the whole line and is everywhere differentiable, then

f^*(p)=\sup_{x\in I}(pxf(x))
can be interpreted as the negative of the yintercept of the tangent line to the graph of f that has slope p.
The Legendre transformation is an application of the duality relationship between points and lines. The functional relationship specified by f can be represented equally well as a set of (x, y) points, or as a set of tangent lines specified by their slope and intercept values.
Properties
The Legendre transform of a convex function is convex.
Let us show this for the case of a doubly differentiable f with a non zero (and hence positive, due to convexity) double derivative.
For a fixed p, let x maximize px − f(x). Then f *(p) = px − f(x), noting that x depends on p. Thus,

f^\prime(x) = p ~.
The derivative of f is itself differentiable with a positive derivative and hence strictly monotonic and invertible. Thus x = g(p) where g \equiv (f^{\prime})^{1}(p), meaning that g is defined so that f'(g(p))= p.
Note that g is also differentiable with the following derivative,

\frac{dg(p)}{dp} = \frac{1}{f''(g(p))} ~.
Thus f *(p) = pg(p) − f(g(p)) is the composition of differentiable functions, hence differentiable.
Applying the product rule and the chain rule yields

\begin{align} \frac{d(f^{*})}{dp} &= g(p) + \left(p  f'(g(p))\right)\cdot \frac{dg(p)}{dp}\\ & = g(p), \end{align} ~,
giving

\begin{align} \frac{d^2(f^{*})}{dp^2} &= \frac{dg(p)}{dp} \\ &{} = \frac{1}{f''(g(p))} \\ &{} > 0 , \end{align}
so f * is convex.
It follows that the Legendre transformation is an involution, i.e., f ** = f:
By using the above equalities for g(p), f *(p) and its derivative,

\begin{align} f^{**}(x) &{} = {\left(x\cdot p_s  f^{*}(p_s)\right)}_{\frac{d}{dp}f^{*}(p=p_s) = x} \\ &{} = g(p_s)\cdot p_s  f^{*}(p_s) \\ &{} = f(g(p_s)) \\ &{} = f(x)~. \end{align}
Examples
Example 1
Let f(x) = cx^{2} defined on R, where c > 0 is a fixed constant.
For x* fixed, the function x*x – f(x) = x*x – cx^{2} of x has the first derivative x* – 2cx and second derivative −2c; there is one stationary point at x = x*/2c, which is always a maximum. Thus, I* = R and

f^*(x^*)=\frac(xx^*f^*(x^*))=xc,
and hence f **(x) = cx = f(x).
Example 4 (many variables)
Let

f(x)=\langle x,Ax\rangle+c
be defined on X = R^{n}, where A is a real, positive definite matrix. Then f is convex, and

\langle p,x\ranglef(x)=\langle p,x \rangle\langle x,Ax\ranglec,
has gradient p − 2Ax and Hessian −2A, which is negative; hence the stationary point x = A^{−1}p/2 is a maximum. We have X* = R^{n}, and

f^*(p)=\frac14\langle p,A^{1}p\ranglec .
An equivalent definition in the differentiable case
Equivalently, two convex functions f and g defined on the whole line are said to be Legendre transforms of each other if their first derivatives are inverse functions of each other,

Df = \left( Dg \right)^{1}~,
in which case one writes equivalently f * = g and g* = f.
One may see this by first taking the derivative of f *, (with x here understood to denote the point at which the supremum is attained, therefore a function of p),

{df^\star(p) \over dp} = {d \over dp}(xpf(x)) = x + p {dx \over dp}  {df \over dx} {dx \over dp} = x~.
This equation, taken together with the previous equation resulting from the maximization condition, results in the following pair of reciprocal equations,

p = {df \over dx}(x),

x = {df^\star \over dp}(p).
From these, it is evident that Df and Df * are inverses, as stated.
One may exemplify this by considering f(x) = exp x and hence f *(p) = p log p − p.
They are unique, up to an additive constant, which is fixed by the additional requirement that

f(x) + f^\star(p) = x\,p ~,
for any pair (x,p) in the relation above; more explicitly put, with prime denoting derivative

f(x) + f^\star(f'(x)) = x\,f'(x) ~,
and

f^\star(p) + f((f^\star)'(p)) = p ~(f^\star)'(p) ~.
The symmetry of this expression underscores that the Legendre transformation is its own inverse (involutive).
In practical terms, given f(x), the parametric plot of xf '(x) − f(x) versus f '(x) amounts to the graph of g(p) versus p.
In some cases (e.g. thermodynamic potentials, below), a nonstandard requirement is used, amounting to an alternative definition of f * with a minus sign,

f(x)  f^\star(p) = xp.
Behavior of differentials under Legendre transforms
The Legendre transform is linked to integration by parts, pdx = d(px) − xdp.
Let f be a function of two independent variables x and y, with the differential

df = {\partial f \over \partial x}dx + {\partial f \over \partial y}dy = pdx + vdy .
Assume that it is convex in x for all y, so that one may perform the Legendre transform in x, with p the variable conjugate to x. Since the new independent variable is p, the differentials dx and dy devolve to dp and dy, i.e., we build another function with its differential expressed in terms of the new basis dp and dy. We thus consider the function g(p, y) = f − px so that

dg = df  pdx  xdp = xdp + vdy

x = \frac{\partial g}{\partial p}

v = \frac{\partial g}{\partial y}.
The function g(p, y) is the Legendre transform of f(x, y), where only the independent variable x has been supplanted by p. This is widely used in thermodynamics, as illustrated below.
Applications
Hamilton–Lagrange 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

L(v,q)=\tfrac{1}2\langle v,Mv\rangleV(q),
where (v,q) are coordinates on R^{n} × R^{n}, M is a positive real matrix, and

\langle x,y\rangle=\sum_jx_jy_j.
For every q fixed, L(v, q) is a convex function of v, while V(q) plays the role of a constant.
Hence the Legendre transform of L(v, q) as a function of v is the Hamiltonian function,

H(p,q)=\tfrac 12\langle p,M^{1}p\rangle+V(q).
In a more general setting, (v, q) are local coordinates on the tangent bundle T\mathcal M of a manifold \mathcal M. For each q, L(v, q) is a convex function of the tangent space V_{q}. The Legendre transform gives the Hamiltonian H(p, q) as a function of the coordinates (p, q) of the cotangent bundle T^*\mathcal M; the inner product used to define the Legendre transform is inherited from the pertinent canonical symplectic structure.
Thermodynamics
The strategy behind the use of Legendre transforms in thermodynamics is to shift from a function that depends on a variable to a new (conjugate) function that depends on a new variable, the conjugate of the original one. The new variable is the partial derivative of the original function with respect to the original variable. The new function is the difference between the original function and the product of the old and new variables. Typically, this transformation is useful because it shifts the dependence of, e.g., the energy from an extensive variable to its conjugate intensive variable, which can usually be controlled more easily in a physical experiment.
For example, the internal energy is an explicit function of the extensive variables entropy, volume, and chemical composition

U = U \left (S,V,\{N_i\} \right ),
which has a total differential

dU = TdS  PdV + \sum \mu _i dN _i.
By using the (non standard) Legendre transform of the internal energy, U, with respect to volume, V, it is possible to define the enthalpy as

H = U + PV \, = H \left (S,P,\{N_i\} \right ),
which is an explicit function of the pressure, P. The enthalpy contains all of the same information as the internal energy, but is often easier to work with in situations where the pressure is constant.
It is likewise possible to shift the dependence of the energy from the extensive variable of entropy, S, to the (often more convenient) intensive variable T, resulting in the Helmholtz and Gibbs free energies. The Helmholtz free energy, A, and Gibbs energy, G, are obtained by performing Legendre transforms of the internal energy and enthalpy, respectively,

A = U  TS ~,

G = H  TS = U + PV  TS ~.
The Helmholtz free energy is often the most useful thermodynamic potential when temperature and volume are held constant, while the Gibbs energy is often the most useful when temperature and pressure are held constant.
An example – variable capacitor
As another example from physics, consider a parallelplate capacitor, in which the plates can move relative to one another. Such a capacitor would allow transfer of the electric energy which is stored in the capacitor into external mechanical work, done by the force acting on the plates. One may think of the electric charge as analogous to the "charge" of a gas in a cylinder, with the resulting mechanical force exerted on a piston.
Compute the force on the plates as a function of x, the distance which separates them. To find the force, compute the potential energy, and then apply the definition of force as the gradient of the potential energy function.
The energy stored in a capacitor of capacitance C(x) and charge Q is

U (Q, \mathbf{x}) = \frac{1}{2} QV = \frac{1}{2} \frac{Q^2}{C(\mathbf{x})}~ ,
where the dependence on the area of the plates, the dielectric constant of the material between the plates, and the separation x are abstracted away as the capacitance C(x). (For a parallel plate capacitor, this is proportional to the area of the plates and inversely proportional to the separation.)
The force F between the plates due to the electric field is then

\mathbf{F}(\mathbf{x}) = \frac{dU}{d\mathbf{x}} ~.
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

\mathbf{F}(\mathbf{x}) = \frac{1}{2} \frac{dC}{d\mathbf{x}} \frac{Q^2}{C^2}.
However, suppose, instead, that the voltage between the plates V 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 nonstandard Legendre transform,

U^* = U  \left(\frac{\partial U}{\partial Q} \right)\bigg_\mathbf{x} \cdot Q =U  \frac{1}{2C(\mathbf{x})} \left( \frac{\partial Q^2}{\partial Q} \right)\bigg_\mathbf{x} \cdot Q = U  QV = \frac{1}{2} QV  QV = \frac{1}{2} QV=  \tfrac{1}{2} V^2 C(\mathbf{x}).
The force now becomes the negative gradient of this Legendre transform, still pointing in the same direction,

\mathbf{F}(\mathbf{x}) = \frac{dU^*}{d\mathbf{x}}~.
The two conjugate energies happen to stand opposite to each other, only because of the linearity of the capacitance—except now Q 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.
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 welldefined 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 p and yintercept b is given by y = px + b. For this line to be tangent to the graph of a function f at the point (x_{0}, f(x_{0})) requires

f\left(x_0\right) = p x_0 + b
and

p = \dot{f}\left(x_0\right).
f' is strictly monotone as the derivative of a strictly convex function. The second equation can be solved for x_{0}, allowing elimination of x_{0} from the first, giving the yintercept b of the tangent as a function of its slope p,

b = f\left(\dot{f}^{1}\left(p\right)\right)  p \cdot \dot{f}^{1}\left(p\right) = f^\star(p).
Here, f^\star denotes the Legendre transform of f.
The family of tangents of the graph of f parameterized by p is therefore given by

y = px  f^\star(p) ,
or, written implicitly, by the solutions of the equation

F(x,y,p) = y + f^\star(p)  px = 0~.
The graph of the original function can be reconstructed from this family of lines as the envelope of this family by demanding

{\partial F(x,y,p)\over\partial p} = \dot{f}^\star(p)  x = 0~.
Eliminating p from these two equations gives

y = x \cdot \dot{f}^{\star1}(x)  f^\star\left(\dot{f}^{\star1}(x)\right).
Identifying y with f(x) and recognizing the right side of the preceding equation as the Legendre transform of f*, yields

f(x) = f^{\star\star}(x) ~.
Legendre transformation in more than one dimension
For a differentiable realvalued function on an open subset U of R^{n} the Legendre conjugate of the pair (U, f) is defined to be the pair (V, g), where V is the image of U under the gradient mapping Df, and g is the function on V given by the formula

g(y) = \left\langle y, x \right\rangle  f(x), \qquad x = \left(Df\right)^{1}(y)
where

\left\langle u,v\right\rangle = \sum_{k=1}^{n}u_{k} \cdot v_{k}
is the scalar product on R^{n}. The multidimensional transform can be interpreted as an encoding of the convex hull of the function's epigraph in terms of its supporting hyperplanes.^{[1]}
Alternatively, if X is a vector space and Y is its dual vector space, then for each point x of X and y of Y, there is a natural identification of the cotangent spaces T*X_{x} with Y and T*Y_{y} with X. If f is a real differentiable function over X, then ∇f is a section of the cotangent bundle T*X and as such, we can construct a map from X to Y. Similarly, if g is a real differentiable function over Y, ∇g defines a map from Y to X'. If both maps happen to be inverses of each other, we say we have a Legendre transform.
When the function is not differentiable, the Legendre transform can still be extended, and is known as the LegendreFenchel 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).
Further properties
Scaling properties
The Legendre transformation has the following scaling properties: For a > 0,

f(x) = a \cdot g(x) \Rightarrow f^\star(p) = a \cdot g^\star\left(\frac{p}{a}\right)

f(x) = g(a \cdot x) \Rightarrow f^\star(p) = g^\star\left(\frac{p}{a}\right).
It follows that if a function is homogeneous of degree r then its image under the Legendre transformation is a homogeneous function of degree s, where 1/r + 1/s = 1. (Since f(x) = x^{r}/r, with r > 1, implies f*(p) = p^{s}/s.) Thus, the only monomial whose degree is invariant under Legendre transform is the quadratic.
Behavior under translation

f(x) = g(x) + b \Rightarrow f^\star(p) = g^\star(p)  b

f(x) = g(x + y) \Rightarrow f^\star(p) = g^\star(p)  p \cdot y
Behavior under inversion

f(x) = g^{1}(x) \Rightarrow f^\star(p) =  p \cdot g^\star\left(\frac{1}{p}\right)
Behavior under linear transformations
Let A : R^{n} → R^{m} be a linear transformation. For any convex function f on R^{n}, one has

(A f)^\star = f^\star A^\star
where A* is the adjoint operator of A defined by

\left \langle Ax, y^\star \right \rangle = \left \langle x, A^\star y^\star \right \rangle,
and Af is the pushforward of f along A

(A f)(y) = \inf\{ f(x) : x \in X , A x = y \}.
A closed convex function f is symmetric with respect to a given set G of orthogonal linear transformations,

f(A x) = f(x), \; \forall x, \; \forall A \in G
if and only if f* is symmetric with respect to G.
Infimal convolution
The infimal convolution of two functions f and g is defined as

\left(f \star_\inf g\right)(x) = \inf \left \{ f(xy) + g(y) \,  \, y \in \mathbf{R}^n \right \}.
Let f_{1}, ..., f_{m} be proper convex functions on R^{n}. Then

\left( f_1 \star_\inf \cdots \star_\inf f_m \right)^\star = f_1^\star + \cdots + f_m^\star.
Fenchel's inequality
For any function f and its convex conjugate f* Fenchel's inequality (also known as the Fenchel–Young inequality) holds for every x ∈ X and p ∈ X*, i.e., independent x, p pairs,

\left\langle p,x \right\rangle \le f(x) + f^\star(p).
See also
References

^ http://maze5.net/?page_id=733



Fenchel, W. (1949). "On conjugate convex functions", Canad. J. Math 1: 7377.


Zia, R. K. P.; Redish, E. F.; McKay, S. R. (2009). "Making sense of the Legendre transform". American Journal of Physics 77 (7): 614.
Further reading

Touchette, Hugo (20050727). "LegendreFenchel transforms in a nutshell" (PDF). Retrieved 20140915.

Touchette, Hugo (20061121). "Elements of convex analysis" (PDF). Retrieved 20131013.
External links

Legendre transform with figures at maze5.net

Legendre and LegendreFenchel transforms in a stepbystep explanation at onmyphd.com
This article was sourced from Creative Commons AttributionShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, EGovernment Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a nonprofit organization.