Statistical mechanics re-visited

Quite a while ago – in June and July 2015, to be precise – I wrote a series of posts on statistical mechanics, which included digressions on thermodynamics, Maxwell-Boltzmann, Bose-Einstein and Fermi-Dirac statistics (probability distributions used in quantum mechanics), and so forth. I actually thought I had sort of exhausted the topic. However, when going through the documentation on that Stern-Gerlach experiment that MIT undergrad students need to analyze as part of their courses, I realized I did actually not present some very basic formulas that you’ll definitely need in order to actually understand that experiment.

One of those basic formulas is the one for the distribution of velocities of particles in some volume (like an oven, for instance), or in a particle beam – like the beam of potassium atoms that is used to demonstrate the quantization of the magnetic moment in the Stern-Gerlach experiment. In fact, we’ve got聽two聽formulas here, which are subtly – as subtle as the difference between v聽(boldface, so it’s a vector) and v (lightface, so it’s a scalar) 馃檪 – but fundamentally different:


Both functions are referred to as the Maxwell-Boltzmann density distribution, but the first distribution gives us the density for some v in the聽velocity聽space, while the second gives us the distribution density of the聽absolute value聽(or modulus) of the velocity, so that is the distribution density of the聽speed, which is just a scalar – without any direction. As you can see, the second formula includes a 4蟺路v2聽factor.

The question is: how are these formulas related to Boltzmann’s聽f(E) = C路e鈭抏nergy/kT聽Law? The answer is: we can derive all of these formulas – for the distribution of velocities, or of momenta – by clever substitutions. However, as evidenced by the two formulas above, these substitutions are not always straightforward. So let me quickly show you a few things here.

First note the two formulas above already include the e鈭抏nergy/kT聽function if we equate the energy E with the聽kinetic聽energy: E = K.E. = m路v2/2. Of course, if you’ve read those June-July 2015 posts, you’ll note that we derived Boltzmann’s Law in the context of a force field, like gravity, or an electric potential. For example, we wrote the law for the density (n = N/V) of gas in a gravitational field (like the Earth’s atmosphere) as n = n0e鈭扨.E./kT. In this formula, we only see the potential energy: P.E. = m路g路h, i.e. the product of the mass (m), the gravitational constant (g), and the height (h). However, when we’re talking the distribution of velocities – or of momenta – then the聽kinetic聽energy comes into play.

So that’s a first thing to note: Boltzmann’s Law is actually a whole set聽of laws. For example,聽the frequency distribution of particles in a system over various possible states, also involves the same exponential function: F(state)聽鈭澛e鈭扙/kT. E is just the聽total聽energy of the state here (which varies from state to state, of course), so we don’t distinguish between potential and kinetic energy here.

So what energy concept should we use in that Stern-Gerlach experiment? Because these potassium atoms in that oven – or when they come out of it in a beam – have kinetic energy only, our聽E = m路v2/2 substitution does the trick: we can say that the potential energy is taken to be zero, so that all energy is in the form of kinetic energy. So now we understand the e鈭抦路v2/2kT聽function in those聽f(v) and f(v) formulas. Now we only need to explain those complicated coefficients. How do we get these?

We get them through clever substitutions using equations such as:

fv(v)路dv聽 = fp(p)路dp

What are we writing here? We’re basically combining two normalization conditions: if fv(v) and fp(p) are proper probability density functions, then they must give us 1 when integrating over their domain. The domain of these two functions is, obviously, the velocity (v) and momentum (p) space. The velocity and momentum space are the same mathematical聽space, but they are obviously聽not聽the same聽physical聽space. But the two physical spaces are closely related: p = m路v, and so it’s easy to do the required transformation聽of variables. For example, it’s easy to see that, if E = m路v2/2, then E is also equal to E = p2/2m.

However, when doing these substitutions, things get tricky. We already noted that p and v are vectors, unlike E, or p and v – which are scalars,or聽magnitudes. So we write: p = (px, py, pz) and |p| = p, and聽v = (vx, vy, v z) and |v| = v. Of course, you also know how we calculate those magnitudes:


Note that this also implies the following: pp = p2聽= px2聽+ py2聽+pz2聽= p2. Trivial, right? Yes. But have a look now at the following differentials:

  • d3p
  • dp
  • dp = d(px, py, pz)
  • dpx路dpy路dpz

Are these the same or not? Now you need to think, right? That d3p and dp are different beasts is obvious: d3p聽is, obviously, some infinitesimal聽volume, as opposed to dp, which is, equally obviously, an (infinitesimal) interval. But what volume exactly? Is it the same as that dp = d(px, py, pz) volume, and is that the same as the dpx路dpy路dpz聽volume?

Fortunately, the volume聽differentials聽are, in fact, the same – so you can start breathing again. 馃檪 Let’s get going with that d3p聽notation for the time being, as you will find that’s the notation which is used in the Wikipedia article on the Maxwell-Boltzmann distribution聽– which I warmly recommend, because – for a change – it is a much easier read than other Wikipedia articles on stuff like this. Among other things, the mentioned article writes the following:

fE(E)路dE = fp(p)路d3p

What is this? Well… It’s just like that fv(v)路dv聽 = fp(p)路dp equation: it combines the normalization condition for both distributions. However, it’s much more interesting, because,聽on the left-hand side, we multiply a density with an (infinitesimal) interval聽(dE), while on the right-hand side we multiply with an (infinitesimal) volume (d3p). Now, the (infinitesimal) energy interval dE must, obviously, correspond with the (infinitesimal) momentum聽volume聽d3p. So how does that work?

Well… The mentioned Wikipedia article talks about the “spherical symmetry of the energy-momentum dispersion relation” (that dispersion relation is just E = |p|2/2m, of course), but that doesn’t make us all that wiser, so let’s try a more聽heuristic聽approach.聽You might remember the formula for the volume of a spherical聽shell, which is simply the difference between the volume of the outer sphere聽minus聽the volume of the inner sphere: V = (4蟺/3)路R3聽鈭 (4蟺/3)路r3聽= (4蟺/3)路(R3聽鈭 r3). Now, for a very thin shell of thickness 螖r, we can use the following first-order approximation:聽V = 4蟺路r2路螖r.聽In case you wonder, I hereby copy a nice explanation from the Physics Stack Exchange site:


Perfect. That’s all we need to know. We’ll use that first-order approximation to re-write d3p聽as:

d3p聽= dp = 4蟺路|p|2路d|p| = 4蟺路p2路dp

Note that we’ll have the same formula for d3v, of course: d3v聽= dv = 4蟺路|v|2路d|v| = 4蟺路v2路dv, and also note that we get that same 4蟺路v2聽factor which we mentioned when discussing the f(v) and f(v) formulas. That is not a coincidence, of course, but – as I’ll explain in a moment – it is聽not聽so easy to immediately relate the formulas. In any case, we’re now ready to relate dE and dp so we can re-write that d3p formula in terms of m, E and dE:


We are now – finally! – sufficiently armed to derive all of the formulas we want – or need. Let me just copy them from the mentioned Wikipedia article:




As said, you’ll encounter these formulas regularly – and so it’s good that you know how you can derive them. Indeed, the derivation is very straightforward and is done in the same article: the tips I gave you should allow you to read it in a couple of minutes only. Only the density function for velocities might cause you a bit of trouble – but only for a very short moment: just use the p = m路v equation to write聽d3p as聽d3p = 4蟺路p2路dp聽= 4蟺路m2路v2路m路dv = 4蟺路m3路v2路dv = m3路d3v, and you’re all set. 馃檪

Of course, you will recognize the formula for the distribution of velocities: it’s the聽f(v) we mentioned in the introduction. However, you’re more likely to need the f(v) formula (i.e. the probability density function for the speed) than the f(v) function.聽So how can we derive get the聽f(v) – i.e. that formula for the distribution of speeds,聽with the 4蟺路v2聽factor – from the f(v) formula?

