# How can you derive the ideal gas law?

Sep 2, 2017

Ideal gas equation is arrived at from experimental evidence.

From Charles' law,

$V \propto T$ at $p$ constant.

From Boyle's law,

$p V$ is constant at $T$ constant.

Also, from Avogadro's law that equal volumes of gases at the same temperature and pressure have equal number of molecules,

$V \propto N$ at constant $T$ and $p$, where $N$ is number of molecules.

The above results are combined immediately to obtain that,

$p V \propto N T$
$\implies \frac{p V}{N T} =$constant

Therefore,

$\frac{p V}{T N} = {k}_{B}$ where ${k}_{B}$ is a constant known as the Boltzmann constant.
Hence,

$p V = {k}_{B} N T$

But for $\mu$ moles of gas, the number of molecules is $N = \mu {N}_{A}$ where ${N}_{A}$ is the Avogadro's number.

Thus, $p V = \mu {k}_{B} {N}_{A} T$

Thus, we finally arrive at the ideal gas law,

$p V = \mu R T$

Where, $R = {k}_{B} {N}_{A}$ is another constant known as the universal gas constant.

Oct 27, 2017

Another way I recently came across is essentially a derivation. I'll illustrate below.

#### Explanation:

From statistical mechanics, the Helmholtz free energy is given as,

$A = - {k}_{B} T \ln Z$ where $Z$ is the partition function.

But,

$\zeta = \sum {g}_{i} {e}^{- {E}_{i} / \left({k}_{B} T\right)}$

If energy levels are closely spaced,

$\zeta = \int g \left(E\right) {e}^{- \frac{E}{{k}_{B} T}} \mathrm{dE}$ where $g \left(E\right)$ is the density of states.

However, $g \left(E\right) \mathrm{dE} = \frac{2 \pi V}{h} ^ 3 {\left(2 m\right)}^{\frac{3}{2}} \sqrt{E} \mathrm{dE}$

Therefore, the partition function of each molecule (sub-system),

$\zeta = \int {e}^{- \frac{E}{{k}_{B} T}} \frac{2 \pi V}{h} ^ 3 {\left(2 m\right)}^{\frac{3}{2}} \sqrt{E} \mathrm{dE}$

This is evaluated by Gamma functions and is,

$\zeta = \frac{V}{h} ^ 3 {\left(2 \pi m {k}_{B} T\right)}^{\frac{3}{2}}$

Now, the partition function of the entire system consisting of $N$ molecules that are indistinguishable,

$Z = {\zeta}^{N} / \left(N \left(N - 1\right) \left(N - 2\right) \ldots 1\right)$

However, from Thermodynamics,

$p = - \left(\frac{\partial A}{\partial V}\right)$ at constant $T$

$\implies p = \frac{N {k}_{B} T}{V}$

Thus we get the ideal gas equation, $p V = N {k}_{B} T$ which can be rewritten as, $p V = \mu R T$ where $N = \mu {N}_{A}$ and ${N}_{A} {k}_{B} = R$

Oct 28, 2017

Aritra has a good statistical mechanics derivation, but I want to provide one that goes all the way back to particle statistics.

As a bonus, we get expressions for $G$, $\mu$, $A$, and $S$ in terms of the partition function and internal energy!

Most particles (namely, so-called corrected boltzons) have a statistical distribution given by (Norman Davidson, Statistical Mechanics, 1969):

$\ln t = {\sum}_{i} \left({N}_{i} \ln \left({g}_{i} / {N}_{i}\right) + {N}_{i}\right)$

where $t$ gives the number of microstates in the system with ${N}_{i}$ particles in a state of energy ${\epsilon}_{i}$ of degeneracy ${g}_{i}$.

The Boltzmann formulation of entropy is well-known:

$S = {k}_{B} \ln t$

As long as the energy levels in a system are only a function of the volume (and not the entropy itself), we can first find the absolute entropy from this known distribution:

$S = {k}_{B} {\sum}_{i} \left({N}_{i} \ln \left({g}_{i} / {N}_{i}\right) + {N}_{i}\right)$

