You are on page 1of 10

Lecture 20: Legendre Transforms

20.1 Recommended textbooks


Tester and Modell, Ch. 5.1, 5.2, 5.6

20.2 Topics in this lecture


• Fundamental relation

• Behavior of the energy at equilibrium

• Legendre transforms

• Legendre transform of the fundamental equation

• Behavior of new potentials at equilibrium

20.3 Announcements
• Simulation project due today, PS4 due next Thursday

20.4 The Fundamental Relation


In the last lecture, we derived the entropy and then used this to define the combined first and
second law of thermodynamics, which we wrote as:

dU = T dS − P dV (20.1)
Integrating this expression would fully specify the internal energy as:

U (S, V ) = f1 (S, V ) (20.2)


We also saw that we could specify T and P as derivatives of the internal energy that are
themselves functions of S and V , allowing us to write:

T = f2 (S, V ) (20.3)
P = f3 (S, V ) (20.4)

1
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

In other words, the temperature and pressure are also functions of the same variables, but the
functions f2 and f3 are unknown; knowing these would fully specify U (S, V ) and thus would fully
specify the properties of the system. These unknown functions are known as equations of state
because knowing them would fully specify the state of an equilibrium system. Connecting back
to Postulate 1, we see that there are exactly 2 independently variable parameters (S and V ) that
specify the equilibrium state of this system.
We can visualize the meaning of the functions f1 , f2 , and f3 by imagining a 3D surface in a
coordinate system in which the parameters U , S, and V are coordinate axes. Since these three
variables are related by Eq. 20.2, each point on this surface represents a possible equilibrium state
of the system. Since all states are equilibrium states, any two states can be linked by a quasi-static
process along the surface. We can calculate values of T and P for specific states by finding the
family of tangent lines to this surface, representing partial derivatives (projected along particular
axes since in each case the orthogonal variable is held constant). Fully specifying Eq. 20.2 thus
means fully specifying this surface for a given system; we need to know the tangent lines at every
point (i.e. f2 and f3 ) as well as the shape of the surface (f1 ).

As an example, we can calculate a closed form expression for the entropy of an ideal gas, knowing
its equation of state, and evaluate individual equations of state for T and P as well.

1 P
dS = dU + dV (20.5)
T T
Make intensive and substitute U = 3/2RT and P V = RT (20.6)
3R R
S= dU + dV (20.7)
2U V
Integrate from a reference state with U0 , V0 , S0 (20.8)
   
3R U V
S − S0 = ln + R ln (20.9)
2 U0 V0
"   #
3/2
U V
S = S0 + R ln (20.10)
U0 V0
"   #
U 3/2 V
S = N S0 + N R ln (20.11)
U0 V0

S U V
Here, we define S = N ,E=N , and V = N to indicate the quantity per mole that is intensive.
The second-to-last line fully specifies equilibrium states of the system and represents the 3D surface

2
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

in U , S, and V space defined earlier; each point in that space satisfies this expression. The last
line is a restatement of the same space with an extensive entropy. Now, we can find expressions
for T , U , and P as well by rearranging the expression for the entropy and then taking appropriate
derivatives:

 2/3   
V0 2 S − S0
U = U0 exp (20.12)
V 3 R
   
∂U ∂U 2U (S, V )
T = = = (20.13)
∂S V ,N ∂S V 3R
 
∂U 2U (S, V )
P =− = (20.14)
∂V S 3V
Thus, we have a complete equation defining all equilibrium states of our system in terms of
only two parameters - S and V - and we have equations of state for the various intensive variables
needed to fully specify our system.
We can end this section by generalizing the expressions above to multicomponent open systems.
We can write two equivalent expressions that are referred to as The Fundamental Relation of
Thermodynamics (or the Fundamental Equation):

U = fU (S, V , N1 , N2 , . . . , Nn ) (20.15)
S = fS (U , V , N1 , N2 , . . . , Nn ) (20.16)
The first expression is referred to as the energy representation while the second is the en-
tropy representation; both are equivalent, and choosing one or the other for solving a problem
is purely for mathematical convenience. Each expression defines a hypersurface in n + 3 dimensions
analogous to the 3D surface described above, with all states on that surface representing equilib-
rium states connected by quasi-static processes. The n + 2 first-order partial derivatives of the
Fundamental Equation correspond to tangent lines to this surface and define equations of states for
intensive parameters. According to Postulate 1, only two of these independently variable properties
(plus the masses of all n components) are necessary to specify the entire system; we will later show
that this is the case even for systems with n + 3 variables. Finally, for book-keeping purposes, we
can also write these in differential form by comparison to the combined first and second laws of
thermodynamics to help identify the relevant partial derivatives:

n
X
dU = T dS − P dV + µi dNi (20.17)
i
n
1 P X µi
dS = dU + dV − dNi (20.18)
T T T
i
In these last expressions we define a new term, the chemical potential, which we use for open
systems and define as:
 
∂U
µi = (20.19)
∂Ni S,V ,Nj6=i

The chemical potential of component i is thus the intensive variable conjugate to the amount
of component i in the system.

3
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

20.5 Behavior of the energy at equilibrium


In the last lecture, we found that for an isolated system held at constant U , V , and N , the entropy
of the system reaches a maximum at equilibrium. This finding presented us with the first example
of a thermodynamic potential - that is, a derived parameter that is a state function - that can
tell us if a system is at equilibrium. We have now defined two equivalent Fundamental Relations
that describe all of the properties (and thus the state) of a system - the entropy representation
(a function of U , V , and N ) and energy representation (a function of S, V , and N ). Given this
correspondence, then, we might suspect that there is an equivalent description of equilibrium in an
isolated system based on analyzing the internal energy of the system as opposed to the entropy.
Let us consider a system that at constant S, V , and N that is naturally described in the energy
representation rather than entropy representation. For an isolated system the entropy is maximized,
so here we ask what condition is fulfilled by the energy for the same system. We know that any
perturbation to the system would necessarily decrease its entropy since it is at a maximum; all
perturbations hence will decrease the entropy from S 0 to S 1 . Thus, we can imagine the following
process:

• We start with a system held at constant S 0 , V , N with energy U 0 .

• We isolate the system to maintain constant U 0 and apply a small perturbation so that the
entropy changes to S 1 , such that S 1 − S 0 < 0.

• We now allow the system to interact reversibly with an external heat reservoir to return the
entropy to its original value of S 0 while changing the energy to U 1 .

In general such perturbations may not be physically achievable so we treat this as a thought
experiment. An example perturbation that would decrease the entropy of the system at fixed energy
would be confining an ideal gas to a subset of its volume in a container, thus decreasing its entropy
at constant energy and constant volume (of the entire container). Again, we only need to be able
to imagine such perturbations rather than actually perform them. For this process, S 1 − S 0 < 0
during the perturbation. During the reversible process that reverts the system back to S 0 , we can
define:

∆S = S0 − S1 (20.20)
Z 0
dQ
= >0 (20.21)
1 T
∴ dQ > 0 (20.22)

This indicates that returning the system to its original entropy requires a transfer of heat from
the reservoir into the system, increasing the energy such that U 1 − U 0 > 0. Thus, reverting
the system back to its initial entropy necessarily increases the energy of the system from its initial
equilibrium state, or in other words the energy was previously at a minimum. We can then conclude
that for any equilibrium state held at constant S, V , N , any variation in the system will increase
the energy, and the energy of a system at constant S, V , N is minimized at equilibrium.

4
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

20.6 Legendre transform


The previous example shows that we can define multiple conditions for an equilibrium state based
on the thermodynamic parameters that define the fundamental equation for the system. So far,
we identified two conditions of equilibrium - specifically that the entropy is maximized in a sys-
tem with constant U , V , N as independent parameters and the energy is minimized in a system
with constant S, V , N as independent parameters. In general, it would be useful to obtain condi-
tions on equilibrium for systems characterized by different, possibly more convenient independent
parameters. For a single-phase system, it is always the case that a property such as the energy
can be expressed in terms of n + 2 other properties, where n is the number of components in the
system (we will show this in a future lecture). Thus, our goal in this lecture is to show how we
can construct a function with the same information content as the Fundamental Relation but with
independent variables that are more experimentally accessible, then determine the behavior of this
function at equilibrium. To do so, we will first introduce a mathematical operation referred to as
the Legendre Transform.
The Legendre transform, while somewhat complicated notationally to prove and apply, is based
on a relatively straightforward concept. Consider a line, which can be described as a series of
points in the x, y plane. Each point is thus defined by two parameters - its x position and its y
position. We could also draw a series of tangent lines to our line of interest, where each tangent
line intersects the line at a particular point. Each tangent line is also a function of two parameters
its slope, q, and its intercept with the y-axis, y (1) . Thus, we can imagine describing our line of
interest in two equivalent ways: either as a set of points with given x and y values, or the locus of
points defined as the intersection of a family of tangent lines, each of which is specified by q and
y (1) . Switching between these two equivalent representations, which have the same information
content (i.e. they describe the same line) and require the same number of parameters, is the goal
of a Legendre transform. Recall that we can write the combined first and second law as:

