Empirical The empirical laws that led to the derivation of the ideal gas law were discovered with experiments that changed only 2 state variables of the gas and kept every other one constant. All the possible gas laws that could have been discovered with this kind of setup are: •
Boyle's law () PV = C_1 \quad \text{or} \quad P_1 V_1 = P_2 V_2 •
Charles's law () \frac{V}{T} = C_2 \quad \text{or} \quad \frac{V_1}{T_1} = \frac{V_2}{T_2} •
Avogadro's law () \frac{V}{N}=C_3 \quad \text{or} \quad \frac{V_1}{N_1}=\frac{V_2}{N_2} •
Gay-Lussac's law () \frac{P}{T}=C_4 \quad \text{or} \quad \frac{P_1}{T_1}=\frac{P_2}{T_2} • NT = C_5 \quad \text{or} \quad N_1 T_1 = N_2 T_2 • \frac{P}{N} = C_6 \quad \text{or} \quad \frac{P_1}{N_1}=\frac{P_2}{N_2} where
P stands for
pressure,
V for
volume,
N for number of particles in the gas and
T for
temperature; where C_1, C_2, C_3, C_4, C_5, C_6 are constants in this context because of each equation requiring only the parameters explicitly noted in them changing. To derive the ideal gas law one does not need to know all 6 formulas, one can just know 3 and with those derive the rest or just one more to be able to get the ideal gas law, which needs 4. Since each formula only holds when only the state variables involved in said formula change while the others (which are a property of the gas but are not explicitly noted in said formula) remain constant, we cannot simply use algebra and directly combine them all. This is why: Boyle did his experiments while keeping
N and
T constant and this must be taken into account (in this same way, every experiment kept some parameter as constant and this must be taken into account for the derivation). Keeping this in mind, to carry the derivation on correctly, one must imagine the
gas being altered by one process at a time (as it was done in the experiments). The derivation using 4 formulas can look like this: at first the gas has parameters P_1, V_1, N_1, T_1. Say, starting to change only pressure and volume, according to
Boyle's law (), then: After this process, the gas has parameters P_2,V_2,N_1,T_1. Using then equation () to change the number of particles in the gas and the temperature, After this process, the gas has parameters P_2,V_2,N_2,T_2. Using then equation () to change the pressure and the number of particles, {{NumBlk||\frac{P_2}{N_2} = \frac{P_3}{N_3}. |}} After this process, the gas has parameters P_3,V_2,N_3,T_2. Using then
Charles's law (equation 2) to change the volume and temperature of the gas, {{NumBlk||\frac{V_2}{T_2} = \frac{V_3}{T_3}. |}} After this process, the gas has parameters P_3,V_3,N_3,T_3 Using simple algebra on equations (), (), () and () yields the result: \frac{P_1 V_1}{N_1 T_1} = \frac{P_3 V_3}{N_3 T_3} or \frac{PV}{NT} = k_\text{B} , where k_\text{B} stands for the
Boltzmann constant. Another equivalent result, using the fact that nR = N k_\text{B} , where
n is the number of
moles in the gas and
R is the
universal gas constant, is: PV = nRT, which is known as the ideal gas law. If three of the six equations are known, it may be possible to derive the remaining three using the same method. However, because each formula has two variables, this is possible only for certain groups of three. For example, if you were to have equations (), () and () you would not be able to get any more because combining any two of them will only give you the third. However, if you had equations (), () and () you would be able to get all six equations because combining () and () will yield (), then () and () will yield (), then () and () will yield (), as well as would the combination of () and () as is explained in the following visual relation: where the numbers represent the gas laws numbered above. If you were to use the same method used above on 2 of the 3 laws on the vertices of one triangle that has a "O" inside it, you would get the third. For example: Change only pressure and volume first: then only volume and temperature: {{NumBlk||\frac{V_2}{T_1} = \frac{V_3}{T_2},|}} then as we can choose any value for V_3, if we set V_1 = V_3, equation () becomes: {{NumBlk||\frac{V_2}{T_1} = \frac{V_1}{T_2}.|}} Combining equations () and () yields \frac{P_1}{T_1} = \frac{P_2}{T_2}, which is equation (), of which we had no prior knowledge until this derivation.
Theoretical Kinetic theory The ideal gas law can also be derived from
first principles using the
kinetic theory of gases, in which several simplifying assumptions are made, chief among which are that the molecules, or atoms, of the gas are point masses, possessing mass but no significant volume, and undergo only elastic collisions with each other and the sides of the container in which both linear momentum and kinetic energy are conserved. First we show that the fundamental assumptions of the kinetic theory of gases, that total momentum gets equally applied, so (1/3) in each direction, imply that : P = \frac{1}{3}nmv_{\text{rms}}^2. Consider a container in the xyz Cartesian coordinate system. For simplicity, we assume that a third of the molecules moves parallel to the x-axis, a third moves parallel to the y-axis and a third moves parallel to the z-axis. If all molecules move with the same velocity v, denote the corresponding pressure by P_0. We choose an area S on a wall of the container, perpendicular to the x-axis. When time t elapses, all molecules in the volume vtS moving in the positive direction of the x-axis will hit the area. There are NvtS molecules in a part of volume vtS of the container, but only one sixth (i.e. a half of a third) of them moves in the positive direction of the x-axis. Therefore, the number of molecules N' that will hit the area S when the time t elapses is NvtS/6. When a molecule bounces off the wall of the container, it changes its momentum \mathbf{p}_1 to \mathbf{p}_2=-\mathbf{p}_1. Hence the magnitude of change of the momentum of one molecule is |\mathbf{p}_2-\mathbf{p}_1|=2mv. The magnitude of the change of momentum of all molecules that bounce off the area S when time t elapses is then |\Delta \mathbf{p}|=2mvN'/V=NtSmv^2/(3V)=ntSmv^2/3. From F=|\Delta \mathbf{p}|/t and P_0=F/S we get : P_0=\frac{1}{3}nm v^2. We considered a situation where all molecules move with the same velocity v. Now we consider a situation where they can move with different velocities, so we apply an "averaging transformation" to the above equation, effectively replacing P_0 by a new pressure P and v^2 by the arithmetic mean of all squares of all velocities of the molecules, i.e. by v_{\text{rms}}^2. Therefore : P=\frac{1}{3}nm v_{\text{rms}}^2 which gives the desired formula. Using the
Maxwell–Boltzmann distribution, the fraction of molecules that have a speed in the range v to v + dv is f(v) \, dv, where : f(v) = 4\pi \left(\frac{m}{2\pi k_{\rm B}T}\right)^{\!\frac{3}{2}}v^2 e^{-\frac{mv^2}{2k_{\rm B}T}} and k denotes the Boltzmann constant. The root-mean-square speed can be calculated by : v_{\text{rms}}^2 = \int_0^\infty v^2 f(v) \, dv = 4\pi \left(\frac{m}{2\pi k_{\rm B}T}\right)^{\frac{3}{2}}\int_0^\infty v^4 e^{-\frac{mv^2}{2k_{\rm B}T}} \, dv. Using the integration formula : \int_0^\infty x^{2n}e^{-\frac{x^2}{a^2}} \, dx = \sqrt{\pi} \, \frac{(2n)!}{n!}\left(\frac{a}{2}\right)^{2n+1},\quad n\in\mathbb{N},\,a\in\mathbb{R}^+, it follows that : v_{\text{rms}}^2 = 4\pi\left(\frac{m}{2\pi k_{\rm B}T}\right)^{\!\frac{3}{2}}\sqrt{\pi} \, \frac{4!}{2!}\left(\frac{\sqrt{\frac{2k_{\rm B}T}{m}}}{2}\right)^{\!5} = \frac{3k_{\rm B}T}{m}, from which we get the ideal gas law: : P = \frac{1}{3} nm\left(\frac{3k_{\rm B}T}{m}\right) = nk_{\rm B}T.
Statistical mechanics Let
q = (
qx,
qy,
qz) and
p = (
px,
py,
pz) denote the position vector and momentum vector of a particle of an ideal gas, respectively. Let
F denote the net force on that particle. Then (two times) the time-averaged kinetic energy of the particle is: : \begin{align} \langle \mathbf{q} \cdot \mathbf{F} \rangle &= \left\langle q_{x} \frac{dp_{x}}{dt} \right\rangle + \left\langle q_{y} \frac{dp_{y}}{dt} \right\rangle + \left\langle q_{z} \frac{dp_{z}}{dt} \right\rangle\\ &=-\left\langle q_{x} \frac{\partial H}{\partial q_x} \right\rangle - \left\langle q_{y} \frac{\partial H}{\partial q_y} \right\rangle - \left\langle q_{z} \frac{\partial H}{\partial q_z} \right\rangle = -3k_\text{B} T, \end{align} where the first equality is
Newton's second law, and the second line uses
Hamilton's equations and the
equipartition theorem. Summing over a system of
N particles yields : 3Nk_{\rm B} T = - \left\langle \sum_{k=1}^{N} \mathbf{q}_{k} \cdot \mathbf{F}_{k} \right\rangle. By
Newton's third law and the ideal gas assumption, the net force of the system is the force applied by the walls of the container, and this force is given by the pressure
P of the gas. Hence : -\left\langle\sum_{k=1}^{N} \mathbf{q}_{k} \cdot \mathbf{F}_{k}\right\rangle = P \oint_{\text{surface}} \mathbf{q} \cdot d\mathbf{S}, where d
S is the infinitesimal area element along the walls of the container. Since the
divergence of the position vector
q is : \nabla \cdot \mathbf{q} = \frac{\partial q_{x}}{\partial q_{x}} + \frac{\partial q_{y}}{\partial q_{y}} + \frac{\partial q_{z}}{\partial q_{z}} = 3, the
divergence theorem implies that : P \oint_{\text{surface}} \mathbf{q} \cdot d\mathbf{S} = P \int_{\text{volume}} \left( \nabla \cdot \mathbf{q} \right) dV = 3PV, where
dV is an infinitesimal volume within the container and
V is the total volume of the container. Putting these equalities together yields : 3 N k_\text{B} T = -\left\langle \sum_{k=1}^{N} \mathbf{q}_{k} \cdot \mathbf{F}_{k} \right\rangle = 3PV, which immediately implies the ideal gas law for
N particles: : PV = Nk_{\rm B} T = nRT, where
n =
N/
NA is the number of
moles of gas and
R =
NA
kB is the
gas constant.
Quantum mechanics An additional derivation is possible using the
particle in a box model of
quantum mechanics. In a rectangular box of dimensions a \times b \times c, the possible quantized energy levels are given as : E = E_x + E_y + E_z= \frac{{{n_x}^2{h^2}}}{{8m{a^2}}} + \frac{{{n_y}^2{h^2}}}{{8m{b^2}}} + \frac{{{n_z}^2{h^2}}}{{8m{c^2}}}, where n_x, n_y and n_z are the quantum numbers for translational motion in the three base directions, E_x, E_y and E_z are the kinetic energies associated with translational motion in these directions. The force (F) acting upon the wall perpendicular to direction a is calculated as the derivative of the particle energy with respect to a change in side length a : F = \frac{{{\rm{d}}E}}{{{\rm{d}}a}} = - \frac{{2{n_x}^2{h^2}}}{{8m{a^3}}} = - \frac{{2{E_x}}}{a}. The overall force is calculated as the sum of the contributions from N independent particles as : F = \sum\limits_{i = 1}^N {\frac{{ - 2{E_x}\left( i \right)}}{a}} = - \frac{2}{a}\sum\limits_{i = 1}^N {{E_x}\left( i \right)} . Then the
equipartition theorem is used to give the average value of E_x as : \frac{1}{N}\sum\limits_{i = 1}^N {{E_x}\left( i \right)} = \frac{1}{2}k_\text{B}T. Finally, pressure P is calculated as the ratio of the force and the area it acts upon: : P = \frac = \frac{{\frac{2}{a}\sum\limits_{i = 1}^N {{E_x}\left( i \right)} }} = \frac{{k_\text{B}TN}}{V}. Analogs of this derivation for cylindrical and spherical boxes give the same result. == Other dimensions ==