A conservative system is constrained by a constant number of particles and energy, such that

• the total number of particles is constrained to $N = {\sum}_{i} {N}_{i}$.

• the total internal energy is constrained to $E = {\sum}_{i} {N}_{i} {\epsilon}_{i}$.

Furthermore, the distribution of states is given by:

N_i/N = (g_ie^(-epsilon_i//k_BT))/(sum_i g_i e^(-epsilon_i//k_BT)

where $q$ is the microcanonical partition function, $q = {\sum}_{i} {g}_{i} {e}^{- {\epsilon}_{i} / {k}_{B} T}$, and $q$ is a function of only temperature and volume.

As a result, the absolute entropy can be rewritten as:

$S = {k}_{B} \left[{\sum}_{i} {N}_{i} \ln \left(\frac{q}{N} {e}^{{\epsilon}_{i} / {k}_{B} T}\right) + {\sum}_{i} {N}_{i}\right]$

Since $q$ and $N$ are independent of which particle index is involved,

$S = {k}_{B} \left[\ln \left(\frac{q}{N}\right) {\sum}_{i} {N}_{i} + {\sum}_{i} {N}_{i} \ln \left({e}^{{\epsilon}_{i} / {k}_{B} T}\right) + {\sum}_{i} {N}_{i}\right]$

From the constraints given, the absolute entropy is:

$\overline{\underline{| \stackrel{\text{ ")(" "S = Nk_Bln(q/N) + E/(T) + Nk_B" }}{|}}}$

(As a fun fact, the standard molar entropy found in the back of General Chemistry textbooks can be derived from this equation.)

From the idea that the Gibbs' free energy is given as a function of the enthalpy and entropy, $G = H - T S$.

Similarly, we also have that the Helmholtz energy is $A = E - T S$, where $E$ is the internal energy. We then get:

$A = \cancel{E} - \left(N {k}_{B} T \ln \left(\frac{q}{N}\right) + \cancel{E} + N {k}_{B} T\right)$

$\implies \overline{\underline{| \stackrel{\text{ ")(" "A = -Nk_BTln(q/N) - Nk_BT" }}{|}}}$

The chemical potential $\mu$ is found in the Maxwell Relation of many thermodynamic functions, but it is most convenient to recall it within the Helmholtz free energy:

$\mathrm{dA} = - S \mathrm{dT} - P \mathrm{dV} + {\sum}_{i} {\mu}_{i} {\mathrm{dN}}_{i}$

$\mu$ is related to the molecular Gibbs' free energy and the Helmholtz free energy:

$\mu = \frac{G}{N} = {\left(\frac{\partial A}{\partial N}\right)}_{T , V}$

$= - {k}_{B} T \left(N \cdot \frac{\partial \ln \left(q / N\right)}{\partial N} + \ln \left(\frac{q}{N}\right)\right) - {k}_{B} T$

Since $q$ is a function of $T$ and $V$ but not of $N$,

$\overline{\underline{| \stackrel{\text{ ")(" "mu = -k_BTln(q/N)" }}{|}}}$

By comparison, since $N \mu = G = - N {k}_{B} T \ln \left(\frac{q}{N}\right)$, this nicely compares with $A$ to give:

$G = A + N {k}_{B} T$

From thermodynamics, just like $H = E + P V$, since $G = H - T S$ and $A = E - T S$, we also have that

$G = H - T S$

$= - T S + E + P V$

$= A + P V$.

Therefore, the ideal gas law is:

$\textcolor{b l u e}{\overline{\underline{| \stackrel{\text{ ")(" "PV = Nk_BT = nRT" }}{|}}}}$

where $\frac{N}{n} {k}_{B} = {N}_{A} {k}_{B} = R$, with $n$ being the mols of gas and $N$ being the number of gas particles.

And this holds as long as "the number of system states in the subsystems is equal to the number in the most probable distribution" (Norman Davidson, Statistical Mechanics, 1969).