dU = T dS − P dV + . . . (20.23)
   
∂U ∂U
= dS + dV + . . . (20.24)
∂S V ∂V S

In this representation, it is clear that the intensive variables in the Fundamental Relation
represent the slope of tangent lines to U (as discussed in the previous lecture). Transforming
the equation to use these slopes as independent variables while maintaining the same information
content as the Fundamental Relation is our goal.
We will start by defining a function y (0) = f (x) as a function of a single independent variable
(this notation will be clarified shortly), although this process will generalize to many independent

5
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

variables as well. We assume that y (0) is a well-behaved, continuous function. At point x, we define
a tangent line to f (x) with the slope of the tangent line given as q = dy (0) /dx and the intercept as
y (1) such that:

y (0) = qx + y (1) (20.25)

We can define such a tangent line for each value of x. If we know q and y (1) for each value of
x, we can then reconstruct the function f (x); this is the equivalence we discussed above. Solving
for y (1) yields:

y (1) = −xq + y (0) = f (q) (20.26)


Thus, we can specify the same line by replacing f (x) with f (q), with the slope of the tangent
line to y (1) vs q given as:

dy (1)
−x = (20.27)
dq
and an intercept equal to y (0) . y (1) is the Legendre transform of y (0) - the function f (x) is now
transformed to f (q), and we can reproduce the same set of points described by f (x) with the set of
points described by f (q) so that these functions have the same information content (they specify the
same line). We use the superscript (1) to indicate a single independent variable has been replaced
with its original tangent line slope, q.
We can generalize this relationship to multiple variables, then show the application to thermo-
dynamic potentials. Consider now the function:

y (0) = f (x1 , x2 , . . . , xm ) (20.28)


There are m independent variables and thus m first-order partial derivatives of y (0) . Defining
each derivative as qi , we can write:
!
∂y (0) )
qi ≡ (20.29)
∂xi
x1 ,x2 ,...,[xi ],...,xm

This notation indicates that all m − 1 variables except for xi are held constant. We can then
imagine varying y (0) by changing xi with all other variables fixed to define a series of tangent lines
at each point of the surface. These tangent lines are all defined in terms of only y (0) and xi , so we
could describe this as the envelope of tangent lines in the y (0) − xi plane, reducing the problem to

6
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

the same single-variable system derived above. If we let xi = x1 and if y (1) is the intercept of the
tangent line corresponding to q1 , then we have:

y (1) (q1 , x2 , . . . , xm ) = y (0) − q1 x1 (20.30)


This function is the first Legendre transform of y (0) with respect to x1 . In particular, one
independent variable (x1 ) has been replaced by its slope (q1 ); we could continue to transform
other independent variables as well. Defining a more general case we can write the kth Legendre
transform as:
k
X
(k) (0)
y =y − qi x i (20.31)
i

The key here is that we are inverting the relationship between the variables  xi and qi . These
∂y (0) )
pairs of variables are referred to as conjugate pairs. Since qi = ∂xi is a
x1 ,x2 ,...,[xi ],...,xm
function of the entire set of m variables, we can also write the total differential of y (k) as:

m
X
(0)
dy = qi dxi (20.32)
i
k
X
dy (k) = dy (0) − (xi dqi + qi dxi ) (20.33)
i
m
X k
X k
X
= qi dxi − xi dqi − qi dxi (20.34)
i i i
k
X m
X
=− xi dqi + qi dxi (20.35)
i i=k+1

Here we assume that k < m; in other words, not all variables are necessarily transformed. We
can thus summarize this generalized transformation (Eq. 20.35) by showing that for the k variables
that have been transformed, we can write:
!
∂y (k) )
= −xi (20.36)
∂qi
q1 ,...,[qi ],...,qk ,xk+1 ,...,xm

For the rest of the m − k variables we can write:


!
∂y (k) )
= qi (20.37)
∂xi
q1 ,...,qk ,xk+1 ,...,[xi ],...,xm

Note that neither of these relations has a k dependence.

20.7 Legendre transforms of the Fundamental Relation


Having now shown this general form - how is this useful? Let’s first consider the Fundamental
Relation in the energy representation:

7
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

U = fU (S, V , N1 , N2 , . . . ) (20.38)
     
