You are on page 1of 7

Essential Math for Thermodynamics

Yoonseok Lee

The lack of mathematical sophistication is a leading cause of difficulty for students in


Classical Mechanics and other upper level physics courses. It is expected in this class that
you took and mastered MAC 2311 and 2312, and at least are taking 2313 (Vector Calculus).
These math courses together cover derivatives and integrals of trig and log functions, series
and sequences, analytic geometry, vectors and partial derivatives and multiple integrals.
Fluency in these math skills is a necessary but not sufficient condition for your
success in all upper level physics courses.

The following discussions and questions are grouped by subject and in approximate order
of difficulty—easiest first. These are representative of the level of mathematics which is
expected in this course. You should be very comfortable and fluent with mathematics at
this level. Never ever try to go through math or physics problems with your eyes. You may
think you understand the problem or the subject. But when a similar problem is given in
an exam, you will feel that you have seen this before but cannot solve it. This is why I
often hear from many students ”I studied very hard (with my eyes) but I do not
perform well in exams.”

I. APPROXIMATION

A. Taylor expansions of a function

Any differentiable function f (x) may be expressed in the neighborhood of a point x0 by the
Taylor expansion
df 1 d2 f 1 dn f
f (x) = f (x0 ) + (x − x0 ) + (x − x0 )2 2 + · · · + (x − x0 )n n + · · · (1)
dx x=x0 2 dx x=x0 n! dx x=x0
For example, consider f (x) = 1/(1 − x), expanded about x0 = 0. Then
f (x) = 1/(1 − x),
df
= [1/(1 − x)2 ]x=0 = 1
dx x=0

d2 f
= 2[1/(1 − x)3 ]x=0 = 2
dx2 x=0
d3 f
3
= 6[1/(1 − x)4 ]x=0 = 6
dx x=0
dn f
= n![1/(1 − x)n+1 ]x=0 = n!
dxn x=0

The Taylor expansion for 1/(1 − x) with x0 = 0 is now


1 1 1 1
= 1 + x + x2 × 2 + x3 × 6 + · · · + xn × n! + · · ·
1−x 2 6 n!

1
And this is easily seen to be

1 X
= xn ,
1 − x n=0
a well-known summation of a geometric series.

Taylor expansions of this sort are extremely useful in physics and one major technique to
get an approximate answer. In the Taylor expansion if |x − xo |  1, the high order terms
in the expansion are getting smaller: a small parameter expansion. And if you need an
answer with a certain accuracy, you can truncate the expansion at a proper place to meet
the required accuracy. For example, if |x − xo | = 0.1, then |x − xo |3 = 0.001 and ignoring
the terms higher than power 2 would give an answer within a percent level assuming the
1
values of the derivatives are not too big. For example, evaluate the value of f (x) = 1−x for
x = 0.1. f (0.1) = 1.1111... If you use the Taylor expansion keeping only up to power 2,
f (0.1) ≈ 1.11. You will have to use Taylor expansion over and over again in physics. Trust
me!

Q The relativistic kinetic energy of an object of mass m moving at a speed of v is given by


 1 
Ek = q − 1 mc2 ,
2
1 − vc2

where c is the speed of light. Here vc  1 is a small parameter. The non-relativistic limit
can be recovered only when you do the Taylor expansion and keep the first correction term
1 1 2
using √1−x 2 ≈ 1 + 2x .

Common Taylor expansions for   1:


1
= 1 +  + O(2 ),
1−
(1 + )n = 1 + n + O(2 ),

√ 1
1 −  = 1 −  + O(2 ),
2
1 1
√ = 1 +  + O(2 ),
1− 2

1 1 1
e = 1 +  + 2 + 3 + 4 + O(5 ),
2 6 24
1 1 1
ei = 1 + i − 2 − i 3 + 4 + O(5 ),
2 6 24

1 1
ln(1 + ) =  − 2 + 3 + O(4 ),
2 3
1 2 1 3
ln(1 − ) = − −  −  + O(4 ).
2 3

2
The O(n ) term here is standard mathematical notation to mean a function which is less
than some constant times n in the limit that  → 0. In other words for small , O(n ) is
no bigger than something times n .  can be simply replaced by ±x, ±x2 , or anything as
far as it is a small parameter.

