# Why does the energy of a thermodynamic system depend on the volume?

In thermodynamics one assumes that the energy (or other observables) of the system only depend on a few parameters like the temperature, the particle number and also the volume:

$$dE = \left(\frac{\partial E}{\partial T}\right) dT + \left(\frac{\partial E}{\partial N}\right) dN + \left(\frac{\partial E}{\partial V}\right) dV := SdT + \mu dN - pdV$$.

Why is the volume enough to describe the whole geometry and details of the container? Why isn't there another term e.g. for the surface? Or some geometry dependence?

On the microscopic level the energy levels depend on the geometry (For example a spherical and a rectangular box have different energy levels.). Also like in the case of a gas trapped in a harmonic oscillator potential $$V(x) = k\cdot x^2$$ there is no well-defined "volume" of the gas. However if one would increase $$k$$ one would also increase the energy of the system. So in this case the energy depends on $$k$$ and not on the volume (Probably there is some way to calculate the characteristic gas "volume" out of $$k$$, but this would be only a rough estimate.).

Is there any argumentation (from a fundamental point of view) why the energy of a huge system only depends on the volume and one can neglect everything else?

EDIT: As I understood thermodynamics you basically start from the microscopic point of view. There you have a Hamiltonian. Then one imposes a density matrix (micro canonical, canonical, grand canonical). This defines the whole dynamics of the system. Then you take the limit $$N \to \infty$$ (this allows replacing the sum over all states by the integral). This can be exactly done in the case of a ideal gas in a rectangular container. There you find out that the energy of the system only depends on the temperature $$T$$, the particle number $$N$$ and the volume $$V$$. Calculating the total differential of the energy $$E = \left(\frac{\partial E}{\partial T}\right) dT + \left(\frac{\partial E}{\partial N}\right) dN + \left(\frac{\partial E}{\partial V}\right) dV := SdT + \mu dN - pdV$$ one can find expressions for $$S,\mu$$ and $$p$$ which are defined by this equation.

For all other systems where one cannot solve it exactly one imposes that after taking $$N \to \infty$$ the energy only depends on $$T, N$$ and $$V$$. For me it's completely clear that the energy depends on $$N$$ (since the Hamiltonian is linear with the particle number) and on $$T$$ (because it is part of the density matrix).

Apart from that it is also quite clear that there must be a term that represents the change in the potential (i.e. work). According to the first law this work is only given by the change in volume. That is the point I don't understand: why should the change of potential energy only depend on the volume for $$N \to \infty$$?

Two examples for that:

1. There are potentials (like the harmonic oscillator, but many more) where there is no fixed border and so there is no sensible definition of volume. In the case of a harmonic oscillator I can also solve it explicitly and find that the change of the potential energy depends on $$\omega_x\omega_y\omega_z$$ which one can relate to a "typical volume" $$V$$ of the harmonic oscillator. Using this volume I can the bring the energy dependence in the same form as in the first law. However for any other potential I would need to guess a "typical volume" $$V$$ (since I can't solve the equations). Even if I can find a equation that looks like the first law and has a term $$\sim dV$$ the pressure would depend on my "typical volume" (for example if I choose my "typical volume" to be twice as big then the pressure has only half of its value). This sounds pretty strange to me because if I have a gas trapped in a harmonic potential I can measure the pressure and get some well defined value.

2. My second idea was that maybe one only considers system where the potential is either 0 or infinite. There one has a fixed geometry. But if I don't have a rectangular geometry the energy levels differ. So there is a clear dependence on the geometry. So why in the limit $$N \to \infty$$ only a term depending on the volume survives? This means that if I change the geometry of my container completely but keep the volume constant nothing changes. I don't see any fundamental reason why this should be the case.

• In a plain language, notice the infinitisimal $dV$. Even you have "various shape" of volume, you can always partition the shape of volume into many small cubic. If you still consider the particle in the thermalstatic is "real", you can even put each atom in separatable small box that contains it. The fact that you are writing $dV$, means that in most of the case shape didn't matter. (Butm however, consider the extreame case where gas or fluid was confined into a 2D surface, then the expression won't work in a traditional sense and need adjustion or approximations.) – J C Oct 13 '18 at 5:58
• @JC But these $dV$'s aren't partitions of a volume in the sense you mention are they? Don't they represent an actual physical change in volume? – Aaron Stevens Oct 13 '18 at 11:04
• @user208288 "This means that if I change the geometry of my container completely but keep the volume constant nothing changes" With a constant volume $dV=0$. The $dV$ term depends on the geometry of the system. Keep in mind that this equation represents a change in energy due to changes in other quantites. So if you pick a new container with the same volume then yes, you have the same energy, but your equation specifically deals with changes in volume, which does depend on geometry. This is discussed in my answer. – Aaron Stevens Oct 13 '18 at 12:12
• I'm not sure if I understand you. The first law states that $E$ is a potential (in the sense that it does not matter how you have reached this state it only depends on the state). Otherwise one would write $\delta E$ instead of $dE$. Also the energy only depends on $E = E(T, N, V)$ because otherwise there would be more terms appearing there (like a term $M dB$ if you have a magnetic field). So if we fix T and N and change the geometry such that $V = \mathrm{const.}$ according to the first law the energy does not change. However in the microscopic view the energy depends on the geometry detail. – toaster Oct 13 '18 at 15:26
• Ok but that's a different question. $-pdV$ represents the system doing work on the environment. It says nothing about different shaped systems with the same volume. It seems like your most recent comment really should be your question about $E(T,N,V)$ – Aaron Stevens Oct 13 '18 at 18:47