∂U ∂U ∂U
dU = dS + dV + dN1 + . . . (20.39)
∂S V ,N1 ,N2 ,... ∂V S,N1 ,N2 ,... ∂N1 V ,S,N2 ,...
= T dS − P V + µ1 dN1 + . . . (20.40)

Comparing this expression with the forms of the Legendre transformed expressions, we can see
several features - namely, we again identify conjugate pairs of variables consisting of an independent
variable (e.g. S) and derivative of the energy (e.g. T ), corresponding to xi and qi . Thus, for each
pair of these variables, we can perform a Legendre transform to obtain a potential that is a function
of either of the two
 variables
 in this conjugate pair. Note that here we have defined the chemical
∂U
potential as µi ≡ ∂Ni .
S,V ,N1 ,...,[Ni ],...,Nn
As an example, let us consider performing a Legendre transform of the energy to obtain a po-
tential which is a function of T and P instead of S and V . We begin by equating the untransformed
equation, y (0) , to the energy (i.e. the Fundamental Equation):

y (0) = U = fU (x1 , x2 , x3 , x4 , . . . ) (20.41)


= fU (S, V , N1 , N2 , . . . ) (20.42)

We want to transform this expression such that two variables are replaced by their conjugates;
we thus seek y (2) :

y (2) = f (q1 , q2 , x3 , x4 , . . . ) (20.43)


 ! ! 
∂y (0) ∂y (0)
=f , , x3 , x4 , . . .  (20.44)
∂x1 ∂x2
q2 ,x3 ,x4 ,... q1 ,x3 ,x4 ,...
"    #
∂U ∂U
=f , , N1 , N2 , . . . (20.45)
∂S V ,N1 ,N2 ,... ∂V S,N1 ,N2 ,...
= f (T, −P, N1 , N2 , . . . ) (20.46)

Now using Eq. 20.31, we can write:

2
X
(2) (0)
y =y − qi x i (20.47)
i
= U − TS + PV (20.48)
≡G (20.49)

Thus, using the Legendre transform and suitable identification of conjugate pairs, we arrive
at an expression for the Gibbs free energy, G. We can similarly write a total differential for this
expression using Eq. 20.35:

8
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

k
X m
X
(k)
dy =− xi dqi − qi dxi (20.50)
i i=k+1
m
X
dy (2) = −x1 dq1 − x2 dq2 + qi dxi (20.51)
i=3
= −SdT + V dP + µ1 dN1 + µ2 dN2 . . . (20.52)

We could also get this same result by differentiating the expression for G directly and substi-
tuting in the total differential of the Fundamental Relation:

G = U − TS + PV (20.53)
dG = dU − T dS − SdT + P dV + V dP (20.54)
X
= T dS − P dV + µi dNi − T dS − SdT + P dV + V dP (20.55)
i
= −SdT + V dP + µ1 dN1 + µ2 dN2 . . . (20.56)

Hence we get the desired expression. In practice, we can shorten this rather lengthy example
using the following set of steps (applied to the same set of variables):

• Identify the set of independent variables with which you wish to characterize a system (e.g.,
T, P, N1 , N2 ).

• Identify the variables conjugate to the independent variables in the Fundamental Relation
(e.g., S, V , µ1 , µ2 in the energy representation). Note that now we see why conjugate pairs
always appear in these potentials.

• Identify the variables that need to be transformed to yield the desired new set of independent
variables (e.g. S → T and V → P ).

• Subtract the conjugate pair from the reference potential for each variable that is to be trans-
formed (e.g. G = U − T S + P V )

• Take the total differential of the result if needed (e.g., dG).

In practice, then, for most purposes we need to know the form of the fundamental equation and
the identity of conjugate pairs; from there, it is fairly straightforward to perform Legendre trans-
formations. As a second example, let’s assume we want an equation with the information content
of the Fundamental Relation but as a function of the independent variables T, V , N . Following the
steps above, we recognize that S, −P and µ are conjugate to the independent variable, but starting
from the Fundamental Relation only S needs to be transformed. Hence we can write:

F ≡ U − TS (20.57)
dF = dU − T dS − SdT (20.58)
= −SdT − P dV + µdN (20.59)

9
University of Wisconsin-Madison Lecture 20
CBE 710, Fall 2019 - Prof. R. C. Van Lehn November 7, 2019

This is the expression for the Helmholtz free energy. Again, the key point here is that no
information is lost in transforming the Fundamental Relation (in either the entropy or energy
representation) - the transformation is simply a manipulation of which variables are independent
and we are able to describe the same hyperdimensional surface that is specified by the original,
untransformed Fundamental Relation.

10

You might also like