Well… I wish I could give you an easy answer. In fact, the same Wikipedia article suggests it’s easy – but it’s not. It involves a transformation from Cartesian to polar coordinates: the volume element dvx路dvy路dvz聽is to be written as v2路sin胃路dv路d胃路d蠁. And then… Well… Have a look at this link. 馃檪 It involves a so-called聽Jacobian transformation matrix. If you want to know more about it, then I recommend you read some article on how to transform distribution functions: here’s a link to one of those, but you can easily google others. Frankly, as for now, I’d suggest you just accept the formula for f(v) as for now. 馃檪 Let me copy it from the same article in a slightly different form:density-formulaNow, the final thing to note is that you’ll often want to use so-called聽normalized velocities, i.e. velocities that are defined as a v/v0聽ratio, with v0聽the聽most probable聽speed, which is equal to聽鈭(2kT/m). You get that value by calculating the df(v)/dv derivative, and then finding the value v = v0聽for which df(v)/dv = 0. You should now be able to verify the formula that is used in the mentioned MIT version of the Stern-Gerlach experiment:mit-formulaIndeed, when you write it all out – note that 蟺/蟺3/2聽= 1/鈭毾 馃檪 – you’ll see the two formulas are effectively equivalent.聽Of course, by now you are completely formula-ed out, and so you probably don’t even wonder what that f(v)路dv product actually stands for. What does it聽mean, really? Now you’ll sigh: why would I even聽want聽to know that? Well… I want you to understand that MIT experiment. 馃檪 And you won’t if you don’t know what f(v)路dv actually represents.聽So think about it. […]

[…] OK. Let me help you once more. Remember the normalization condition once again: the integral of the whole thing – over the whole range of possible velocities – needs to add up to 1, so聽f(v)路dv is really the聽fraction聽of (potassium) atoms (inside the oven) with a velocity in the (infinitesimally small) dv interval. It’s going to be a聽tiny聽fraction, of course: just a tiny bit larger than zero. Surely聽not聽larger than 1, obviously. 馃檪 Think of integrating the function between two values – say v1聽and v2聽– that are pretty close to each other.

So… Well… We’re done as for now. So where are we now in terms of understanding the calculations in that description of that MIT experiment? Well… We’ve got the meat. But we need a lot of other ingredients now. We’ll want formulas for the聽intensity聽of the beam at some point along the axis measuring its聽deflection聽from its main direction. That axis is the聽z-axis. So we’ll want a formula for some I(z) function.

Deflection? Yes. There are a lot of steps to go through now. Here’s the set-up:set-upFirst, we’ll need some formula measuring the聽flux聽of (potassium) atoms coming out of the oven. And then… Well… Just have a look and try to make your way through the whole thing now – which is just what I want to do in the coming days, so I’ll give you some more feedback soon. 馃檪 Here I only wanted to introduce those formulas for the distribution of velocities and momenta, because you’ll need them in other contexts too.

So I hope you found this useful. Stuff like this all聽makes it somewhat more real, doesn’t it? 馃檪 Frankly, I think the math is at least聽as fascinating as the physics. We could have a closer look at those distributions, for example, by noting the following:

1. The probability density function for the momenta is the product of three normal distributions. Which ones? Well…聽聽The distribution of px, py聽and pz聽respectively: three normal distributions whose variance is equal to mkT. 馃檪

2. The fE(E) function is a chi-squared (蠂2) distribution with 3 degrees of freedom. Now, we have the equipartition theorem (which you should know – if you don’t, see my post on it), which tells us that this energy is evenly distributed among all three degrees of freedom. It is then relatively easy to show – if you know something about 蠂2聽distributions at least 馃檪 – that the energy per degree of freedom (which we’ll write as 蔚 below) will also be distributed as a chi-squared distribution with one degree of freedom:chi-square-2This holds true for any number of degrees of freedom. For example, a diatomic molecule will have extra degrees of freedom, which are related to its rotational and vibrational motion (I explained that in my June-July 2015 posts too, so please go there if you’d want to know more). So we can really use this stuff in, for example, the theory of the specific heat of gases. 馃檪