If we look just at the part of your equation dealing with volume: $$\rm d E=-p\ \rm d V$$

All this term is saying is that if a system increases its volume by pushing the surrounding environment out of the way, then it must do work on the environment. It gives you a change in energy of the system due to a volume change when the system is experiencing a pressure from the environment. It is not saying that the total energy only has volume dependence in terms of geometry.

You could also argue that the change in volume $$\rm d V$$ depends on the geometry of the container. For example for a moving piston $$\rm d V=A\ \rm d x$$ where $$\rm A$$ is the area of the piston and $$\rm d x$$ is the length the piston moves. For an expanding sphere $$\rm d V=4\pi r^2\ \rm d r$$.

If a system's energy does have an explicit dependency on something like surface area, then of course this would need to be considered if you wanted to calculate the overall energy of the system. For example, in biophysics studies on pores in plasma membrane lipid bilayers, there is a surface area term in determining the energy of a pore.

• "All this term is saying is that if a system increases its volume by pushing the surrounding environment out of the way, then it must do work on the environment." it's not saying that, actually, as $dE$ is not work. Further, a counterexample is easily found: a gas expanding in outer space performs no work on the environment and the internal energy doesn't change, yet volume expands to infinity. But OP's equation is still valid! – Al Nejati Oct 13 '18 at 4:57
• @AlNejati in space $p=0$. This is why I specify work on the surrounding environment. Also, I know that in general $dE$ is not the work the system does, but this is also why at the beginning of the answer I said I would only be focusing on the volume term. $-pdV$ does correspond to work being done. Therefore, I don't think your objections are valid. However, I would be happy to make edits if you can make more compelling arguments. – Aaron Stevens Oct 13 '18 at 5:06
• $p$ refers to the pressure of the gas, not the pressure of the environment. Further, the thought experiment still works if you don't allow the gas to expand infinitely, but instead to expand inside a large but finite container. – Al Nejati Oct 13 '18 at 5:10
• @AlNejati ok, then what do you think $-pdV$ represents? – Aaron Stevens Oct 13 '18 at 5:18
• I don't see where you're going with this, can you expand that question a bit? – Al Nejati Oct 13 '18 at 5:23

I see several informative answers here, but I want to make a couple of points which I don't feel have been given enough emphasis. Specifically I want to address these questions in the OP:

Why is the volume enough to describe the whole geometry and details of the container? Why isn't there another term e.g. for the surface? Or some geometry dependence?

This is bound up with the physics behind identifying some thermodynamic variables as extensive, and others as intensive. And actually, the situation is not always as clear as you might think.

Quite generally, there is a surface term in the energy, free energy, etc, relating to the container walls, and it can be expressed as an integral, over the surface, of the interfacial free energy per unit area, $$\gamma$$. In the simplest case, we can write it as $$\gamma A$$, where $$A$$ is the relevant area, and it comes into the thermodynamics through $$\gamma dA$$ terms, analogous to $$-p dV$$ terms. So this does depend on the nature of the surface, and the geometry of the sample. It is also familiar when one focuses on the thermodynamics of the interface between two phases in coexistence, when $$\gamma$$ is the usual surface tension. Minimizing the $$\gamma A$$ term, i.e. minimizing $$A$$ for fixed $$V$$, is what leads to spherical droplets of a liquid in a gas, for example. In any case, the term is not extensive: for a given shape $$A\propto V^{2/3}$$ .

