Skip to main content
Chemistry LibreTexts

17.5: Pressure in Terms of Partition Functions

Pressure can also be derived from the canonical partition function. The average pressure is the sum of the probability times the pressure

From thermodynamics, pressure is expressed as

so we can write


In a few steps we can show that the temperature can be expressed in terms of the partition function.

 The derivative of the partition function with respect to volume is

The average pressure can then be written as

Which shows that the pressure can be expressed solely terms of the partition function.


 We can use this result to derive the ideal gas law. For N particles of an ideal gas


is the translational partition function. The utility of expressing the pressure as a logarithm is clear from the fact that we can write

We have used the property of logarithms that ln(AB) = ln(A) + ln(B) and ln(XY) = Yln(X). Only one term in the ln Q depends on V.


Taking the derivative of NlnV with respect to V gives

Substituting this into the above equation for the pressure gives P=NkT/V which is the ideal gas law. Recall that Nk = nR where N is the number of molecules and n is the number of moles. R is the universal gas constant (8.314 J/mol-K) which is nothing more than k multiplied by Avagadro’s number. NAk = R converts the constant from a "per molecule" to a "per mole" basis.




Let us consider a simple thought experiment, which is illustrated in the figure below: A system of \(N\) particles is

FIG. 3.1: Illustration of a thought experiment in which a system is compressed via a piston pushed into the system along the positive \(z\) axis.

compressed by a piston by pushing the piston in the positive \(z\) direction. Since this is a classical thought experiment, we think in terms of forces. The piston exerts a constant force of magnitude \(F\) on the system. The direction of the force is purely in the positive \(z\) direction, so that we can write the force vector \(\textbf{F}\) as \(\textbf{F} = \begin{pmatrix} 0, 0, F \end{pmatrix}\). The system exerts an equal and opposite force on the piston of the form \(\begin{pmatrix} 0, 0, -F \end{pmatrix}\). If the energy of the system is \(E\), then the force exerted by the system on the piston will be given by the negative change in \(E\) with respect to \(z\):

\[-F = -\dfrac{dE}{dz} \label{Eq3.29}\]


\[F = \dfrac{dE}{dz} \label{Eq3.30}\]

The force exerted by the system on the piston is manifest as an observable pressure \(P\) equal to the force \(F\) divided by the area \(A\) of the piston, \(P=F/A\). Given this, the observed pressure is just

\[P = \dfrac{dE}{Adz} \label{Eq3.31}\]

Since the volume decreases when the system is compressed, we see that \(Adz = -dV\). Hence, we can write the pressure as \(P = -dE/dV\).

Of course, the relation \(P = -dE/dV\) is a thermodynamic one, but we need a function of \(x\) that we can average over the ensemble. The most natural choice is

\[p(x) = -\dfrac{d \mathcal{E} (x)}{dV} \label{Eq3.32}\]

so that \(P = \langle p(x) \rangle\). Setting up the average, we obtain

\[\begin{align} P &= -\dfrac{C_N}{Q(N, V, T)} \int \dfrac{\partial \mathcal{E}}{\partial V} e^{-\beta \mathcal{E} (x)} \\ &= \dfrac{C_N}{Q(N, V, T)} \dfrac{1}{\beta} \int \dfrac{\partial}{\partial V} e^{-\beta \mathcal{E} (x)} \\ &= \dfrac{k_BT}{Q(N, V, T} \dfrac{\partial}{\partial V} C_N \int e^{-\beta \mathcal{E} (x)} \\ &= k_BT \left( \dfrac{\partial \: \text{ln} \: Q(N, V, T)}{\partial V} \right) \end{align} \label{Eq3.33}\]

Ideal Gas in the Canonical Ensemble

Recall that the mechanical energy for an ideal gas is

\[\mathcal{E} (x) = \sum_{i=1}^N \dfrac{\textbf{p}_i^2}{2m} \label{Eq3.36}\]

where all particles are identical and have mass \(m\). Thus, the expression for the canonical partition function \(Q(N, V, T)\):

\[Q(N, V, T) = \dfrac{1}{N!h^{3N}} \int dx \: e^{-\beta \sum_{i=1}^N \textbf{p}_i^2/2m}\]

Note that this can be expressed as

\[Q(N, V, T) = \dfrac{1}{N!h^{3N}}V^N \left[ \int dp \: e^{-\beta p^2/2m} \right]^{3N}\]

Evaluating the Gaussian integral gives us the final result immediately:

\[Q(N, V, T) = \dfrac{1}{N!} \left[ \dfrac{V}{h^3} \left( \dfrac{2 \pi m}{\beta} \right)^{3/2} \right]^N\]

The expressions for the energy

\[E = -\dfrac{\partial}{\partial \beta} \: \text{ln} \: Q(N, V, T)\]

which give

\[E = \dfrac{3}{2}Nk_BT = \dfrac{3}{2}nRT \label{Eq3.37}\]

and pressure

\[P = k_BT \left( \dfrac{\partial \: \text{ln} \: Q(N, V, T)}{\partial V} \right)\]


\[P = \dfrac{Nk_BT}{V} = \dfrac{nRT}{V} \label{Eq3.38}\]

which is the ideal gas law.