I have been following Blundel's "Concepts of thermal Physics" and I got to the derivation of the ideal gas law. And it all made sense, we made a couple of assumptions and approximations, but then I got to an exercise that doesn't make a lot of sense to me:

"If a room is initially at 18ºC and is then heated up to 25ºC what happens to the total energy of the air in the room?"

That seems a straight forward question and an attempt of solution is: $$\langle E\rangle =uV=\frac{1}{2}Nm\langle v^2 \rangle$$ as $\langle v^2 \rangle=3\frac{k_B T}{m}$ we get: $$\langle E\rangle =\frac {3}{2}NK_BT$$ where $u$ is the energy density, $V$ is the volume of the room, and $\langle E\rangle$ is the mean kinetic energy of the gas in the room. After this we could just compare for both temperatures.

But doing this we are only considering kinetic energy. Throughout the derivation we ignored all kinds of motion a particle and considered only translational energy, but even doing this a particle still has 2 ways of having energy: kinetic and potential. We obviously didn't ignore the mass of a particle otherwise it wouldn't have kinetic energy either. so the particles still have mass, therefore it must have potential energy! I get that in the comparison of the energy at both temperatures, as the room stays still, the potential energy cancels out, but then saying that the mean energy of the room at a temperature $T$ is $\langle E\rangle =\frac {3}{2}NK_BT$ is inclomplete!

How do I describe the total energy of a room at temperature $T$?

  • 1
    $\begingroup$ And some air will leave the room... $\endgroup$
    – user137289
    Oct 27, 2018 at 11:26
  • $\begingroup$ yes, but assume not. All the air stays in the same room always. $\endgroup$
    – Bidon
    Oct 27, 2018 at 11:27
  • $\begingroup$ You mean that air at a higher point in the room should have more energy than air at a lower point? $\endgroup$ Oct 27, 2018 at 11:36
  • 1
    $\begingroup$ Due to the room's size you are not considering the difference in potential energy between particles at differeht heights. $\endgroup$
    – user65081
    Oct 27, 2018 at 11:43
  • $\begingroup$ @Wolphramjonny The height distribution does not change much with temperature. Potential energy does not matter. What changes is the rotational kinetic energy of air molecules. $\endgroup$
    – user137289
    Oct 27, 2018 at 14:08

2 Answers 2


Let's look at the ratios between the average kinetic energy (for one particle) and the change in potential energy between the bottom and top of our container. $$\frac{K}{\Delta U}=\frac{\frac 32 k_BT}{mgh}$$

Air is made of many types of particles, but nitrogen is the most common, so let's work with that. The mass of an $\rm N_2$ molecule is $4.65\times10^{-26}\ \rm{kg}$, and let's say the height of the room is about $3\ \rm m$. Then for $T=295 \ \rm K$ (around the middle of your temperature range) we have $$\frac{\frac 32 k_BT}{mgh}\approx 4.5\times 10^3$$

So the kinetic energy is much larger than the potential difference between the top and bottom of the room, which is why we tend to ignore it. You do have do consider potential energy when looking at larger heights, like when analyzing the atmosphere for example.

  • 2
    $\begingroup$ 15 sounds a little small. Did you perhaps drop a factor of 10 or 100? $\endgroup$
    – knzhou
    Oct 27, 2018 at 14:36
  • $\begingroup$ @knzhou Better? $\endgroup$ Oct 27, 2018 at 21:20

This is where we get into some of the complexities of how we actually define the 'total' energy. As far as gravity is concerned, physics only depends on changes in the potential energy, not its absolute value; we can add a constant to the potential energy and get the same predictions! So the 'total potential energy' is not an entirely well-defined quantity.

As far as ideal gas theory is concerned, we treat gas particles as rigid balls and ignore any intermolecular interactions. So in this approximation, we ignore any electromagnetic forces between particles. (If we wanted to add them, we would reach something like the van der Waals model which I'm sure will come up later in the book you're working through, or one of many others!)