The reason this is neglected in most treatments of thermodynamics is that it is a very small contribution relative to the bulk (extensive) energy: roughly speaking, it is a surface-to-volume ratio, multiplied by a characteristic length $$d$$: the distance over which the molecules of our sample interact with the container walls. Most intermolecular interactions (e.g. Lennard-Jones) have a very short range in macroscopic terms, so we are safe to say that $$Ad \ll V$$ and the surface term may be dropped.

However, there are now (at least) three obvious scenarios where we can't do this. The first is where we are especially interested in the surface itself, as mentioned above. Wetting phenomena and capillary condensation, are examples.

The second is where $$A$$ is unusually large. An example is the adsorption of gases on the (largely interior) surfaces of microporous materials, where the interfacial area multiplied by the interaction range can dominate over the bulk thermodynamics. I'll include here cases where the volume $$V$$ is unusually small: the thermodynamics of nanoparticles, or the growth of a critical nucleus during crystallization, for instance.

The third is where the interactions between molecules are long range, not short range. This is potentially a very serious situation in statistical mechanics, because it includes ions and dipoles! And gravity! (Not that I'm suggesting we have container walls in astrophysics, though). For a paper discussing the consequences (for example, non-additivity of thermodynamic quantities) see this paper by David Mukamel Long-Range Interacting Systems also published in Lecture Notes of the Les Houches Summer School, vol 90. An example given in that paper is the case of dipolar ferromagnets, when the energy does depend on the shape of the sample. Mostly, in condensed matter physics, practically, we can rely on screening of charges and dipoles to mitigate these worries, but it is a delicate fundamental point.

So I just thought I'd add this to the mix. Hope it's helpful.

• "The reason this is neglected in most treatments of thermodynamics is that it is a very small contribution relative to the bulk (extensive) energy: roughly speaking, it is a surface-to-volume ratio": Is there any mathematical derivation that the volume gives the leading term? – toaster Oct 13 '18 at 18:48
• The argument is basically one of counting the interactions within a volume. It is the same one that leads to the idea that energy is an extensive quantity. If you take a macroscopic system, and make a planar cut to divide it into two halves, you are just losing the interactions which used to cross the plane. Provided the interactions are short ranged, this only makes a difference of order $Ad$. The rest of the interactions scale with the volume: half of them appear in each half of the system. – user197851 Oct 13 '18 at 19:13

Why is the volume enough to describe the whole geometry and details of the container? Why isn't there another term e.g. for the surface? Or some geometry dependence?

By definition, the volume DOES specify the whole geometry of a 3D container: you can obtain properties about the surface of the container, and even its perimeter, with some calculus if you know the volume.

Generically, we're interested in volumes because that's where gases typically are confined to: three spatial dimensions. For most purposes in fundamental thermodynamics, we are dealing with volumes. Having a purely 2D gas is hard, very hard - we have to go to the nanoscale to actually obtain this with electrons (the so called 2DEG). Or, as Aaron stated in his answer, some biological systems depend on other spatial quantities than volume and must be accounted for.

On the microscopic level the energy levels depend on the geometry (For example a spherical and a rectangular box have different energy levels.). Also like in the case of a gas trapped in a harmonic oscillator potential there is no well-defined "volume" of the gas.

Indeed, in quantum mechanics a particle in a square well will have different energy levels than in a triangular well - the geometry certainly matters! But, one can actually define a "volume" of a gas in such a "container" (you might not like this next bit). Essentially, no matter what type of system you consider, you can express a fundamental length scale. Then, cube this length scale and now you have a unit volume for your system that is well-defined. But I don't think that's quite what you mean.

Also like in the case of a gas trapped in a harmonic oscillator potential V(x)=k⋅x2 there is no well-defined "volume" of the gas. However if one would increase k one would also increase the energy of the system. So in this case the energy depends on k and not on the volume

Specifically regarding the harmonic oscillator potential, you're correct in that the energy of a single particle in the potential depends on its wavenumber, $$k$$, or equivalently the frequency, and not the volume that contains the entire gas. However, the energy of the system - the ensemble averaged energy - will or will not depend on the volume depending on how the system interacts with its environment. If you study your system in the microcanonical ensemble, where the particle does not interact with an environment, we have

$$\langle E \rangle = \frac{\int H e^{-\beta H} d\tau}{\int e^{-\beta H} d\tau}$$

where $$H$$ is the Hamiltonian of your system, $$\beta = \frac{1}{k_{B} T}$$, and $$d\tau$$ is a volume element in the phase space of energy (or equivalently frequency).

Instead, if you study your system in the canonical ensemble, where the system exchanges energy with an environment, we have

$$\langle E \rangle = - \frac{\partial}{\partial \beta} ln(Z)$$

where $$Z$$ is the partition function, and in the case of the harmonic oscillator is solved here and here.

However, if you study the system in the grand canonical ensemble, where the system exchanges energy and particles with an environment, then every quantity of interest directly depends on the volume (which should make sense, since the particle number is changing), for instance,

$$Y = - \frac{ln(\zeta)}{\beta} = -pV$$

where Y is the grand thermodynamic potential, and $$\zeta$$ is the grand canonical partition function, which clearly depends on the volume!

Often, we can solve for all the relevant quantities (energy, number density, entropy, etc...) without specifying the volume that we assume our fluid to be within. The essential physics is independent of the actual shape of the container, which only becomes relevant when you try to actually compute quantities (or you can just write your quantities per unit volume and call it a day). For instance, for an ideal gas of N non-interacting particles, the total partition function is

$$Z = \frac{(Z_{o})^{N}}{N!}$$

where we have that

$$Z_{o} = \frac{V}{\lambda^{3}}$$

where $$V$$ is the volume and $$\lambda$$ is the thermal wavelength which depends on the temperature and mass of the particles.

Lastly, a more conceptual answer to "why volume?" The first law of thermo. is of course a statement of energy, and in classical physics there is the widespread (meaning it touches many fields) use of generalized force and displacement pairs. There's no doubt, I hope, in your mind that the $$pV$$ term in your equation corresponds to some change in energy of the system? The pressure is the "generalized force" and the volume is the "generalized displacement" in this example, and it's true for the other terms in your equation. To express a change in energy, we conceptualize an agent (the force) and an extent (the displacement).

• I don't really see how any of this answers the question. You've produced some equations for the partition function for various systems but the reason for volume dependency is not clear. In addition, for the canonical ensemble (say, an ideal gas in thermal contact with a reservoir), changing the volume does change the energy. – Al Nejati Oct 13 '18 at 4:39
• I submitted this answer before the OP edited their question, so it might not answer everything. I interpreted their original question as asking: 1) why the energy depend on volume for some systems and not others? My answer for this is that it depends on the system and how you statistically examine it, i.e. the simple harmonic oscillator energy is independent of volume in the canonical ensemble, but the ideal free particle energy is dependent on volume in the canonical ensemble. – N. Steinle Oct 13 '18 at 14:27
• 2) why does volume appear in the first law? My answer for this is in the paragraph discussing generalized forces and displacements. – N. Steinle Oct 13 '18 at 14:27

