<<

University of Connecticut OpenCommons@UConn

Chemistry Education Materials Department of Chemistry

November 2018 The Legendre Transformation for beginning students Carl W. David University of Connecticut, [email protected]

Follow this and additional works at: https://opencommons.uconn.edu/chem_educ Part of the Physical Chemistry Commons

Recommended Citation David, Carl W., "The Legendre Transformation for beginning Thermodynamics students" (2018). Chemistry Education Materials. 101. https://opencommons.uconn.edu/chem_educ/101 The Legendre Transformation for beginning Thermodynamics students∗

Carl W. David Department of Chemistry University of Connecticut Storrs, Connecticut, 06269-3060 (Dated: November 8, 2018) The Legendre Transform, as traditionally taught in introductory Physical Chemistry classes, can be better understood with some simple examples, which are discussed herein,

I. INTRODUCTION

The student who reads the equation creating the En- thalpy from the :

dH = dE + d(pV ) (1) and understands that E is a function V while H is a function of p (both are functions of S) is truly lucky, since s/he need not read this paper.

II. dE = dq + dw

Depending on how one was educated, the First Law dE = dq + dw can be re-written as

dE = T dS − pdV

which means that E is a function of S and V , i.e., E(S, V ). Thus

∂E  = T ∂S V and ∂E  = −p ∂V S since ∂E  ∂E  dE = + ∂S ∂V FIG. 1. partial with respect to S V S The question asked in this piece is, how does it happen that when one invokes the “classical” Legendre Transfor- mation:

[email protected] dE+d(pV ) ≡ dH = T dS−pdV +(pdV +V dp) = T dS+V dp 2

H turns out to be a function of S and p, i.e. H(S, p)! Then Why does this work? The answer is, of course, that the Legendre Transformation is more than meets the eye dE + d(pV ) = T dS − pdV + d(pV ) → dH (above). Why do we care? Although most chemistry students dH = T dS − pdV¨ + pdV¨ + V dp get to run a reaction at constant , i.e., employ- ¨ ¨ ing a bomb calorimeter, they also understand that most reactions are carried out at constant pressure, i.e., the V dp − SdT − T dS → dA external pressure of the atmosphere which surrounds us. Further, although reactions can be carried out adiabati- which yields cally, i.e., at constant , very often they are run un- der thermostatic control of the temperature, i.e., isother- dH − d(TS) = T dS+ V dp − SdT −T dS → A(T,V ) mally. So, we want to have variables T and p, not S and V ! (We omit the equivalent derivation) Parenthetically, we note that in , the change So, these manipulations do not seem, to me, to be con- from the Lagrangian to the Hamiltonian involves chang- vincing that we are changing the independent variables. ing canonical variables in the same manner as we’ve been Again, if you are convinced of the opposite, you need not doing here in thermodynamics. read further!

III. y[x] AS AN EXAMPLE 1. Classical Derivation Consider a function y(x). For the rest of this discus- Recall sion we will write y[x] rather than y(x) to emphasize the functionality, and y will be analogous to E, and x will be analogous to V or S, so that we are doing the constant dE = dq + dw entropy or constant volume part of the transformation from dE to dH or dA. or We wish to recast the form y[x] into a new form, β[y0], 0 dy where β is some new function, and y is dx This will dE = T dS − pdV encode the information about y[x] in terms of the of y[x] and the intercept of the (β) to the curve which are statements of the First Law. y[x] with the y[x] axis. 3

FIG. 2. First illustration of Legendre Transformation. The slope y0[x] in blue, for x = λ, and the slope y0[x] in red, for x = ν are shown explicitly. The intercepts are shown as β[a] and β[c] respectively (mnemonically to remind us of y = mx + b). The trick is to represent the same function y[x] in terms of β and y0. Thus, y[λ] = β[a] + a ∗ λ, and y[ν] = β[c] + c ∗ ν 4

Defining y[x] as a function of If, for example If, for example x and then forcing a represen- tation of this same function in y[x] = ax2 + bx E[V ] = aV 2 + bV the form so that so that y[x] = mx + b dy dE = 2ax + b = y0 = 2aV + b = E0 where dx dV then, solving for x in terms of the slope, then, solving for V in terms of the slope, dy 0 m = = y we obtain we obtain dx (y0 − b) (E0 − b) x = V = 2a 2a where, defining β as the intercept, we where, defining β as the intercept, we have: have:

dy 0 0 −p y[x] = × x + β y = y × x + β[y ] 0 >0 dx E = E × V + β[E ] which is, rearranging: i.e., which is, rearranging: β[y0] = y[x] − xy0 y[x] = y0 × x + β[y0] −p −p β[E>0] = E[V ] − V E>0 where β[y0] is the intercept. Thus H(S, p) ≡ β = E(S, V ) + pV This provides a vehicle for ob- Substituting Substituting taining x, i.e. y = ax2 + bx = slope × x E = aV 2 + bV = slope × V [y0] − β[y0] x = +intercept +intercept [y0] for x on the left hand side we have: for V on the left hand side we have: y0 − b2 y0 − b E0 − b2 E0 − b a + b = a + b = 2a 2a 2a 2a y0 × x + β E0 × V + β and substituting for x on the right hand and substituting for V on the right hand side we have: side we have: y0 − b2 y0 − b E0 − b2 E0 − b a + b = a + b = 2a 2a 2a 2a y0 − b E0 − b y0 × + β E0 × + β 2a 2a 5

Solving for β we have Solving for β we have

∂β 0 y0 − b y0 − b2 E0 − b E0 − b2 ≡ β β = (b − y0) + a β = (b − E0) + a ∂y0 2a 2a 2a 2a

which is which is β = β = y0 − b b − y0  E0 − b b − E0  2a(b − y0) 2a(b − E0) 2a 2a 2a 2a y0 − b2 E0 − b2 +a +a 2a 2a and and

y0 − b2 E0 − b2 β = −a β = −a 2a 2a

where we have expressed β as a function where we have expressed β as a function of of y0, which happens to be −x (see above). E0, which happens to be −p (see above). This means β(−x). : H(p) This means β(−p). 6

Proof that β0 = −x:

 ∂y  ∂ β = y[x] − x ∂x ∂x and since ∂β ∂β ∂y0 = ∂x ∂y0 ∂x one has ∂y0 ∂y0 β0 = y0 − y0 − x ∂x ∂x i.e., β0 = −x and therefore

∂β y0 − b = ≡ β0 = −x ∂y0 2a Q.E.D. Choosing again to write β in an alternate format using a straight line (slope and intercept, i.e. per- β = β0 × y0 + intercept β = β0 × E0 + intercept forming another Legendre Trans- formation) we have β = −x × y0 + intercept β = −V × E0 + intercept β = slope × y0 + intercept where the intercept is called y Then we where the intercept is called E Then we which is have have 0 0 β = −x × y0 + intercept β = −x × y + y β = −V × E + E

where the intercept is called ”y”. y0 − b2 E0 − b2 Thus, we have −a = −x × (2ax + b) + y −a = −V × (2aV + b) + E 2a 2a β = −x × y0 + y

so −ax2 = −x × (2ax + b) + y −aV 2 = −V × (2aV + b) + E

y = β + y0 × β0 which is exactly the original defining which is exactly the original defining equation for y[x]! equation for E[V ]!

IV. AN EXAMPLE (SEE WIKIPEDIA ON THIS which is SUBJECT) β = y − y0`ny Let Oddly enough, this form is equivalent to y(x) = ex β[y0] = y0 − y0`ny0 and which is amazing. dy = ex = y0 dx V. ANOTHER EXAMPLE (THIS TIME IN Now THERMODYNAMIC LANGUAGE) y ≡ y0x + β We wish to perform a Legendre Transformation on is the desired replacement, so that E(S, V ) to change the S variable to something else (it’s β = y − y0x going to be the temperature). 7

FIG. 3. The construction of the Legendre Transformation 8

Consider a system whose energy has the form: which is, substituting on the l.h.s.

E = 2S2 + 4 + V 2 = E(S, V ) (2) T 2 V 2 + 4 − = slope0 × (−4 × slope0) + intercept0 8 where E is an explicit function of S and V (as required in elementary thermo. Note that this function is completely which is, again substituting for T , invented, arbitrary, and not meant to mimic or represent any real system in this or any other universe.). (−4 × slope0)2 V 2+4− = slope0×(−4×slope0)+intercept0 We wish to couch this function in the Legendre form: 8 E = slope × (S − 0) + intercept (3) which rearranges to

