Categories: Mathematics, Physics.

Legendre transform

The Legendre transform of a function f(x)f(x) is a new function L(f)L(f'), which depends only on the derivative f(x)f'(x) of f(x)f(x), and from which the original f(x)f(x) can be reconstructed. The point is that L(f)L(f') contains the same information as f(x)f(x), just in a different form, analogously to e.g. the Fourier transform.

Let us choose an arbitrary point x0[a,b]x_0 \in [a, b] in the domain of f(x)f(x). Consider a line y(x)y(x) tangent to f(x)f(x) at x=x0x = x_0, which has slope f(x0)f'(x_0) and intersects the yy-axis at y=Cy = -C:

y(x)=f(x0)(xx0)+f(x0)=f(x0)xC\begin{aligned} y(x) &= f'(x_0) (x - x_0) + f(x_0) \\ &= f'(x_0) \: x - C \end{aligned}

Where Cf(x0)x0f(x0)C \equiv f'(x_0) \: x_0 - f(x_0). We now define the Legendre transform L(f)L(f'), such that for all x0[a,b]x_0 \in [a, b] we have L(f(x0))=CL(f'(x_0)) = C (some authors use C-C instead). Renaming x0x_0 to xx:

L(f(x))=f(x)xf(x)\begin{aligned} L(f'(x)) &= f'(x) \: x - f(x) \end{aligned}

We want this function to depend only on the derivative ff', but currently xx still appears here as a variable. We solve this problem in the easiest possible way: by assuming that f(x)f'(x) is invertible for all x[a,b]x \in [a, b]. If x(f)x(f') is the inverse of f(x)f'(x), then L(f)L(f') is given by:

L(f)=fx(f)f(x(f))\begin{aligned} \boxed{ L(f') = f' \: x(f') - f\big(x(f')\big) } \end{aligned}

The only requirement for the existence of the Legendre transform is thus the invertibility of f(x)f'(x) in the target interval [a,b][a,b], which is only satisfied if f(x)f(x) is either convex or concave, meaning its derivative f(x)f'(x) is monotonic.

The derivative of L(f)L(f') with respect to ff' is simply x(f)x(f'). In other words, the roles of ff' and xx are switched by the transformation: the coordinate becomes the derivative and vice versa:

dLdf=fdxdf+x(f)fdxdf=x(f)\begin{aligned} \boxed{ \dv{L}{f'} = f' \dv{x}{f'} + x(f') - f' \dv{x}{f'} = x(f') } \end{aligned}

Furthermore, Legendre transformation is an involution, meaning it is its own inverse. To show this, let g(L)g(L') be the Legendre transform of L(f)L(f'):

g(L)=Lf(L)L(f(L))=x(f)ffx(f)+f(x(f))=f(x)\begin{aligned} g(L') &= L' \: f'(L') - L(f'(L')) \\ &= x(f') \: f' - f' \: x(f') + f(x(f')) \\ &= f(x) \end{aligned}

Moreover, a Legendre transform is always invertible, because the transform of a convex function is itself convex. Convexity of f(x)f(x) means that f(x)>0f''(x) > 0 for all x[a,b]x \in [a, b], so a proof is:

L(f)=ddf(dLdf)=dx(f)df=dxdf(x)=1f(x)>0\begin{aligned} L''(f') &= \dv{}{f'} \Big( \dv{L}{f'} \Big) = \dv{x(f')}{f'} = \dv{x}{f'(x)} = \frac{1}{f''(x)} > 0 \end{aligned}

And an analogous proof exists for concave functions where f(x)<0f''(x) < 0.

Legendre transformation is important in physics, since it connects Lagrangian and Hamiltonian mechanics to each other. It is also used to convert between thermodynamic potentials.


  1. H. Gould, J. Tobochnik, Statistical and thermal physics, 2nd edition, Princeton.