This sort of relation arises from analyzing the grand canonical ensemble of an ideal gas, but it also arises for other, similar systems.

For an ideal gas, the easiest way to understand why volume enters the picure might be think about what happens if you change the volume without changing internal energy or number of particles. That is: $$dE$$ = 0. Then:

$$SdT = pdV$$

That is, $$SdT$$ exactly balances out $$pdV$$. This might happen if, for example, you have some gas in a piston and you compress it isothermally. For an ideal gas, the internal energy is just the sum of the kinetic energies of the particles. So during an isothermal process, the internal energy shouldn't change. Yet clearly you need to do work on the gas to compress it. So where has this energy gone? When you compress the gas, it heats up a bit, and gives off this heat to the environment. This thermal energy $$SdT$$ must be exactly balanced by the $$pdV$$ energy, otherwise you would have a net change in internal energy.

As to your other questions. As to why volume is important and not the specific geometry, again think about what the internal energy of an ideal gas is. It is just the sum of the kinetic energies of the particles. Clearly if you change the shape of the container without changing its volume or number of particles, the sum of the kinetic energies of the particles isn't going to change.

For other systems like harmonic oscillator potentials etc., one either carefully sets the system up so that that equation is still valid, or else the equation may not be valid. One random counterexample, for instance, is when you have surface interactions. In that case, the specific shape of the container is important - more surface area may lead to lower or higher energy, and your equation would not be valid.

