This action might not be possible to undo. Are you sure you want to continue?
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
Useful Mathematics to Recall for Thermodynamics
Before we start, first become comfortable with usage of the symbols. We are going to
encounter forms such as,
V
P
T

.

\

c
c
,
S
V
T

.

\

c
c
,
U
P
T

.

\

c
c
,
P
S
T

.

\

c
c
It is important to recognize is that in all four cases, a) T is temperature, b) but the numerical
value of temperature, also denoted as T, is given by
) P , S ( T ) U , P ( T ) S , V ( T ) V , P ( T T = = = = , c) this we know because in
V
P
T

.

\

c
c
implies T is a
function of ) V , P ( only and similarly we deduce from the remaining partial derivatives, d)
but also that ) V , P ( T will have a different functional form than ) S , V ( T . Hence, functionally
they are all different.
In short, in the function for temperature ) V , P ( T you can plug in value of P and V and get a
numerical value of temperature T. And you can get the same numerical value of T if you
plug in values of V and S in a different function T(V,S). That is, symbol T is being used for
temperature and also for function T which maps independent variables to actual temperature.
Also, the form of partial derivative in use tells us which ones are the independent variables.
Assumption: Everything below is for wellbehaved functions that are both continuous and
differentiable in the domain of interest.
1. Chain rule for partial differentiation
Consider a function U(x,y) of independent variables x and y which maps these values to a
quantity U. But, the independent variables of this function themselves depend on another set
of variables s and t. Thus, U=U(x,y) and x=x(s,t), y=y(s,t).
Then you should be able to recognize
(a) dy
y
U
dx
x
U
dU
x
y


.

\

c
c
+

.

\

c
c
= (1)
(b)
S
x
S y S
t
y
y
U
t
x
x
U
t
U

.

\

c
c


.

\

c
c
+

.

\

c
c

.

\

c
c
=

.

\

c
c
(2)
(c)
t
x
t y t
s
y
y
U
s
x
x
U
s
U

.

\

c
c


.

\

c
c
+

.

\

c
c

.

\

c
c
=

.

\

c
c
(3)
From these, you should derive the following identities which will be useful in
thermodynamics.
2
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
Reciprocity 1
x
y
y
x
z
z
=

.

\

c
c


.

\

c
c
(4)
and cyclic differentiation 1
x
z
z
y
y
x
y x
Z
÷ =

.

\

c
c

.

\

c
c


.

\

c
c
(5)
To see how these might be useful, now let us work out a thermodynamic problem. For the
definitions
P
p
T
S
T C

.

\

c
c
= and
V
v
T
S
T C

.

\

c
c
= prove that
P T
v p
T
V
V
S
T C C

.

\

c
c

.

\

c
c
= ÷
If we look at what we are asked to prove, the functions involved seem to be S(T,P) and
S(T,V)
Let us work with ) T , V ( S . From eq. (1),
dT
T
S
dV
V
S
dS
V T

.

\

c
c
+

.

\

c
c
=
or dT
T
C
dV
V
S
dS
v
T

.

\

+

.

\

c
c
= ,
Now we already have
v
C in the equation above and since
p
C involves
P
T
S

.

\

c
c
,
let us evaluate
that from equation above. Using eq. (2) or (3),
P
v
P T P
T
T
T
C
T
V
V
S
T
S

.

\

c
c
+

.

\

c
c

.

\

c
c
=

.

\

c
c
Therefore
T
C
T
V
V
S
T
C
v
P T
p
+

.

\

c
c

.

\

c
c
= or
P T
v p
T
V
V
S
T C C

.

\

c
c

.

\

c
c
= ÷
2. Exact and inexact differentials
Let us work in two dimensions, though generalization is possible. The statement of
importance is that a differential
dy ) y , x ( Y dx ) y , x ( X df + = (6)
is exact (or total), and hence can be integrated without any path dependence, if and only if
3
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
x
) y , x ( Y
y
) y , x ( X
c
c
=
c
c
*
(7)
Alternatively, if and only if the identity in eq. (7) is true, there exists a function ) y , x ( f and
then the total differential would be,
dy
y
f
dx
x
f
df
x
y


.

\

c
c
+

.

\

c
c
=
Proof :
If we assume integratibility, then such function f(x,y) exists. Hence, we can associate X(x,y)
and Y(x,y) with
y
x
f
) y , x ( X

.

\

c
c
= and
x
y
f
) y , x ( Y


.

\

c
c
= .
And since order of differentiation can be interchanged for wellbehaved function, that is,


.

\

c
c
c
c
=

.

\

c
c
c
c
y
f
x x
f
y
Therefore, =
c
c
y
X
x
Y
c
c
. Meaning that if eq. (6) can be integrated, then identity in (7) will be
true.
Conversely, now we assume =
c
c
y
X
x
Y
c
c
to be true and we find f (x, y), which will also be a
proof that eq. (6) and be integrated.
Choose a function f(x,y) ,such that
) y , x ( X
x
f
y
=

.

\

c
c
(8)
Therefore,
í
o + o o =
x
a
) y ( d ) y , ( X ) y , x ( f (9)
Now impose the condition
) y , x ( Y
y
f
x
=


.

\

c
c
(10)
*
Now I am beginning to take liberty with partial differentiation, in not writing what variable is being held
constant. That should be considered implied, though it will be a good practice for you to explicitly write it. I am
taking liberty only so that you get used to reading other persons work.
4
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
And prove that ) y ( o can be found, which also means f(x,y) is completely defined through eq.
9.
The italicized portion below can be ignored for now, and then you can come back and read it
after the complete proof.
In the following I am deriving a condition that if eq. (7) is true then function ) y ( o can be
found. If you followed the advice above, by now you would have anyways found that
function; in this section, without explicitly finding the function, I am only proving that it can
be found if eq. (7) were true.
So make function ) y , x ( f in eq. (9) satisfy the same condition as in eq. (10),
) y , x ( Y
y
f
=
c
c
From eq. (9), evaluate its partial derivative of f(x,y) with respect to y and equate to Y(x,y).
) y , x ( Y
dy
) y ( d
] d ) y , ( X [
y y
) y , x ( f
x
a
=
o
+ o o
c
c
=
c
c
í
After rearranging,
] d ) y , ( X [
y
) y , x ( Y
dy
) y ( d
x
a
í
o o
c
c
÷ =
o
Therefore, dy ] d ) y , ( X [
y
) y , x ( Y ) y (
x
a
í í


.

\

o o
c
c
÷ = o
This integration can be carried out only if integrand is not a function of x
Therefore, 0 ] d ) y , ( X
y
) y , x ( Y [
x
x
a
= o o
c
c
÷
c
c
í
or
o o
c
c
c
c
=
c
c
í
x
a
d ) y , ( X
y x x
) y , x ( Y
=
o o
c
c
c
c
í
x
a
d ) y , ( X
x y
=
y
) y , x ( X
c
c
This was the initial assumption; therefore integration of eq. (6) will be possible when
y
X
x
Y
c
c
=
c
c
5
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
So from eq. (9) and (10),
) y , x ( Y
dy
) y ( d
d
y
) y , ( X
y
f
x
a
=
o
+ o
c
o c
=
c
c
í
Since eq. (7) is assumed to be true, replace
y
) y , ( X
c
o c
by
o c
o c ) y , ( Y
, so that
) y , x ( Y
dy
) y ( d
d
) y , ( Y
y
f
x
a
=
o
+ o
o c
o c
=
c
c
í
) y , x ( Y
dy
) y ( d
) y , a ( Y ) y , x ( Y =
o
+ ÷
or, ) y , a ( Y
dy
) y ( d
=
o
.
Hence,
í
  = o
y
b
d ) , a ( Y ) y (
and
í í
  + o o =
x
a
y
b
d ) , a ( Y d ) y , ( X ) y , x ( f . (11)
Thus, if eq. (7), were true, we have found the function by integrating eq. (6).
Now let us see a use of this. For example, if chemical potential for a pure gas is defined as
†
dT ) T , P ( s dP ) T , P ( v ) T , P ( dg ÷ =
Then from eq. (11), we can immediately write
í í
+ ÷ =
o
P
P
T
0
C dt ) t , P ( s dp ) T , p ( v ) T , P ( g (12)
This C dt ) t , P ( s
o
T
+
í
is identified as the standard state free energy g
0
(T). You might have
seen eq. (12) written as
†
Recall you all know dG=VdPSdT. I am writing the same equation, which for a pure gas you can assume to
have been expressed on per mole basis. Hence, v, g and s appearing in the equation are molar volume and per
mole free energy and entropy, respectively.
6
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
í
+ =
P
P
o
0
dp ) T , p ( v ) T ( g ) T , P ( g . (13)
For an ideal gas, since
P
RT
v = , the equation (13) can be explicitly written as

.

\

+ =
o
o
P
P
ln RT ) T ( g ) T , P ( g (14)
You are probably used to taking 1 atm of a gas as the standard state, that is P
o
=1atm. In that
case, eq. (14) can be seen in a form that is probably familiar to you,
P ln RT ) T ( g ) T , P ( g
o
+ = (15)
Notice, in eq. (15), it is implied P must be taken in atm. Further, also notice from eq. (12),
what standard state you choose also impacts g
o
(T). You were free to choose standard state
pressure P
o
=2 atm. Accordingly, in eq. (15), instead of ln P, you would have ln(P/2) and
standard state free energy will also adjust itself in accordance with eq. (12) and in a manner
that g(P,T) remains the same. After all, choice of P
o
is only defining a path of integration.
Since dg(P,T) is an exact function, its value cannot depend on the path, or what standard state
you chose.
3. Properties of homogenous functions of order one
A homogenous function of order n is defined as
) z , y , x ( f ) z , y , x ( f
n
ì = ì ì ì
‡
(16)
In thermodynamics the property of a state are defined by quantities that are either intensive or
extensive. The ones that are extensive are expressed by functions that are homogeneous
functions of order one. Therefore, to derive important properties of such functions,
Set x u ì = , y v ì = and z w ì = and differentiate eq. (16) with respect to ì , using the chain
rule
) z , y , x ( f n
w
w
) w , v , u ( f v
v
) w , v , u ( f u
u
) w , v , u ( f
1 n÷
ì =
ì c
c
c
c
+
ì c
c
c
c
+
ì c
c
c
c
‡
we have written the function for three independent variables, x, y and z, but in what follows you should be able
to see that the results can easily be generalized for any number of independent variables.
7
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
or ) z , y , x ( f n
w
) w , v , u ( f
z
dv
) w , v , u ( f
y
u
) w , v , u ( f
x
1 n÷
ì =
c
c
+
c
+
c
c
Now set , 1 = ì and we have
) z , y , x ( nf
z
) z , y , x ( f
z
y
) z , y , x ( f
y
x
) z , y , x ( f
x =
c
c
+
c
c
+
c
c
.
Since our thermodynamic extensive quantities will be homogenous functions of order one, let
us restrict ourselves to n=1. Therefore,
f zf yf xf
'
z
'
y
'
x
= + + (17)
where
z . y
'
x
x
) z , y , x ( f
f

.

\

c
c
= and similarly for other derivatives in y and z.
Further perform total differentiation on eq. (17)
) z , y , x ( df dz f zdf dy f ydf dx f xdf
'
z
'
z
'
y
'
y
'
x
'
x
= + + + + +
or, dz f dy f dx f dz f dy f dx f zdf ydf xdf
'
z
'
y
'
x
'
z
'
y
'
x
'
z
'
y
'
x
+ + = + + + + +
or, 0 zdf ydf xdf
'
z
'
y
'
x
= + + (18)
Eqs (17) and (18), represent two important properties of homogenous functions of order of 1.
Further, the derivation above is for a function of three variables x, y and z. But you can see
this can easily be generalised for any number of variables.
Now let us see its use in thermodynamics. If you don’t already know, as a leap of faith,
accept that the a combined statement of first and second laws of thermodynamics can be
expressed as
i
i
i
dn PdV TdS dU
¯
u + ÷ = (19)
where you are familiar with various symbols, except may be the chemical potential of species
i, namely u
i
. We are considering a solution of several chemical species and hence summation
is over all the species. Here, n
i
denotes number of moles of species i in the solution. Finally,
you could think of u
i
dn
i
as the chemical work done by the system as the moles of species i
vanish out of the system.
If you have not seen eq. (19) before, to gain confidence in it, associate TdS with oq, the heat
flow into the system and work done by the system with ow=PdV
i
i
i
dn
¯
u , then the form of
the first law should be apparent to you, that is, dU=oqow. Notice for differential on q and w
8
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
are written differently, only to recognize that while dU is an exact derivative, oq and ow are
not.
Now let us get back to eq. (19), from which you should immediately recognize (see eq. (1))
U=U(S, V, n
i
…) (20)
i
n , V
S
U
T

.

\

c
c
= , (21a)
i
n , S
V
U
P

.

\

c
c
= ÷ , (21b)
i j
n , V , S
i
i
n
U
=


.

\

c
c
= u (21c)
Now in eq. (17), set ) z , y , x ( f to U (S,V,n
i
..); remember, if there are N chemical species in the
system, then range of i is from 1 to N. Then from eq. (20), we associate x with S, y with V
and z with various n
i
. Accordingly, eq. (17) is written as,
...) n , V , S ( U
n
U
n
V
U
V
S
U
S
i
n , V , S
i
i
i
n , S n , V , S
i j
i i
=


.

\

c
c
+ 
.

\

c
c
+ 
.

\

c
c
=
¯
, and after using eq. (21)
¯
u + ÷ =
i i
n PV TS U (22)
which is an important result. We just obtained the functional form of U, the internal energy.
Further, from eq. (18), we obtain,
¯
= u + ÷
i
i i
0 d n VdP SdT (23)
which is the wellknown Gibbs Duhem equation, we shall frequently use.
4. Legendre transformation
Consider a function ) z , y , x ( f so that
dz
z
f
dy
y
f
dx
x
f
df
c
c
+
c
c
+
c
c
= and in which let us set p
x
f
=
c
c
, q
y
f
=
c
c
and r
z
f
=
c
c
. Therefore,
rdz qdy pdx df + + = (24)
Now subtract ) qy ( d from this equation
9
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
rdz ) qy ( d qdy pdx ) qy f ( d + ÷ + = ÷ = rdz ydq pdx + ÷
If we regard m qy f = ÷ , then
rdz ydq pdx dm + ÷ = (25)
Comparing the forms of eqs. (24) and (25), while f was regarded as function of (x,y,z), m
appears as a function of (x,q,z). That is, by subtracting qy from f (m=fqy), we can
interchange y with q as the independent variable in the new function m.
So what is its use in thermodynamics? Let us see that below.
Our starting point are eqs. (19), (20) and (22); Eq. (20) shows the independent variables for
the function U; associate it with our function f(x,y,z) here. From Eq. (19), you might be able
to get an intuitive sense about how equilibrium may be defined for a system. Suppose we are
dealing with a closed system, that is, dn
i
=0 and equilibrium is sought at constant entropy and
volume. In that case, from eq. (19), dU=0. Since in equilibrium, we are looking for
stationary states of a system, that is, maximum or minimum of a function, U might be that
function, given by eq. (22).
(a) Now suppose we were to deal with a closed system at constant entropy and pressure,
we may seek another function of ) n , P , S (
i
, instead of (S,V and n
i
) in a form like eq.
19. To generate that function, look at the form of U in eqs. (19) and (22) and
substract –PV from U so that derivative in eq. (19) changes from that on V to that on
P. So, similar to m, that function will be U(PV). If we define PV U H + = , and by
comparing with eqs. (24) and (25), from eq. (19), we will have
i
i
i
dn VdP TdS dH
¯
u + + = ; (26)
this constructs a function called enthalpy, and since it is only a transformation of eq.
(19), it also represents the combined statement of the first and the second laws of
thermodynamics. So, when S and P are a constant, for a close system, dH=0. Since,
eq. (26) also represents the statement of laws of thermodynamics, equilibrium under
such conditions may be derived from eq. (26).
(b) Similarly, to define a function of ) n , V , T (
i
, define TS U F ÷ = and then
i
i
i
dn PdV SdT dF
¯
u + ÷ ÷ = , (27)
the Helmoltz free energy.
(c) To generate a function which will be useful at constant T and P, that of variables (P,T,
n
i
), define ) TS H or ( PV F G ÷ = + = and then
10
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
i
i
i
dn VdP SdT dG
¯
u + + ÷ = (28)
Finally, before I close this topic, as an aside from Legendre’s transformation, take a look at
eqs. (19), (26), (27) and (28). They are all exact derivatives. So, eq. (7) should apply. And
in that case we write what are known as Maxwell’s relations,
i i
n , V n , S
S
P
V
T

.

\

c
c
÷ =

.

\

c
c
i i
n , P n , S
S
V
P
T

.

\

c
c
=

.

\

c
c
i i
n , V n , T
T
P
V
S

.

\

c
c
=

.

\

c
c
i i
n , P n , T
T
V
P
S

.

\

c
c
÷ =

.

\

c
c
5. Constrained maxima or minima: method of Lagrange multipliers
Consider a wire bent in a form y=1x
2
. Now join a string from origin to a point P, (x,y), on
the bent wire. What is the length of the smallest string
required?
That’s an easy problem for you to solve. Length of string
between origin and any point P on the wire, d, follows
d
2
=x
2
+y
2
and all you have to do is minimize this function
d
2
=f(x,y) after substituting from the equation of bent wire, that is, y =1 x
2
. Thus in this case
you have to minimize a function
d
2
=f(x,1x
2
)=g(x)=x
2
+(1x
2
)
2
.
After setting g’(y)=0, you will get
2
1
x ± = , and y=1/2 and it is easy to verify this
corresponds to a minima (in addition you should find a maxima at x=0). Now you can also
calculate d.
11
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
Instead, now work with the method of Lagrange multipliers. We have to minimize f(x,y)
subject to a constraint y=1x
2
, or x
2
+y=1. With o(x,y)=1 as the constraint, implying o(x,y)=
x
2
+y, construct a function
F(x,y)=f(x,y)+ì o(x,y)
which instead is maximized or minimized by setting dF=0. Therefore,
df+ì do=2xdx+2ydy+ì (2xdx+dy)=0
2x(ì+1)dx+(ì+2y)dy=0
Since, both x and y are independent variables, dx and dy can be arbitrarily varied. Therefore,
in general,
2x(ì+1)=0 (29)
(ì+2y)=0 (30)
From eq. (29), either x=0 (which will lead to a maxima) or ì==1. Substituting the latter in
eq. (30), yields y=1/2, the same result as before.
Why this method also works is not the subject matter here. For that, pick up any engineering
mathematics book and learn. Only point being made is that this method simplifies algebra
when a large number of variables and constraints are involved. In thermodynamics, now
examine its use in determining a condition of equilibrium in a nonreacting, multicomponent
and multiphase system.
Consider a system consisting of a large number of phases o. . ¸. o… and each phase is made
up of n components 1, 2, 3…., C. For example, a phase may be oiron containing
components Fe and C. Now enclose this system by closed, rigid adiabatic walls, making it an
isolated system.
Therefore, for any phase i (=o..¸.o…) made up of components k=1, 2…., C, with
superscript indicating a phase, eq. (19) is reproduced for phase i as
i
k
k
i
k
i i i i i
dn dV P dS T dU
¯
u + ÷ = (31)
which after rearrangement is written as
i
k
k
i
i
k
i
i i
i
i
i
dn
T T
dV P
T
dU
dS
¯
u
÷ + = (32)
Now take my word for it that an isolated system evolves in manner that its entropy should
increase and the system reaches equilibrium, by attaining some pressure, temperature and
redistributing volume of each phase and moles of each component within the phases. In that
12
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
state, the entropy
¯
=
i
i
S S is maximum. Recognize the independent variables from eq. (32),
( )
i
C
i
k
i
2
i
1
i i i i
n ... n ... n , n , V , U S S = . We need to maximize S, of course, subject to the constraints,
t tan cons U U
i
i
= =
¯
(33a)
(energy is conserved for isolated system)
t tan cons V V
i
i
= =
¯
(33b)
(rigid walls of isolated system allow no total volume change)
t tan cons n
i
i
k
=
¯
, for each k=1, 2….C (33c)
(in nonreacting system mass of each component is conserved)
The total number of constraints are C+2. Can you also count the total number of independent
variables in S?
So, now you would be able to truly appreciate the power of using Lagrange multipliers for
finding the stationary states. As before, construct a function
¯ ¯ ¯ ¯ ¯ ¯

.

\

ì + ì ÷ ì ÷ = 
.

\

ì + ì ÷ ì ÷ =
i k
i
k k
i
v
i
u
i
k i
i
k k
i
i
v
i
i
u
n V U S n V U S F (34)
and for maximizing it,
¯ ¯

.

\

ì + ì ÷ ì ÷ =
i k
i
k k
i
v
i
u
i
dn dV dU dS dF =0, which after using eq. (32), becomes
0 dn
T
dV
T
P
dU
T
1
i k
i
k k
i
i
k
i
i
v
i
i
i
i
u
i
=


.

\



.

\

ì ÷
u
÷


.

\

ì ÷ +

.

\

ì ÷
¯ ¯ ¯ ¯
(35)
By using the same idea that the coefficients in front of each differential of independent
variables be zero, we would conclude
u
..........
T
1
T
1
T
1
T
1
ì = = = = =
o ¸  o
(36)
implying temperature in all phases should be the same;
13
Author: Deepak Gupta, Department of Materials Science & Engineering, IIT Kanpur
v
..........
T
P
T
P
T
P
T
P
ì = = = = =
o
o
¸
¸


o
o
(37)
implying pressure in each phase should be the same as temperature in all phases is the same
from eq. (36) and for any component k (k=1, 2, …C)
k
k k k k
. ..........
T T T T
ì = =
u
=
u
=
u
=
u
o
o
¸
¸


o
o
(38)
which represents C set of equations, one for each component as k varies from 1,2…C. The
result means that chemical potential of each component should be the same in all the phases
under chemical equilibrium. This is so, because temperature in all the phases is the same.
What we have just derived is the condition of chemical equilibrium in nonreacting systems;
further it should have been apparent to you that method of Lagrange multipliers indeed made
our life easy.