Legendre Transform
As we have seen in the previous lectures, the Lagrangian and Hamiltonian formulations of mechanics are related by a mathematical operation called the Legendre transformation. This transformation is not just a technical tool; it is a fundamental concept that appears in various areas of physics, including thermodynamics and classical mechanics. In this lecture, we will explore the Legendre transformation in depth, understand its motivation, and see how it is applied in different physical contexts.
The Legendre transformation is a mathematical method for rewriting a function in terms of a conjugate variable, usually a derivative, when that new variable is more natural for describing a physical system. In physics, it provides a systematic way to replace one set of variables by another set that contains the same information but is better suited to the problem. This is especially important in classical mechanics, where velocity is replaced by momentum, and in thermodynamics, where entropy and volume are replaced by temperature and pressure.
Motivation and Core Idea
Suppose a function $f(x)$ is known in terms of the variable $x$, but in actual applications we often measure, control, or interpret the slope rather than the variable itself. That slope is
$$ y=\frac{df}{dx}. $$If $f$ is smooth and convex, then the relation between $x$ and $y$ is one-to-one, so we can solve for $x$ in terms of $y$. The Legendre transformation then defines a new function
$$ g(y)=xy-f(x), $$where $x$ is eliminated in favor of $y$ through the relation $y=df/dx$. Thus, the transformation does not lose information; rather, it repackages the same content in a different and often more useful form.
Hint: Do integration by parts to show that the Legendre transform is equivalent to a change of variables in the integral representation of $f$. $$ df=y\,dx $$ Apply integration by parts to $\int y\,dx$: $$ \int y\,dx=xy-\int x\,dy. $$ So, $$ xy-\int x\,dy=f(x)+C. $$ Rearranging, $$ \int x\,dy+C=xy-f(x). $$ We write $$ g(y)=xy-f(x). $$
Conceptual meaning: the Legendre transform replaces dependence on a variable by dependence on its conjugate variable. In many physical problems, the conjugate variable is the one that has clearer experimental or dynamical significance.
Legendre Transform in Classical Mechanics
In Lagrangian mechanics, the state of a system is described by generalized coordinates and velocities, so the Lagrangian is written as
$$ L(q,\dot q,t). $$The conjugate or generalized momentum corresponding to $q$ is defined by
$$ p=\frac{\partial L}{\partial \dot q}. $$If this relation can be inverted so that $\dot q$ can be expressed in terms of $(q,p,t)$, then we can move from the Lagrangian description to the Hamiltonian description. The Hamiltonian is obtained by performing the Legendre transform with respect to $\dot q$:
$$ H(q,p,t)=p\dot q-L(q,\dot q,t). $$Here $\dot q$ must finally be replaced by its expression in terms of $q$, $p$, and $t$. This is the exact mathematical sense in which the Legendre transform changes the natural variables from $(q,\dot q)$ to $(q,p)$. The Hamiltonian formulation is especially powerful in advanced mechanics, canonical transformations, and quantum theory.
Thermodynamic Potentials as Legendre Transforms
Thermodynamics makes extensive use of Legendre transforms because different experiments keep different variables fixed. A thermodynamic potential is chosen according to which variables are easiest to control. Starting from internal energy $U(S,V)$, one defines the conjugate variables through partial derivatives:
$$ P=-\left(\frac{\partial U}{\partial V}\right)_S, \qquad T=\left(\frac{\partial U}{\partial S}\right)_V. $$The common thermodynamic potentials are then obtained as follows.
- Enthalpy: $$ H(S,P)=U(S,V)+PV $$
- Helmholtz free energy: $$ F(T,V)=U(S,V)-TS $$
- Gibbs free energy: $$ G(T,P)=U+PV-TS $$
Each of these functions contains the same underlying thermodynamic information, but each is best adapted to a different set of laboratory conditions. This is why Legendre transformation is not merely a formal trick; it is a powerful organizational principle in physics.
Worked Examples
Example 1: Legendre transform of a quadratic
Let $f(x)=ax^2$. Then
$$ y=\frac{df}{dx}=2ax \quad\Rightarrow\quad x=\frac{y}{2a}. $$Now,
$$ g(y)=xy-f(x)=\left(\frac{y}{2a}\right)y-a\left(\frac{y}{2a}\right)^2 =\frac{y^2}{2a}-\frac{y^2}{4a} =\frac{y^2}{4a}. $$So the Legendre transform of $ax^2$ is $\frac{y^2}{4a}$.
Example 2: Lagrangian to Hamiltonian for a particle in a potential
Given
$$ L=\frac{1}{2}m\dot q^2-V(q), $$the conjugate momentum is
$$ p=\frac{\partial L}{\partial \dot q}=m\dot q \quad\Rightarrow\quad \dot q=\frac{p}{m}. $$Therefore,
$$ H=p\dot q-L =\frac{p^2}{m}-\left(\frac{p^2}{2m}-V(q)\right) =\frac{p^2}{2m}+V(q). $$Thus the Hamiltonian becomes the sum of kinetic and potential energies.
Example 3: Internal energy to enthalpy
Starting from $U(S,V)$, define
$$ H(S,P)=U(S,V)+PV. $$This replaces volume by pressure as a natural variable when the pressure is externally controlled.
Example 4: Internal energy to Helmholtz free energy
Using temperature as the conjugate of entropy, define
$$ F(T,V)=U(S,V)-TS. $$This potential is most useful for systems maintained at fixed temperature and volume.
Example 5: Internal energy to Gibbs free energy
Two successive Legendre transforms give
$$ G(T,P)=U+PV-TS. $$This is the most useful potential when both temperature and pressure are controlled.
Example 6: Helmholtz to Gibbs
From $F=U-TS$, we obtain
$$ G=F+PV=U-TS+PV. $$So Gibbs free energy can also be viewed as a Legendre transform of Helmholtz free energy with respect to volume.
Key Points and Practice Questions
Key Points
- The Legendre transformation replaces dependence on a variable with dependence on its conjugate variable.
- In mechanics, it converts $(q,\dot q)$ into $(q,p)$ through $p=\partial L/\partial \dot q$.
- In thermodynamics, it generates useful thermodynamic potentials matched to different experimental constraints.
- It is valuable because it preserves the physical content while changing the variables to a more convenient set.
Practice Questions
- Find the Legendre transform of $f(x)=e^x$.
- Define conjugate momentum and explain why it enables the transformation from $L$ to $H$.
- If $L=\frac{1}{2}m\dot q^2+A\dot q$, compute the Hamiltonian.
- Find the Legendre transform of $f(x)=\ln x$.