We can use the Euler identity e±i = cos  ± i sin  to easily pick off the purely real terms
from this last expansion which give the expansion of cos  for a small angle , and the purely
imaginary terms, which give the expansion of sin  for small :
1 1
cos  = 1 − 2 + 4 + O(6 )
2 24
1 3
and sin  =  −  + O(5 ).
6
Since cos  is an even function (cos (−) = cos ), you can only have the terms of a even
power such as 0 = const, 2,4,.. . Similarly for sin  only the odd power terms exist.

Let’s go back to Eq.(1). If a function f (x) has a extremum (maximum or minimum) at


x = xo , then
df
= 0.
dx x=x0
This means that around x = xo , the shape of the function is parabolic bending upward
2 2
(minimum) if ddxf2 x=x0 > 0 or bending downward (maximum) if ddxf2 x=x0 < 0. An analytic
function can be approximated by a quadratic function near its minimum or maximum!

Q Show that for x << 1, tanh x ≈ x, and tanh x → ±1 as x → ±∞. Then, sketch the
curve of y = tanh x on the graph.

B. Stirling’s approximation

What is the value of 100!? Your hand-held calculator may not be able to calculate this.
If you ask Google, it will give 9.332622 × 10157 . But no luck for 200! even on Google. In
thermodynamics you will have to evaluate N ! for N ∼ 1020 .
Z ∞
Γ(N + 1) = N ! = xN e−x dx,
0

where Γ(N ) = (N − 1)! is called gamma function. Whenever you have an astronomically
large number, it is always a good idea to represent in a log scale: N ! → ln N !, which is still
a very large number for N  1. Sterling’s formula gives a handy approximation for this:
1
ln N ! ≈ N ln N − N + ln 2πN .
2

It is interesting to look at this approximation as N ! ≈ 2πN ( Ne )N ∼ ( Ne )N :
N N N
N · (N − 1) · (N − 2) · · · 2 · 1 = · ··· .
| {z } |e e{z e}
N
N

3
N ln N ! N ln N − N + (1/2) ln 2πN N ln N − N % Error
5 4.787 4.771 3.047 36
20 42.335 42.331 39.914 5.7
50 148.478 148.476 145.601 1.9

II. CALCULUS

A. Derivatives

Q Evaluate the derivative


d
A cos(ωt + φ)
dt
where A, ω and φ are constant.
x df (x)
Q If f (x) = cos x
, what is dx
?
df (x)
Q If f (x) = tan(ax2 + b), what is dx
?

Q Plot y = 13 x3 − 2x2 + 3x + 2 without using a graphing calculator. By just looking at the


functional form can you tell how many extrma at most exist in this curve?

Q What is the value of x where the following function peaks (a is a positive constant)?
1
f (x) = p .
(a2 − x2 ) 2 + 4

Can you plot the above function?

B. Integrals

Q Evaluate the following integrals Z π


sin θ dθ,
0
Z L/2
dz
−L/2 (z 2 + a2 )3/2
where L and a are constant,
Z
k
dx
x2
where k is a constant, and Z x
k
dx.
1 x

4
Is sin x an odd or even function? How about cos x, sin2 x, x + 5x5 ?

If function f (x) is even, then f (x) = f (−x). If f (x) is odd, then f (x) = −f (−x). Do you
see then why Z +a
f (x)dx = 0
−a

for any odd function f (x)?

Gaussian integral
+∞
Z r
−αx2 π
I(α) = e dx = .
−∞ α

C. Differential Calculus

df
If f = f (x) (f is a function of one variable x), then dx would tell us how does f varies when
the argument x change by an infinitesimal amount dx:
 df 
df = dx.
dx
This implicitly means that infinitesimal change of a function (curve) can be given by a
df
linear variation using the slope, dx , and the amount of change, dx. Extending to three
dimension, for a function of three variables, F (x, y, z) one can simply extend to
 ∂F   ∂F   ∂F 
dF = dx + dy + dz,
∂x ∂y ∂z

using partial derivatives (derivative keeping other variables fixed). In Cartesian coordinate,
one can express the above in a more compact form:
 ∂F ∂F ∂F 
