# Legendre transformation

The Legendre transformation (according to Adrien-Marie Legendre ) belongs to the touch transformations and serves as an important mathematical method for the transformation of variables .

A generalization of the Legendre transform to general spaces and non-convex functions is the convex conjugate .

## definition

### In one variable

Let be a convex function of a real variable. The Legendre transform is then defined as ${\ displaystyle f \ colon D \ subseteq \ mathbb {R} \ to \ mathbb {R}}$${\ displaystyle f ^ {*} \ colon D ^ {*} \ to \ mathbb {R}}$

${\ displaystyle f ^ {*} (u) = \ sup _ {x \ in D} (ux-f (x)), \ quad u \ in D ^ {*}: = \ left \ {u \ in \ mathbb {R}: \ sup _ {x \ in D} (ux-f (x)) <\ infty \ right \}}$

It is with the supremum meant. ${\ displaystyle \ sup}$

For a differentiable convex function with an invertible first derivative, the supremum can be evaluated using means from elementary analysis. The function assumes an absolute maximum because of the concavity of at the (unambiguous) point where the derivative is. It follows that the supremum in is accepted at this point. Thus: ${\ displaystyle f \ colon D \ subseteq \ mathbb {R} \ to \ mathbb {R}}$${\ displaystyle x \ mapsto ux-f (x)}$${\ displaystyle ux-f (x)}$${\ displaystyle 0}$${\ displaystyle x (u) = (f ') ^ {- 1} (u)}$${\ displaystyle f ^ {*}}$

${\ displaystyle f ^ {*} (u) = ux (u) -f (x (u)) = u \, (f ') ^ {- 1} (u) -f ((f') ^ {- 1} (u))}$

### In several variables

Similar to one dimension, the Legendre transformation can also be defined in higher dimensions. Let be convex and be a convex function. Then the Legendre transform with definition set and standard scalar product is defined as ${\ displaystyle X \ subset \ mathbb {R} ^ {n}}$${\ displaystyle f \ colon X \ to \ mathbb {R}}$${\ displaystyle f ^ {*} \ colon D ^ {*} \ to \ mathbb {R}}$${\ displaystyle D ^ {*}: = \ left \ {u \ in \ mathbb {R} ^ {n}: \ sup _ {x \ in D} (\ langle u, x \ rangle -f (x)) <\ infty \ right \}}$ ${\ displaystyle \ langle \ cdot, \ cdot \ rangle}$

${\ displaystyle f ^ {*} (u) = \ sup _ {x \ in D} (\ langle u, x \ rangle -f (x)), \ quad u \ in D ^ {*}}$

## Geometric meaning

Illustrative representation of the Legendre transformation

Geometrically, the situation can be illustrated as in the figure: Instead of specifying the set of points that make up it, the curve (red) can also be characterized by the set of all tangents that surround it. This is exactly what happens with the Legendre transformation. The transform assigns the slope of each tangent to its y-axis intercept . So it is a description of the same curve - only via a different parameter, namely instead . ${\ displaystyle f ^ {*} (u) = ux (u) -f (x (u))}$${\ displaystyle u}$${\ displaystyle u}$${\ displaystyle x}$

## Examples

• The function is given . Then , so${\ displaystyle f (x) = x ^ {2} +1}$${\ displaystyle u = f '(x) = 2x}$
${\ displaystyle x (u) = (f ') ^ {- 1} (u) = {\ frac {u} {2}}}$.
As a Legendre transform of, this results in ${\ displaystyle f ^ {*}}$${\ displaystyle f}$
${\ displaystyle f ^ {*} (u) = ux (u) -f (x (u)) = {\ frac {u ^ {2}} {2}} - \ left ({\ frac {u ^ { 2}} {4}} + 1 \ right) = {\ frac {u ^ {2}} {4}} - 1}$.
• The following applies to the exponential function ${\ displaystyle f (x) = e ^ {x}}$${\ displaystyle u = f '(x) = e ^ {x}}$
${\ displaystyle x (u) = (f ') ^ {- 1} (u) = \ ln (u)}$.
As a Legendre transform of, this results in ${\ displaystyle f ^ {*}}$${\ displaystyle f}$
${\ displaystyle f ^ {*} (u) = ux (u) -f (x (u)) = u \ ln (u) -u}$
for .${\ displaystyle u> 0}$
• A symmetrical and positively definite matrix is ​​given . Then the quadratic form defined by is a convex function. The function defined by with has the gradient and the negative definite Hessian matrix . The function therefore assumes its uniquely determined global maximum at this point, i. H. for the Legendre transform of true${\ displaystyle A \ in \ mathbb {R} ^ {n \ times n}}$${\ displaystyle A}$ ${\ displaystyle f \ colon \ mathbb {R} ^ {n} \ to \ mathbb {R}}$${\ displaystyle f (x) = \ langle x, Ax \ rangle}$${\ displaystyle g (x) = \ langle u, x \ rangle -f (x)}$${\ displaystyle u \ in \ mathbb {R} ^ {n}}$ ${\ displaystyle u-2Ax}$ ${\ displaystyle -2A}$${\ displaystyle g}$${\ displaystyle x = {\ tfrac {1} {2}} A ^ {- 1} u}$${\ displaystyle f ^ {*}}$${\ displaystyle f}$
${\ displaystyle f ^ {*} (u) = \ sup _ {x \ in \ mathbb {R} ^ {n}} (\ langle u, x \ rangle -f (x)) = g \ left ({\ tfrac {1} {2}} A ^ {- 1} u \ right) = {\ tfrac {1} {4}} \ langle u, A ^ {- 1} u \ rangle}$.

## When dependent on several variables

The change in the dependence of a function on one independent variable on another by means of a partial derivative of after is: ${\ displaystyle f (x, y)}$${\ displaystyle x}$${\ displaystyle u}$${\ displaystyle f}$${\ displaystyle x}$

${\ displaystyle u = {\ frac {\ partial f} {\ partial x}}}$.

Here, geometrically represents the gradient in the x-direction of the tangent plane to the function . This is why one speaks of contact transformation . The function is called the Legendre transform with respect to the variable . ${\ displaystyle u (x, y)}$${\ displaystyle f (x, y)}$${\ displaystyle F (u, y)}$${\ displaystyle x}$

The Legendre transform can be derived as follows. The value of can alternatively be used as ${\ displaystyle f (x, y)}$

${\ displaystyle f (x, y) \ approx f (x_ {0}, y) + {\ frac {\ partial f} {\ partial x}} \ Delta x, \; \ Delta x = x-x_ {0 }}$

to be written. If one defines now , one obtains for the Legendre transform ${\ displaystyle f (x_ {0}, y) \ equiv F (u, y)}$

${\ displaystyle F (u, y) = f (x, y) - {\ frac {\ partial f} {\ partial x}} \ Delta x}$.

Most of the time, people vote, and so it follows ${\ displaystyle x_ {0} = 0}$

${\ displaystyle F (u, y) = f (x, y) - {\ frac {\ partial f} {\ partial x}} x}$.

For the latter definition, the Legendre transform is the component of the intersection of the tangent plane an with the plane . For functions in the plane one speaks of the axis intercept (see also straight line equation ). ${\ displaystyle y}$${\ displaystyle f (x, y)}$${\ displaystyle x = 0}$

In practice, the independent variables are exchanged by subtracting the product of the old and new variables from the output function: ${\ displaystyle ux}$

${\ displaystyle F (u, y) = f (x, y) -ux}$.

This also becomes clear when considering the total differential of the Legendre transforms:

${\ displaystyle \ mathrm {d} (f (x, y) -ux) = \ mathrm {d} f (x, y) -x \, \ mathrm {d} uu \, \ mathrm {d} x = { \ frac {\ partial f} {\ partial x}} \ mathrm {d} x + {\ frac {\ partial f} {\ partial y}} \ mathrm {d} yx \ mathrm {d} uu \ mathrm {d} x = {\ frac {\ partial f} {\ partial y}} \ mathrm {d} yx \, \ mathrm {d} u = \ mathrm {d} F (u, y)}$.

## application areas

The Legendre transformation is mainly used in physics in (statistical) thermodynamics (e.g. conversion of the fundamental equation or the transition between thermodynamic potentials under different boundary conditions) and in the transition from Lagrangian to Hamiltonian mechanics ( Lagrangian function to Hamilton function ). The lower sign convention ( ) is used in thermodynamics . ${\ displaystyle g = f-ux}$

The Legendre transformation - like the touch transformations as a whole - also plays a role in mechanics , the calculus of variations and in the theory of first-order partial differential equations . The upper sign convention ( ) is used in mechanics . ${\ displaystyle g = ux-f}$

## Examples of applications in physics

In analytical mechanics one obtains the Hamilton function and vice versa by Legendre transformation from the Lagrangian function :

${\ displaystyle H (q, p) = p \, {\ dot {q}} (q, p) -L (q, {\ dot {q}} (q, p)) \ quad {\ text {with }} \ quad p = {\ frac {\ partial L} {\ partial {\ dot {q}}}}}$

In thermodynamics one can derive the thermodynamic potentials from the fundamental equation of thermodynamics by Legendre transformation . For example, there is a transition from internal energy (depending on entropy ) to Helmholtz energy (depending on temperature ). In the case of an ideal gas, the following applies: ${\ displaystyle U}$ ${\ displaystyle S}$ ${\ displaystyle F}$ ${\ displaystyle T}$

${\ displaystyle F (T, V, N) = U (S, V, N) - \ left ({\ frac {\ partial U} {\ partial S}} \ right) _ {V, N} \ cdot S = U-TS}$.

The derivation notation used herein, derivative of the function to , with and be kept constant. ${\ displaystyle U (S, V, N)}$${\ displaystyle S}$${\ displaystyle V}$${\ displaystyle N}$

Similarly, a transition from one thermodynamic potential to another is possible, for example from enthalpy to Gibbs energy : ${\ displaystyle H}$ ${\ displaystyle G}$

${\ displaystyle G (T, p, N) = H (S, p, N) - \ left ({\ frac {\ partial H} {\ partial S}} \ right) _ {p, N} \ cdot S = (U + pV) -TS}$.

The other thermodynamic potentials are obtained in the same way, whereby a Legendre transformation always replaces a generalized coordinate with the conjugate thermodynamic force.