3. The function for the distribution of the velocities is also a product of three independent normally distributed variables – just like the density function for momenta. In this case, we have the vx, vy聽and vz聽variables that are normally distributed, with variance kT/m.

So… Well… I’m done – for the time being, that is. 馃檪聽Isn’t it a privilege to be alive and to be able to savor all these little wonderful intellectual excursions? I wish you a very nice day and hope you enjoy stuff like this as much as I do. 馃檪

First Principles of Statistical Mechanics

Feynman seems to mix statistical mechanics and thermodynamics in his chapters on it. At first, I thought all was rather messy but, as usual, after re-reading it a couple of times, it all makes sense. Let’s have a look at the basics. We’ll start by talking about gases first.

The ideal gas law

The pressure P is the force we have to apply to the piston containing the gas (see below)鈥per unit area, that is. So we write: P = F/A. Compressing the gas amounts to applying a force over some (infinitesimal) distance dx. This will change the internal energy (U) of the gas by an infinitesimal amount dU. Hence, we can write:

dU = F路(鈭抎x) = 鈥 P路A路dx =聽鈥 P路dV

Gas pressure

However, before looking at the dynamics, let’s first look at the stationary situation: let’s assume the volume of the gas does not change, and so we just have the gas atoms bouncing of the piston and, hence, exerting pressure on it. Every gas atom or particle delivers a momentum 2mvx聽to the piston (the factor 2 is there because the piston does not bounce back, so there is no transfer of momentum). If there are N atoms in the volume N, then there are n = N/V in each unit volume. Of course, only the atoms within a distance vx路t are going to hit the piston within the time t and, hence, the number of atoms hitting the piston within that time is n路A路vx路t. Per unit time (i.e. per second), it’s n路A路vx路t/t = n路A路vx. Hence, the total聽momentum that’s being transferred聽per second is聽n路A路vx路2mvx.

So far, so good. Indeed, we know that the force is equal to the amount of momentum that’s being transferred per second. If you forget, just check the definitions and units: a force of 1 newton gives an mass of 1 kg an acceleration of 1 m/s per second, so 1 N = 1 kg路m/s2聽= 1 kg路(m/s)/s. [The聽kg路(m/s) unit is the unit of momentum (mass times velocity), obviously. So there we are.] Hence,

P = F/A = n路A路vx路2mvx/A = 2nmvx2

Of course, we need to take an average 鈱﹙x2鈱 here, and we should drop the factor 2 because half of the atoms/particles move away聽from the piston, rather than towards it. In short, we get:

P = F/A = nm鈱﹙x2