• "Clearly if you change the shape of the container without changing its volume or number of particles, the sum of the kinetic energies of the particles isn't going to change." Why is this the case? On a microscopic level, changing the geometry from a box to a spherical potential well changes the energy levels and therefore has some impact on the systems energy. – toaster Oct 13 '18 at 13:16
• @user208288 why are you ignoring what I am saying. $dE=-pdV$ represents a change in energy due to a change in volume. It is not saying "the only geometry energy solely depends on is the volume". If this is wrong please let me know, and I will adjust my answer accordingly. – Aaron Stevens Oct 13 '18 at 15:28
• @AaronStevens sorry I'm not sure what you mean exactly. Of course $dE = -p dV$ represents the change in energy if I change the volume. The way the first law is written it means that the geometry energy depends only the volume. If the geometry energy would also depend on another quantity $a$ (like the surface area, the surface curvature or whatever else) there would be another term $dE = -p dV - k da$. – toaster Oct 13 '18 at 18:44
• @user208288 Right. I think I just don't understand your question fully. It seems like each answer has good information though. – Aaron Stevens Oct 13 '18 at 20:01
• I see that you don't understand the question fully. I am not sure how to describe it better. From the microscopic point of view the energy change due to a potential change does not only depend on the change of the volume but rather is a complicated function of the whole container geometry. From the macroscopic point of view the energy change only depends on the volume change independent of the specific geometry. What happens to the geometry dependence, when going from microscopic to macroscopic (i.e. $N \to \infty$)? – toaster Oct 13 '18 at 20:23

I think I have found an answer, at least for a gas in a container with arbitrary geometry. Suggest we have given a potential $$V(x)$$ which is $$V(x) = 0$$ inside the container and $$V(x) = V_0$$ with $$V_0 \to \infty$$. So the (one particle) Hamiltonian is given by $$H_1 = \frac{p^2}{2m} + V(x)$$. The most important quantity in statistical physics is the partition function $$Z = \mathrm{Tr} e^{-\beta H}$$. To calculate the trace we can use any basis we like, so let's use the momentum basis ($$\hbar = 1$$): $$|p\rangle = \int \frac{d^3x}{\sqrt{2\pi}^3} e^{ipx} |x\rangle$$.

$$Z = \mathrm{Tr} e^{-\beta H} = \left(\int d^3p\,\langle p|e^{-\beta H_1}|p\rangle\right)^N$$

To lowest order one can write $$e^{-\beta H_1} \approx e^{-\beta \frac{p^2}{2m}}e^{-\beta V}$$. Inserting this gives: $$Z = \left(\int d^3p\,e^{-\beta \frac{p^2}{2m}}\langle p|e^{-\beta V}|p\rangle\right)^N$$ The bra-ket part is given by the Fourier transform of $$e^{-\beta V(x)}$$ at $$0$$: $$\langle p|e^{-\beta V}|p\rangle = \int \frac{d^3 x}{(2\pi)^3} e^{-\beta V(x)}$$ For $$V_0 \to \infty: e^{-\beta V(x)} \to 0$$ outside the container and $$e^{-\beta V(x)} = 1$$ inside the container. Therefore $$\langle p|e^{-\beta V}|p\rangle = \int_{\mathrm{container}} \frac{d^3 x}{(2\pi)^3} = \frac{V_\mathrm{container}}{(2\pi)^3}$$ Inserting in the second formula: $$Z = \left(\frac{V_\mathrm{container}}{(2\pi)^3} \int d^3p\,e^{-\beta \frac{p^2}{2m}}\right)^N$$ From now on everything is exactly equal to the case of a rectangular box (using classical thermodynamics). So the only dependence of $$Z$$ on the geometry is given by the volume of the container.

The only problematic step is $$e^{-\beta H_1} \approx e^{-\beta \frac{p^2}{2m}}e^{-\beta V}$$. I have actually no idea why one can neglect higher order terms. However I am quite sure that this is correct since it recovers the result from classical thermodynamics (This is not a good proof though :D).

To neglect higher order terms one needs to show that one can neglect $$\beta^2 [\frac{p^2}{2m}, V] \ll 1$$. Qualitatively this commutator is $$\sim V'(x)$$ which is only nonzero at the border of the container (something like a delta-peak at the border). This means the next order terms only depend on the surface geometry of the container. Do you have any idea why this term is neglectable?

• "So the only dependence of $Z$ on the geometry is given by the volume of the container." You already state this as true in your question. I thought the point of your whole question was why only the volume appears and not other geometry dependence? – Aaron Stevens Oct 15 '18 at 2:27
• yes. and this shows that there is no geometry dependence. – toaster Oct 15 '18 at 18:01