At constant V , we have V 2 + 4 + 2 × slope02 = intercept0 ∂E  = 4S = slope i.e. ∂S V V 2 + 4 + 2 × S2 = E slope Since the slope is 4S (see above) we have S = 4 , so that, by substituting into Equation 3 we have which is what we started with (sorry about the sentence construction). slope E = slope×(S−0)+intercept = slope× +intercept 4 so that VI. THE SACKUR-TETRODE EXAMPLE slope2 2S2 + 4 + V 2 = + intercept When one writes 4 3 which is, substituting ( slope ) for S on the left hand side E = NkBT (5) 4 2 slope2 slope2 for an ideal (monatomic) gas, where k is the Boltzmann 2 + 4 + V 2 = + intercept B 4 4 constant, it certainly looks like the energy is a function of T , the temperature. (N is the number of molecules, which is an equation for the intercept as a function of the and E is the first law thermodynamic energy.) But we slope (and V which is being carried along here): are taught that E = E(S, V ), and while it is true (from the Joule expansion argument), that for an ideal gas, slope2 intercept = V 2 + 4 − E = E(S) alone, i.e., the energy does not depend on 8 the volume, never the less, one wonders how to reconcile these two views, that on the one hand, the energy should If we call the intercept A, the , be a function of S, and yet it explicitly is written as a and the slope we call T , the temperature, then we have function of T in Equation 5. How is one to write T 2 A(T,V ) = V 2 + 4 − 8 dE = T dS − pdV = T dS(for an ideal gas, V = fixed) which is the desired result. That is, we have started with using Equation 1 above? Even if one were willing to say a function of S and V and ended up with a function that E is a function of T through S, i.e., S = S(T,V ) of T and V . Just to prove that we know what we’re and E = E(S), what are we to do with Equation 5 to doing, we will do it again, this time transforming A(T,V ) construct the Helmholtz free energy (and the Gibbs)? into E(S, V ). We start with desiring a representation of The Sackur-Tetrode Equation gives us some insight A(T,V ) of the form: into this problem. Specifically, this equation is

0 0 A = slope × T + intercept " 3/2# S V 4πm E  5 = ln 2 + (6) Then kBN N 3h N 2 ∂A = −2T/8 = slope0 (4) i.e., S = S(E,V ) and assorted atomic constants. For ∂T V clarity, we absorb these constants (lump them) so the Sackur-Tetrode Equation becomes i.e., T = −4 × slope0. Substituting for T in Equation 4  3/2  A = slope0×T +intercept0 = slope0×(−4×slope0)+intercept0 S = NkB`n E V + β (7) 9 where β absorbs Planck’s constant, the mass of the E = E(S, V ), on the other hand, leads to something atomic constituent of the ideal gas, π, etc.. We can invert wonderful since the partial of E with respect to S leads Equation 7 solving for E in terms of S and V , obtaining to T , a member of the set. The variable pairs S and T on the one hand, and p and V on the other are known as 3/2 e(S−β)/NkB  canonically conjugate variables. Posing thermodynamic E = V equations in properly chosen canonical pairs (one from each pair) results in equations whose information content which surely reflects the desired dependency on S and V. is maximum, and whose applicable partial are This form begs us to take the partial derivative of E with themselves canonically conjugate opposites. respect to S at constant V , to see what happens. Thus

∂E  2 E = ≡ T VII. APOLOGIA ∂S V 3 NkB

3 I’m reluctant to close the file on this paper, since the which recovers E = 2 NkBT (Equation 1). As an aside, we obtain the other partial derivative words are not flowing well, but at the age of 81, I can’t dawdle too long. The original web pages from which the ∂E  2 E above is drawn and re-worked, were written 20+ years = − ≡ −p ∂V 3 V ago. I’ve attempted to clean the words and equations but S feel some misgivings that the structure of the discussion which recovers a well known result for ideal gases. In the is somehow wrong. Perhaps the reader will find a better set of variables S, T , p, and V the form of the partial way to express these thoughts. But the take away, about derivatives is simplest if one chooses two of them appro- changing variables, I still think is important for chemistry priately, the so called canonical variables. students to understand. Choosing E(T,V ) is not useful, since the partial of Many others [1–3] have written about the Legendre E with T at constant V has no special meaning, i.e., transformation. And, of course, Wikipedia has an article does not lead to another member of the set. Choosing on it.

[1] R. K. P. Zia, E. F. Redish, and S. R. McKay, American Journal of Physics 77, 614 (2009), https://doi.org/10.1119/1.3119512. [2] N. Cuti´c,ˇ This is an anonymous paper posted by the cited author. In case the link fails sometime in the future, I’ve got a local copy here: https://drive.google.com/file/d/1T8UuVAkDjzllk7M-2Gn7WhKzsfxL937o/view?usp=sharing. Otherwise, the original link is, http://mafija.fmf.uni-lj.si/seminar/files/2002 2003/legendre6.pdf. [3] C. E. Mungan, https://www.aapt.org/docdirectory/meetingpresentations/sm14/mungan-poster.pdf.