dF = x̂ + ŷ + ẑ · (dxx̂ + dy ŷ + dz ẑ) = ∇F · d~r.
∂x ∂y ∂z
∇F is called the gradient of F . It works as a vector and has its magnitude and direction.

Suppose that there exists a relation between the variables F (x, y, z) = 0. Only two of
the three variables are independent and x = x(y, z), y = y(x, z), or z = z(x, y). Then the
infinitesimal changes in x (dx) resulting from the infinitesimal changes in y and z is given
by
 ∂x   ∂x 
dx = dy + dz.
∂y z ∂z y
And similarly,
 ∂y   ∂y 
dy = dx + dz,
∂x z ∂z x
 ∂z   ∂z 
dz = dx + dy.
∂x y ∂y x

5
Using the above relations, one can write
 ∂x   ∂y       ∂x  
∂x ∂y
dx = dx + + dz. (2)
∂y z ∂x z ∂y z ∂z x ∂z y

By setting dz = 0 or dx = 0 in Eq.(2), one can get two relations:


 ∂x   ∂y 
= 1,
∂y z ∂x z
 ∂x   ∂y   ∂x 
+ = 0.
∂y z ∂z x ∂z y
The first one is called the reciprocal relation and cane be expressed as
 ∂x   ∂y −1
= .
∂y z ∂x z

The second one is known as the cyclic relation:


 ∂x   ∂y   ∂z 
= −1.
∂y z ∂z x ∂x y

Suppose there is another function φ of x, y, and z (only two of them are independent), then
φ = φ(x, y). In this case there is an important rule called the chain rule:
 ∂x   ∂x   ∂y 
= .
∂z φ ∂y φ ∂z φ

Exact Differential
Suppose there is a differential of the form

dF (x, y) = g(x, y)dx + h(x, y)dy.

If dF is an exact differential, then


 ∂g   ∂h 
= .
∂y x ∂x y

This simply means


 ∂F   ∂F 
dF = dx + dy,
∂x y ∂y x

and consequently, Z x2 ,y2


∆F = dF = F (x2 , y2 ) − F (x1 , y1 ),
x1 ,y1

independent of the path between the two fixed points, (x1 , y1 ) → (x2 , y2 ).

The differential calculus is heavily used in thermodynamics because thermodynamic quan-


tities are functions of thermodynamic variables. For example, a gas can be described by three

6
thermodynamic variables (T, V, P ). The ideal gas model, the simplest model for a gas, as-
sumes that each molecule has no size and does not interact with other molecules. This
model can be mathematically represented by F (P, V, T ) = P V − αT = 0, equation of state
for an ideal gas where α is a constant. Therefore, the pressure of an ideal gas is a function
of temperature (T ) and volume (V ): P = P (T, V ) = αT /V . When you specify T and V , P
is uniquely determined for the given system. No matter how you change T and V from one
set of values to the other, the change in pressure, ∆P should be the same. One can express
T = T (V, P ) or V = V (T, P ). Between P , V , and T , one can establish the cyclic relation
and the reciprocal relation.
Q If dG(x, y) = 2xy 4 dx + 4x2 y 3 dy, is it an exact differential? Can you extract G(x, y)?

D. Path Integral

Can you calculate the integral of dG(x, y) between two points (0, 0) and (1, 1) following two
different paths?

Path 1 (0, 0) → (1, 0) → (1, 1)


Path 2 (0, 0) → (1, 1) diagonally following y = x.

If dG is an exact differential, the results for the paths should be the same! Check this.

One important consequence of this property is that an integral of an exact differential


along a closed loop is zero:
I Z 2 Z 1
dG = ( + dG = 0.
C 1 2

III. OTHER TOPICS

A. Hypersphere in d-Dimension

Up to d = 3 we all know well the surface area and the volume of a sphere of radius r.
Consider a sphere in d-dimension. Let us call Vd (r) and Ad (r) its volume and surface area,
respectively. Then we can write

Ad (R) = Ωd rd−1 , dVd (r) = Ad (r)dr,

where,
2π d/2
Ωd = .
(d/2 − 1)!
Therefore,
R
Ωd R d
Z
Vd (R) = Ωd rd−1 dr = .
0 d

You might also like