Now, the average velocity in the x-, y- and z-direction are all the same and uncorrelated, so 鈱﹙x2鈱 = 鈱﹙y2鈱 =聽鈱﹙z2鈱 = [鈱﹙x2鈱 + 鈱﹙y2鈱 + 鈱﹙z2鈱猐/3 =聽鈱﹙2鈱/3. So we don’t worry about any direction and simply write:

P = F/A = (2/3)路n路鈱﹎路v2/2鈱

[As Feynman notes, the math behind this is not difficult but, at the same time, it is also聽less straightforward than one might expect.] The last factor is, obviously, the kinetic energy of the (center-of-mass) motion of the atom or particle. Multiplying by V gives:

P路V =聽(2/3)路N路鈱﹎路v2/2鈱 = (2/3)路U

[If this confuses you, note that n = N/V, so V = N/n.] Now, that’s聽not聽a law you’ll remember from your high school days because… Well… This U – the internal energy of a gas – how do you measure that? We should link it to a measure we do know, and that’s聽temperature. The atoms or molecules in a gas will have an聽average聽kinetic energy which we could define as… Well… That average should have been defined as the temperature but, for historical reasons, the scale of what we know as the ‘temperature’ variable (T) is different. We need to apply a conversion factor, which is usually written as k. In fact, the conversion factor will be (3/2)路k. The 3/2 factor has been thrown in here to get rid of it later (in a few seconds, that is). To make a long story short, 聽we write the mean atomic or molecular energy as (3/2)路k路T = 3kT/2.

Now, you should also remember that we have three independent directions of motion. Hence, the kinetic energy associated with the component of motion聽in any of the three directions聽x, y or z is only 1/2 kT = (3kT/2)/3 = kT/2. [This seems trivial, but the idea of associating energy with some聽direction聽is actually quite fundamental.] Now,聽I said we’d get rid of that 3/2 factor. Indeed, applying the above-mentioned definition of temperature, we get:

P路V = (2/3)路N路鈱﹎路v2/2鈱 = (2/3)路N路3kT/2 =聽N路k路T

Now that聽is a formula you may or may not remember from your high school days! 馃檪聽The k factor is a constant of proportionality, which makes the units come out alright. The P路V =聽(2/3)路U formula tells us both sides of the equation must be expressed in joule (J), i.e. the dimension of energy. Now, N is a pure number, so our k in that N路k路T expression must be expressed in joule per degree (Kelvin). To be precise, k is (about) 1.38脳10鈭23 joule for every degree Kelvin, so it’s a very tiny constant: it’s referred to as the Boltzmann constant and it’s usually denoted with a capital B as subscript (kB). As for how the product of pressure and volume can (also) yield something in joule, you can work that out for yourself, remembering the definition of a joule. […] Well… OK. Let me do it for you: [P]路[V] = (N/m2)路m3聽= N路m = J. 馃檪

One immediate implication of the formula above is that gases at the same temperature and pressure, in the same volume, must consist of an equal number of atoms/molecules. You’ll say: of course – because you remember that from your high school classes. However, thinking about it some more – and also in light of what we’ll be learning a bit later on gases composed of more complex molecules (diatomic molecules, for example) – you’ll have to admit it’s not all that obvious as a result.

Now, the number of atoms/molecules is usually measured in moles:聽one mole (or mol) is 6.02脳1023 units (more or less, that is). To be somewhat more precise, its CODATA value is 6.02214129(27)脳1023. That number is Avogadro’s number (or constant), after the Italian mathematical physicist Amedeo Avogadro – who stated that law above, which is referred to as Avogradro’s Law: gases at the same temperature and pressure, in the same volume, must consist of an equal number of atoms/molecules. Avogadro’s number is defined聽as聽the amount of any substance that contains as many elementary entities (e.g. atoms, molecules, ions or electrons) as聽there are atoms in 12 grams of pure carbon-12 (12C), the isotope of carbon with relative atomic mass of exactly 12 (also by definition). Avogadro’s constant is one of the base units in the International Systems of Units, usually denoted by NA聽or – as Feynman does – N0.

Now, if we reinterpret N as the number of moles, rather than the number of atoms, ions or molecules in a gas, we can re-write the same equation using the so-called universal or ideal gas constant, which is equal to R = (1.38脳10鈭23 joule)脳(6.02脳1023/mol) per degree Kelvin = 8.314 J路K鈭1路mol鈭1. In short, the ideal gas constant is the product of two other constants: the Boltzmann constant (kB) and the Avogadro number (N0). So we get:

P路V = N路R路T with N = no. of moles and R = kB路N0

As you can see, you need to watch out with all those different constants and notations in use.

The ideal gas law and internal motion

There’s an interesting and essential remark to be made in regard to complex molecules in a gas. A complex molecule is any molecule that is聽not聽mono-atomic.聽The simplest example of a complex molecule is a diatomic molecule, consisting of two atoms, which we’ll denote by A and B, with mass mA聽and mB聽respectively. A and B are together but are able to oscillate or move relative to one another. In short, we also have some internal motion here, in addition to the motion of the whole thing, which will also has some kinetic energy. Hence, the kinetic energy of the gas consists of two parts:

  1. The kinetic energy of the so-called center-of-mass motion of the whole thing (i.e. the molecule), which we’ll denote by M = mA聽+ mB, and
  2. The kinetic energy of the rotational and vibratory motions of the two atoms (A and B) inside the molecule.

We noted that for single atoms the mean value of the kinetic energy in one direction is kT/2 and that the total kinetic energy is聽3kT/2, i.e. three times as much. So what do we have here? Well… The reasoning we followed for the single atoms is also valid for the diatomic molecule considered as a single body of total mass M and with some聽center-of-mass velocity聽vCM. Hence, we can write that

M路vCM2/2 = (3/2)路kT

So that’s the same, regardless of whether or not we’re considering the separate pieces or the whole thing. But let’s look at the separate pieces now. We need some vector analysis here, because A and B can move in separate directions, so we have vA聽and vB聽(note the boldface used for vectors). So what’s the relation between聽vA聽and vB聽on the one hand, and vCM聽on the other? The analysis is somewhat tricky here but – assuming that the聽vA聽and vB representations themselves are some idealization of the actual rotational and vibratory movements of the A and B atoms – we can write:

聽聽 vCM聽= (mAvA聽+ mBvB)/M

Now we need to calculate聽鈱﹙CM2鈱, of course, i.e. the聽average velocity squared. I’ll refer you to Feynman聽for the details which, in the end, do lead to that M路vCM2/2 = (3/2)路kT equation. The whole calculation depends on the assumption that the relative聽velocity w =聽vA聽vB聽is not any more likely to point in one direction than another, so its聽average聽component in any direction is zero. Indeed, the聽interim聽result is that

M路vCM2/2 = (3/2)路kT + 2mAmBvAvB鈱/M

Hence, one needs to prove, somehow, that聽鈱vAvB鈱 is zero in order to get the result we want, which is what that assumption about the relative velocity w ensures. Now, we still don’t have the kinetic energy of the A and B parts of the molecule. Because A and B can move in all three directions in space, their average kinetic energy聽鈱﹎AvA2/2鈱 and 聽鈱﹎BvB2/2鈱 is also 3路k路T/2. Now, adding 3路k路T/2 and 3路k路T/2 yields 3kT. So now we have what we wanted:

  1. The kinetic energy of the center-of-mass motion of the diatomic molecule is (3/2)路k路T.
  2. The total energy of the diatomic molecule is the sum of the energies of A and B, and so that’s 3路k路T/2 + 3路k路T/2 = 3 k路T.
  3. The kinetic energy of the internal rotational and vibratory motions of the two atoms (A and B) inside the molecule is the difference, so that’s 3路k路T 鈥 (3/2)路k路T = (3/2)路k路T.

The more general result can be stated as follows:

  1. A r-atom molecule in a gas will have a kinetic energy of (3/2)路r路k路T, on average, of which:
  2. 3/2路k路T is kinetic energy of the center-of-mass motion of the entire molecule,
  3. The rest, (3/2)路(r鈭1)路k路T, is internal vibrational and rotational kinetic energy.

Another way to state is that, for an r-atom molecule, we find that聽the average energy for each ‘independent direction of motion’, i.e. for each聽degree of freedom in the system, is kT/2, with the number of degrees of freedom being equal to 3r.

So in this particular case (example of a diatomic molecule), we have 6 degrees of freedom (two times three), because we have three directions in space for each of the two atoms. A common error is to consider the center-of-mass energy as something separate, rather than including it as a part of the total energy. So always remember: the total kinetic energy is, quite simply, the sum of the kinetic energies of the separate atoms, which can be separated into (1) the kinetic energy associated with the center-of-mass motion and (2) the kinetic energy of the internal motions.

You see? It is not that difficult, is it? Let’s move on to the next topic.

The exponential atmosphere

Feynman uses this rather intriguing title to introduce Boltzmann’s Law, which is a law about densities. Let’s jot it down first:

n = n0e鈭扨.E/kT

In this equation, P.E. is the potential energy, k is our Boltzmann constant, and T is the temperature expressed in Kelvin. As for n0, that’s just a constant which depends on the reference point (P.E. = 0). What are we calculating here? Densities, so that’s the relative or absolute number of molecules per unit volume, so we look for a formula for a variable like n = N/V.

Let’s do an example: the ‘exponential’ atmosphere. 馃檪 Feynman models聽our ‘atmosphere’ as a huge column of gas (see below). To simplify the analysis, we make silly assumptions. For example, we assume the temperature is the same at all heights. That’s assured by the mechanism for equalizing temperature: if the molecules on top would have less energy than those at the bottom, the molecules at the bottom would shake the molecules at the top, via the rod and the balls. That’s a very theoretical set-up, of course, but let’s just go along with it. The idea is that – when thermal equilibrium is reached – the average kinetic energy of all molecules is the same.


So, if the temperature is the same, then what’s different? The pressure, of course, which is determined by the聽number聽of molecules per unit volume. The pressure must increase with lower altitude because it has to hold, so to speak, the weight of all the gas above it. Conversely, as we go higher, the atmosphere becomes more tenuous. So what’s the ‘law’ or formula here?

We’ll use our gas law: PV = NkT, which we can re-write as P = nkT with n = N/V, so n is the number of molecules per unit volume indeed. What’s stated here is that the pressure (P) and the number of molecules per unit volume (n) are directly proportional, with kT the proportionality factor. So we have gravity (the g force) and we can do a differential analysis: what happens when we go from h to h + dh? If m is the mass of each molecule, and if we assume we’re looking at unit areas (both at h as well as h + dh), then the gravitational force on each molecule will be mg, and ndh will be the total number of molecules in that ‘unit section’.

Now, we can write dP as dP = Ph+dh鈭 Ph聽and, of course, we know that the difference in pressure must be sufficient to hold, so to speak, the molecules in that small unit section dh. So we can write the following:

dP = Ph+dh鈭 Ph聽= 鈭捖爉路g路n路dh

Now, P is P = nkT and, hence, because we assume T to be constant, we can write the whole equation as dP = k路T路dn聽=聽鈭捖爉路g路n路dh. From that, we get a differential equation:


We all hate differential equations, of course, but this one has an easy solution: the equation basically states we should find a function for n which has a derivative which is proportional to itself. Of course, we know that the exponential function is such function, so the solution of the differential equation is:

n = n0路e鈭抦gh/kT

The n0聽factor is the constant of integration and is, as mentioned above, the density at h = 0. Also note that mgh is, indeed, the potential energy of the molecules, increasing with height. So we have a Boltzmann Law indeed here, which we can write as n = n0e鈭扨.E/kT. Done ! The illustration below was also taken from Feynman, and illustrates the ‘exponential atmosphere’ for two gases: oxygen and hydrogen. Because their mass is very different, the curve is different too: it shows how, in theory and in practice, lighter gases will dominate at great heights, because the exponentials for the heavier stuff have all died out.



It is easy to show that we’ll have a Boltzmann Law in any situation where the force comes from a potential. In other words, we’ll have a Boltzmann Law in any situation for which the work done when taking a molecule from x to x + dx can be represented as potential energy. An example would be molecules that are electrically charged and attracted by some electric field or another charge that attracts them. In that case, we have an electric force of attraction which varies with position and acts on all molecules. So we could take two parallel planes in the gas, separated by a distance dx indeed, and we’d have a similar situation: the force on each atom, times the number of atoms in the unit section that’s delineated by dx, would have to be balanced by the pressure change, and we’d find a similar ‘law’: n = n0e鈭扨.E/kT.

Let’s quickly show it. The key variable is, once again, the density聽n: n = N/V. If we assume volume and temperature remain constant, then we can use our gas law to write the pressure as P = NkT/V = kT路n, which implies that any change in pressure must involve a density change. To be precise, dP = d(kT路n) = kT路dn. Now, we’ve got a force, and moving a molecule from x to x + dx involves work, which is the force times the distance, so the work is F路dx. The force can be anything, but we assume it’s conservative, like the electromagnetic force or gravity. Hence, the force field can be represented by a potential and the work done is equal to the聽change聽in potential energy. Hence, we can write: Fdx = 鈥揹(P.E.). Why the minus sign? If the force is doing work, we’re moving with the force and, hence, we’ll have a decrease in potential energy. Conversely, if the surroundings are doing work聽against the force, we’ll increase potential energy.

Now, we said the force must be balanced by the pressure. What does that mean, exactly? It’s the same analysis as the one we did for our ‘exponential’ atmosphere: we’ve got a small slice, given by dx, and聽the difference in pressure when going from x to x + dx must be sufficient to hold, so to speak, the molecules in that small unit section dx. [Note we assume we’re talking聽unit聽areas once again.] So, instead of writing聽dP = Ph+dh鈭 Ph聽= 鈭捖爉路g路n路dh, we now write dP = F路n路dx. So, when it’s a gravitational field, the magnitude of the force involved is, obviously, F = m路g.

The minus sign business is confusing, as usual: it’s obvious that dP must be negative for positive dh, and vice versa, but here we are moving with聽the force, so no minus sign is needed. If you find that confusing, let me give you another way of getting that dP = F路n路dx聽expression. The pressure is, quite simply, the force times the number of particles, so P = F路N. Dividing both sides by V yields P/V = F路N/V = F路n. Therefore, P = F路n路V and, hence, dP must be equal to dP = d(F路n路V) = F路n路dV = F路n路dx. [Again, the assumption is that our unit of analysis is the unit area.] […] OK. I need to move on.聽Combining (1) dP = d(kT路n) = kT路dn, (2) dP = F路n路dx and (3) Fdx = 鈥揹(P.E.), we get:

kT路dn = 鈥揹(P.E.)路n聽鈬 dn/d(P.E.) = 鈭抂1/(kT)]路n

