Legendre Transforms as Derivative Symmetrizers

Suppose you know that \(p\) is the derivative of some function with respect to \(v\). A natural question is whether or not the roles of \(v\) and \(p\) can be reversed, that is, can \(v\) also be viewed as the derivative of some (possibly different) function with respect to \(p\)? In symbols, if \(p=\frac{d\mathcal L}{dv}\) for some function \(\mathcal L\), then is there some (possibly different) function \(H\) such that \(v=\frac{dH}{dp}\)? The answer turns out to be yes, and moreover is unique modulo the addition of a constant. This function \(H\) is called the Legendre transform of \(\mathcal L\) from \(v\) to \(p\). It is a straightforward exercise in integration by parts to actually find an explicit formula for the Legendre transform \(H\) in terms of \(\mathcal L\), \(v\) and \(p\) by enforcing the “derivative symmetrizer” property described above:

$$v=\frac{dH}{dp}$$

$$dH=vdp$$

$$\int dH=\int vdp$$

$$H=vp-\int pdv$$

$$H=vp-\int\frac{d\mathcal L}{dv}dv$$

$$H=vp-\mathcal L$$

where in the last equation an arbitrary additive constant \(+C\) has been suppressed to zero as is conventional. Because of the derivative symmetrizer property, it is immediate that the Legendre transform of \(H\) from \(p\) back to \(v\) will just give \(\mathcal L\) again (i.e. the Legendre transform is an involution, or equivalently its inverse is equal to itself, hence as a corollary it preserves information).

In the context of classical mechanics, \(\mathcal L\) would represent the Lagrangian of a system while \(H\) would represent its Hamiltonian. The statement \(p=\frac{d\mathcal L}{dv}\) is then often viewed as the definition of the generalized momentum coordinate \(p\) conjugate to the generalized velocity coordinate \(v\) while the symmetric equation \(v=\frac{dH}{dp}\) often falls under the guise of one of Hamilton’s equations.

By contrast, in thermodynamics it is customary to use the Legendre transform with the opposite sign convention, so that instead of \(H=vp-\mathcal L\), it would be \(H=\mathcal L-vp\). This preserves the derivative \(p=\frac{d\mathcal L}{dv}\) (because \(H\) is not in that equation) but introduces a corresponding sign change in \(v=-\frac{dH}{dp}\) (because \(dH\mapsto -dH\)). For instance, starting from the combined first and second laws of thermodynamics:

$$dU=TdS-pdV+\mu_idN_i$$

One can Legendre transform \(U=U(S,V,N_i)\) along 3 distinct “axes”, namely \(S\to T, V\to -p\) or \(N_i\to\mu_i\), leading to three corresponding thermodynamic potentials:

  1. The Helmholtz free energy \(F:=U-TS\)
  2. The enthalpy \(H:=U+pV\)
  3. The no-name thermodynamic potential \(?:=U-\mu_i N_i\)

From here, one can apply more Legendre transforms to change variables as much as one wants, noting that Legendre transforms commute. For instance, the Gibbs free energy \(G\) can be thought of as either the Legendre transform of the Helmholtz free energy \(F\) from \(V\to -p\) or as the Legendre transform of the enthalpy \(H\) from \(S\to T\):

$$G=F+pV=H-TS=U+pV-TS$$

Occasionally one also sees the grand thermodynamic potential \(\Phi:=F-\mu_iN_i\) defined as the Legendre transform of the Helmholtz free energy \(F\) from \(N_i\to\mu_i\) (this is also the Legendre transform of the earlier “no-name” thermodynamic potential \(?\) from \(S\to T\)).

Remember that fundamentally the Legendre transform is defined to be a derivative symmetrizer. This means for instance that because \(-p=\frac{\partial U}{\partial V}\) and the enthalpy \(H\) was the Legendre transform of \(U\) from \(V\to -p\), this means we get for free the symmetric derivative \(V=\frac{\partial(-H)}{\partial(-p)}=\frac{\partial H}{\partial p}\), and likewise for the others.

One final nota bene: often, it is said that the Legendre transform only exists for convex or concave functions \(\mathcal L\). This is because if the Legendre transform \(H=vp-\mathcal L\) is to be regarded as a function of \(p\), then one needs to be able to find a formula for \(v=v(p)=v\left(\frac{d\mathcal L}{dv}\right)\), but the only way one can actually have such a functional relationship is iff \(\mathcal L\) does not have the same derivative \(\frac{d\mathcal L}{dv}\) at distinct values of \(v\). In practice most functions one deals with in physics are convex/concave for instance a typical Lagrangian contains a kinetic energy term \(\mathcal L=\frac{1}{2}mv^2+…\) and quadratic parabolas \(v\mapsto\frac{1}{2}mv^2\) are a classic example of convex functions. When \(\mathcal L\) has inflection points with respect to \(v\), it may sometimes be possible to take a sort of piecewise Legendre transform. Alternatively, one can use the more general notion of the Legendre-Fenchel transform which works for all functions (even non-convex/non-concave functions) by simply defaulting to the \(v\in\textbf R\) which maximizes \(H=vp-\mathcal L\) if there are multiple \(v\) with the same \(p=\frac{d\mathcal L}{dv}\).

This entry was posted in Blog. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *