# Fundamental thermodynamic relation

Thermodynamics :
The classical Carnot heat engine :
Branches
Classical
Statistical
Chemical
Quantum thermodynamics
Equilibrium / Non-equilibrium :
Laws
Zeroth
First
Second
Third :
Systems
Closed system
Open system
Isolated system
State
Equation of state
Ideal gas
Real gas
State of matter
Phase (matter)
Equilibrium
Control volume
Instruments
Processes
Isobaric
Isochoric
Isothermal
Adiabatic
Isentropic
Isenthalpic
Quasistatic
Polytropic
Free expansion
Reversibility
Irreversibility
Endoreversibility
Cycles
Heat engines
Heat pumps
Thermal efficiency :
System propertiesNote: Conjugate variables in italics
Property diagrams
Intensive and extensive properties
Process functions
Work
Heat
Functions of state
Temperature / Entropy (introduction)
Pressure / Volume
Chemical potential / Particle number
Vapor quality
Reduced properties :
Material properties
Property databases
Specific heat capacity 
$c=$
$T$$\partial S$$N$$\partial T$
Compressibility 
$\beta =-$
$1$$\partial V$$V$$\partial p$
Thermal expansion 
$\alpha =$
$1$$\partial V$$V$$\partial T$ :
Equations
Carnot's theorem
Clausius theorem
Fundamental relation
Ideal gas law
Maxwell relations
Onsager reciprocal relations
Bridgman's equations
Table of thermodynamic equations :
Potentials
Free energy
Free entropy
Internal energy $U(S,V)$Enthalpy $H(S,p)=U+pV$Helmholtz free energy $A(T,V)=U-TS$Gibbs free energy $G(T,p)=H-TS$ :
HistoryCulture
History
General
Entropy
Gas laws
"Perpetual motion" machines
Philosophy
Entropy and time
Entropy and life
Brownian ratchet
Maxwell's demon
Heat death paradox
Loschmidt's paradox
Synergetics
Theories
Caloric theory
Vis viva ("living force")
Mechanical equivalent of heat
Motive power
Key publications
An Inquiry Concerning the Source ... Friction
On the Equilibrium of Heterogeneous Substances
Reflections on the Motive Power of Fire
Timelines
Thermodynamics
Heat engines
ArtEducation
Maxwell's thermodynamic surface
Entropy as energy dispersal :
Scientists
Bernoulli
Boltzmann
Bridgman
Carathéodory
Carnot
Clapeyron
Clausius
de Donder
Duhem
Gibbs
von Helmholtz
Joule
Kelvin
Lewis
Massieu
Maxwell
von Mayer
Nernst
Onsager
Planck
Rankine
Smeaton
Stahl
Tait
Thompson
van der Waals
Waterston :
Other
Nucleation
Self-assembly
Self-organization
Order and disorder :
Category :
vte :
In thermodynamics, the fundamental thermodynamic relation are four fundamental equations which demonstrate how four important thermodynamic quantities depend on variables that can be controlled and measured experimentally. Thus, they are essentially equations of state, and using the fundamental equations, experimental data can be used to determine sought-after quantities like G (Gibbs free energy) or H (enthalpy). The relation is generally expressed as a microscopic change in internal energy in terms of microscopic changes in entropy, and volume for a closed system in thermal equilibrium in the following way.
$\mathrm {d} U=T\,\mathrm {d} S-P\,\mathrm {d} V\,$
Here, U is internal energy, T is absolute temperature, S is entropy, P is pressure, and V is volume.
This is only one expression of the fundamental thermodynamic relation. It may be expressed in other ways, using different variables (e.g. using thermodynamic potentials). For example, the fundamental relation may be expressed in terms of the enthalpy H as
$\mathrm {d} H=T\,\mathrm {d} S+V\,\mathrm {d} P\,$
in terms of the Helmholtz free energy F as
$\mathrm {d} F=-S\,\mathrm {d} T-P\,\mathrm {d} V\,$
and in terms of the Gibbs free energy G as
$\mathrm {d} G=-S\,\mathrm {d} T+V\,\mathrm {d} P\,.$

## The first and second laws of thermodynamics

The first law of thermodynamics states that:
$\mathrm {d} U=\delta Q-\delta W\,$
where $\delta Q$ and $\delta W$ are infinitesimal amounts of heat supplied to the system by its surroundings and work done by the system on its surroundings, respectively.
According to the second law of thermodynamics we have for a reversible process:
$\mathrm {d} S={\frac {\delta Q}{T}}\,$
Hence:
$\delta Q=T\,\mathrm {d} S\,$
By substituting this into the first law, we have:
$\mathrm {d} U=T\,\mathrm {d} S-\delta W\,$
Letting $\delta W$ be reversible pressure-volume work done by the system on its surroundings,
$\delta W\ =P\mathrm {d} V\,$
we have:
$\mathrm {d} U=T\,\mathrm {d} S-P\,\mathrm {d} V\,$
This equation has been derived in the case of reversible changes. However, since U, S, and V are thermodynamic state functions that depend on only the initial and final states of a thermodynamic process, the above relation holds also for non-reversible changes. If the composition, i.e. the amounts $n_{i}$ of the chemical components, in a system of uniform temperature and pressure can also change, e.g. due to a chemical reaction, the fundamental thermodynamic relation generalizes to:
$\mathrm {d} U=T\,\mathrm {d} S-P\,\mathrm {d} V\ +\sum _{i}\mu _{i}\,\mathrm {d} n_{i}\,$
The $\mu _{i}$ are the chemical potentials corresponding to particles of type $i$.
If the system has more external parameters than just the volume that can change, the fundamental thermodynamic relation generalizes to
$\mathrm {d} U=T\,\mathrm {d} S+\sum _{j}X_{j}\,\mathrm {d} x_{j}+\sum _{i}\mu _{i}\,\mathrm {d} n_{i}\,$
Here the $X_{j}$ are the generalized forces corresponding to the external parameters $x_{j}$. (The negative sign used with pressure is unusual and arises because pressure represents a compressive stress that tends to decrease volume. Other generalized forces tend to increase their conjugate displacements.)

## Relationship to statistical mechanics

The fundamental thermodynamic relation and statistical mechanical principles can be derived from one another.

### Derivation from statistical mechanical principles

The above derivation uses the first and second laws of thermodynamics. The first law of thermodynamics is essentially a definition of heat, i.e. heat is the change in the internal energy of a system that is not caused by a change of the external parameters of the system.
However, the second law of thermodynamics is not a defining relation for the entropy. The fundamental definition of entropy of an isolated system containing an amount of energy $E$ is:
$S=k_{\text{B}}\log \left[\Omega \left(E\right)\right]\,$
where $\Omega \left(E\right)$ is the number of quantum states in a small interval between $E$ and $E+\delta E$. Here $\delta E$ is a macroscopically small energy interval that is kept fixed. Strictly speaking this means that the entropy depends on the choice of $\delta E$. However, in the thermodynamic limit (i.e. in the limit of infinitely large system size), the specific entropy (entropy per unit volume or per unit mass) does not depend on $\delta E$. The entropy is thus a measure of the uncertainty about exactly which quantum state the system is in, given that we know its energy to be in some interval of size $\delta E$.
Deriving the fundamental thermodynamic relation from first principles thus amounts to proving that the above definition of entropy implies that for reversible processes we have:
$dS={\frac {\delta Q}{T}}$
The relevant assumption from statistical mechanics is that all the $\Omega \left(E\right)$ states at a particular energy are equally likely. This allows us to extract all the thermodynamical quantities of interest. The temperature is defined as:
${\frac {1}{k_{\text{B}}T}}\equiv \beta \equiv {\frac {d\log \left[\Omega (E)\right]}{dE}}$
This definition can be derived from the microcanonical ensemble, which is a system of a constant number of particles, a constant volume and that does not exchange energy with its environment. Suppose that the system has some external parameter, x, that can be changed. In general, the energy eigenstates of the system will depend on x. According to the adiabatic theorem of quantum mechanics, in the limit of an infinitely slow change of the system's Hamiltonian, the system will stay in the same energy eigenstate and thus change its energy according to the change in energy of the energy eigenstate it is in.
The generalized force, X, corresponding to the external parameter x is defined such that $Xdx$ is the work performed by the system if x is increased by an amount dx. E.g., if x is the volume, then X is the pressure. The generalized force for a system known to be in energy eigenstate $E_{r}$ is given by:
$X=-{\frac {dE_{r}}{dx}}$
Since the system can be in any energy eigenstate within an interval of $\delta E$, we define the generalized force for the system as the expectation value of the above expression:
$X=-\left\langle {\frac {dE_{r}}{dx}}\right\rangle \,$
To evaluate the average, we partition the $\Omega (E)$ energy eigenstates by counting how many of them have a value for ${\frac {dE_{r}}{dx}}$ within a range between $Y$ and $Y+\delta Y$. Calling this number $\Omega _{Y}\left(E\right)$, we have:
$\Omega (E)=\sum _{Y}\Omega _{Y}(E)\,$
The average defining the generalized force can now be written:
$X=-{\frac {1}{\Omega (E)}}\sum _{Y}Y\Omega _{Y}(E)\,$
We can relate this to the derivative of the entropy with respect to x at constant energy E as follows. Suppose we change x to x + dx. Then $\Omega \left(E\right)$ will change because the energy eigenstates depend on x, causing energy eigenstates to move into or out of the range between $E$ and $E+\delta E$. Let's focus again on the energy eigenstates for which ${\frac {dE_{r}}{dx}}$ lies within the range between $Y$ and $Y+\delta Y$. Since these energy eigenstates increase in energy by Y dx, all such energy eigenstates that are in the interval ranging from E − Y dx to E move from below E to above E. There are
$N_{Y}(E)={\frac {\Omega _{Y}(E)}{\delta E}}Y\,dx$
such energy eigenstates. If $Ydx\leq \delta E$, all these energy eigenstates will move into the range between $E$ and $E+\delta E$ and contribute to an increase in $\Omega$. The number of energy eigenstates that move from below $E+\delta E$ to above $E+\delta E$ is, of course, given by $N_{Y}\left(E+\delta E\right)$. The difference
$N_{Y}(E)-N_{Y}(E+\delta E)\,$
is thus the net contribution to the increase in $\Omega$. Note that if Y dx is larger than $\delta E$ there will be energy eigenstates that move from below $E$ to above $E+\delta E$. They are counted in both $N_{Y}(E)$ and $N_{Y}(E+\delta E)$, therefore the above expression is also valid in that case.
Expressing the above expression as a derivative with respect to E and summing over Y yields the expression:
$\left({\frac {\partial \Omega }{\partial x}}\right)_{E}=-\sum _{Y}Y\left({\frac {\partial \Omega _{Y}}{\partial E}}\right)_{x}=\left({\frac {\partial (\Omega X)}{\partial E}}\right)_{x}\,$
The logarithmic derivative of $\Omega$ with respect to x is thus given by:
$\left({\frac {\partial \log \left(\Omega \right)}{\partial x}}\right)_{E}=\beta X+\left({\frac {\partial X}{\partial E}}\right)_{x}\,$
The first term is intensive, i.e. it does not scale with system size. In contrast, the last term scales as the inverse system size and thus vanishes in the thermodynamic limit. We have thus found that:
$\left({\frac {\partial S}{\partial x}}\right)_{E}={\frac {X}{T}}\,$
Combining this with
$\left({\frac {\partial S}{\partial E}}\right)_{x}={\frac {1}{T}}\,$
Gives:
$dS=\left({\frac {\partial S}{\partial E}}\right)_{x}\,dE+\left({\frac {\partial S}{\partial x}}\right)_{E}\,dx={\frac {dE}{T}}+{\frac {X}{T}}\,dx\,$
which we can write as:
$dE=T\,dS-X\,dx$

### Derivation of statistical mechanical principles from the fundamental thermodynamic relation

It has been shown that the fundamental thermodynamic relation together with the following three postulates
* The probability density function is proportional to some function of the ensemble parameters and random variables.
* Thermodynamic state functions are described by ensemble averages of random variables.
* The entropy as defined by Gibbs entropy formula matches with the entropy as defined in classical thermodynamics.
is sufficient to build the theory of statistical mechanics without the equal a priori probability postulate.
For example, in order to derive the Boltzmann distribution, we assume the probability density of microstate i satisfies Pr(i)∝f(E$_i$, T){\textstyle \Pr(i)\propto f(E_{i}, T)}. The normalization factor (partition function) is therefore
$Z=\sum _{i}f(E_{i},T).$
The entropy is therefore given by
$S=k_{B}\sum _{i}{\frac {f(E_{i},T)}{Z}}\log \left({\frac {f(E_{i},T)}{Z}}\right).$
If we change the temperature T by dT while keeping the volume of the system constant, the change of entropy satisfies
$dS=\left({\frac {\partial S}{\partial T}}\right)_{V}dT$
where
${\begin{aligned}\left({\frac {\partial S}{\partial T}}\right)_{V}&=-k_{B}\sum _{i}{\frac {Z\cdot {\frac {\partial f(E_{i},T)}{\partial T}}\cdot \log f(E_{i},T)-{\frac {\partial Z}{\partial T}}\cdot f(E_{i},T)\cdot \log f(E_{i},T)}{Z^{2}}}\\&=-k_{B}\sum _{i}{\frac {\partial }{\partial T}}\left({\frac {f(E_{i},T)}{Z}}\right)\cdot \log f(E_{i},T)\\\end{aligned}}$
Considering that
$\left\langle E\right\rangle =\sum _{i}{\frac {f(E_{i},T)}{Z}}\cdot E_{i}$
we have
$d\left\langle E\right\rangle =\sum _{i}{\frac {\partial }{\partial T}}{\left({\frac {f(E_{i},T)}{Z}}\right)}\cdot E_{i}\cdot dT$
From the fundamental thermodynamic relation, we have
$-{\frac {dS}{k_{\text{B}}}}+{\frac {d\left\langle E\right\rangle }{k_{\text{B}}T}}+{\frac {P}{k_{\text{B}}T}}dV=0$
Since we kept V constant when perturbing T, we have dV=0{\textstyle dV=0}. Combining the equations above, we have
$\sum _{i}{\frac {\partial }{\partial T}}{\left({\frac {f(E_{i},T)}{Z}}\right)}\cdot \left[\log f(E_{i},T)+{\frac {E_{i}}{k_{\text{B}}T}}\right]\cdot dT=0$
Physics laws should be universal, i.e., the above equation must hold for arbitrary systems, and the only way for this to happen is
$\log f(E_{i},T)+{\frac {E_{i}}{k_{\text{B}}T}}=0$
That is
$f(E_{i},T)=\exp \left(-{\frac {E_{i}}{k_{\text{B}}T}}\right).$
It has been shown that the third postulate in the above formalism can be replaced by the following:
* At infinite temperature, all the microstates have the same probability.
However, the mathematical derivation will be much more complicated.