That’s, once again, a differential equation that’s easy to solve. Indeed, we’ve repeated it ad nauseam: a function which has a derivative proportional to itself is an exponential. Hence, we have our grand equation:

n = n0e鈭扨.E/kT

If the whole thing troubles you, just remember that the key to solving problems like this is to clearly identify and separate the so-called ‘dependent’ and ‘independent’ variables. In this case, we want a formula for n and, hence, it’s potential energy that’s the ‘independent’ variable. That’s all. In case of doubt: just do the derivation: d(n0e鈭扨.E./kT)/d(P.E.)聽= 鈭抧0e鈭扨.E/kT路1/(kT) = 鈭抧/(kT).

The graph looks the same, of course: the density is greatest at P.E. = 0. To be precise, the density there will be equal to n =聽n0e0聽= n0聽(don’t think it’s infinity there!). And for higher (potential) energy values, we get聽lower聽density values. It’s a simple but powerful graph, and so you should always remember it.


Boltzmann’s Law is a very simple law but it can be applied to very聽complicated situations. Indeed, while the law is simple,聽the potential energy curve can be very complicated. So our Law can be applied to other situations than gravity or the electric force. The potential can combine a number of forces (as long as they’re all conservative), as shown in the graph below, which shows a situation in which molecules will attract each other at a distance r聽> r0聽(and, hence, their potential energy decreases as they come closer together), but repel each other strongly as r becomes smaller than r0聽(so potential energy increases, and very much soas we try to force them on top of each other).

Potential energy

Again, despite the complicated shape of the curve, the density function will – in essence – follow Boltzmann’s Law: in a given volume, the density will be highest at the distance of minimum energy, and the density will be much less at other distances. So, yes, Boltzmann’s Law is pretty powerful !