But what about gravitational potential energy? This is defined up to a constant, but there might still be differences in gravitational potential energy between the two situations, because the distribution of air density changes.

Just how much?

Since we're assuming uniform temperature, and assuming a uniform gravitational field, we can calculate the distribution of density in hydrostatic equilibrium. In hydrostatic equilibrium, the pressure and density are functions of height, but we still take them to be related by the ideal gas law $mP(z)=\rho(z) k_BT$. We have $$\frac{dP}{dz}=-\rho(z)g=-\frac{mg}{k_BT}P(z)$$ with the solution $$\rho(z)=\rho_0\exp\left(-\frac{mgz}{k_BT}\right)$$We set the density of air at ground level, $\rho_0$ by requiring that the total mass of particles in the gas is constant: $$\int_\text{room} \rho(z) dV = M$$ If we assume the room has floor area $A$ and height $h$, this becomes $$M=A\int_0^h \rho(z) dz = \frac{A\rho_0 k_B T}{mg}\left(1-\exp\left(-\frac{mgh}{k_BT}\right)\right)$$We can rearrange this to find $\rho_0$ as a function of temperature: $$\rho_0=\frac{Mmg}{Ak_B T \left(1-\exp\left(-\frac{mgh}{k_BT}\right)\right)}$$

Having found the density as a function of height, we can calculate the potential energy of the gas.

The gravitational potential energy density of a piece of gas at height $z$ above the zero-potential-energy reference level is just $u(z)=\rho(z) g z$. So the total potential energy of the whole room is $$U=\int_\text{room} u(z)\,dV=\int_\text{room} \rho(z) g z\thinspace dV=\int_\text{room}gz\rho_0\exp\left(-\frac{mgz}{k_BT}\right)dV$$ and with our area $A$ and height $h$, this becomes $$U=Ag\rho_0\int_0^h z\exp\left(-\frac{mgz}{k_BT}\right)\,dz$$

To calculate this, we can use a standard integral result: $$\int_0^h z \exp \left(-\frac{z}{C}\right)=C^2\left(1-\left(1+\frac{h}{C}\right)\exp\left(-\frac{h}{C}\right)\right)$$which we can use with $C=\frac{k_B T}{mg}$to find (deep breath)... $$U=\frac{A \rho_0 k_B T}{m}\cdot\frac{k_B T}{mg}\left(1-\left(1+\frac{mgh}{k_B T}\right)\exp\left(-\frac{mgh}{k_B T}\right)\right)$$

We can combine this with our earlier result for $\rho_0$: $$U=\frac{Mk_B T}{m}\cdot\frac{1-\left(1+\frac{mgh}{k_B T}\right)\exp\left(-\frac{mgh}{k_B T}\right)}{1-\exp\left(-\frac{mgh}{k_BT}\right)}$$

Rearranging this slightly to clean it up, we get $$\begin{align*}U&=\frac{Mk_B T}{m}\cdot\frac{\exp\left(\frac{mgh}{k_B T}\right)-\left(1+\frac{mgh}{k_B T}\right)}{\exp\left(\frac{mgh}{k_BT}\right)-1}\\&=\frac{Mk_B T}{m}\left(1-\frac{mgh}{k_BT}\frac{1}{\exp\left(\frac{mgh}{k_BT}\right)-1}\right)\\&=\frac{Mk_B T}{m}-\frac{Mgh}{\exp\left(\frac{mgh}{k_BT}\right)-1}\\&=Nk_B T - \frac{Nmgh}{\exp\left(\frac{mgh}{k_B T}\right)-1}\end{align*}$$ where in the last line we've used that the total mass is $M=Nm$.

So in answer to your question, the total energy of the ideal gas in a uniform temperature room of area $A$ and height $z$ in hydrostatic equilibrium would be (assuming I haven't made a mistake in the derivation above)...

$$E=\frac{5}{2}Nk_B T - \frac{Nmgh}{\exp\left(\frac{mgh}{k_B T}\right)-1}$$

plus a constant.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.