# Entropy

We now introduce the following postulate, that will allow us to solve the general problem of thermodynamics:

Given a thermodynamic system there exists a state function ${\displaystyle S}$ called entropy, depending on the variables ${\displaystyle (U,X_{1},\dots ,X_{N})}$ and which is extensive, convex, monotonically increasing with respect to the internal energy ${\displaystyle U}$ and such that the equilibrium states of the system are its maxima, compatibly with the constraints put on the system itself.

The assumption that ${\displaystyle S}$ is a monotonically increasing function of the internal energy ${\displaystyle U}$ implies (Dini's theorem) that it is locally invertible; namely we can write at least locally ${\displaystyle U}$ as a function of ${\displaystyle S}$ and the other thermodynamic variables:

${\displaystyle U=U(S,X_{1},\dots ,X_{N})}$
From now on we will consider systems characterized by the internal energy ${\displaystyle U}$, the volume ${\displaystyle V}$ and the temperature ${\displaystyle T}$ (also called ${\displaystyle PVT}$ systems). It can also be shown that ${\displaystyle S}$ vanishes if and only if ${\displaystyle \partial U/\partial S_{|V,N}=0}$, and since ${\displaystyle U=U(S,V,N)}$ we have:
${\displaystyle dU={\frac {\partial U}{\partial S}}_{|V,N}dS+{\frac {\partial U}{\partial V}}_{|S,N}dV+{\frac {\partial U}{\partial N}}_{|S,V}dN}$
These derivatives of ${\displaystyle U}$ are intensive quantities[1], defined as:
${\displaystyle T={\frac {\partial U}{\partial S}}_{|V,N}\quad \qquad P=-{\frac {\partial U}{\partial V}}_{|S,N}\quad \qquad \mu ={\frac {\partial U}{\partial N}}_{|S,V}}$
where ${\displaystyle T}$ is the temperature of the system, ${\displaystyle P}$ its pressure and ${\displaystyle \mu }$ its chemical potential (note that from what we have previously stated, ${\displaystyle S=0}$ if and only if ${\displaystyle T=0}$). We thus have:
${\displaystyle dU=TdS-PdV+\mu dN}$
and the equations:
${\displaystyle T=T(S,V,N)\quad \qquad P=P(S,V,N)\quad \qquad \mu =\mu (S,V,N)}$
are called state equations, which are the relations we were looking for that bound the thermodynamic variables of a system.

Let us note that once the entropy ${\displaystyle S(U,V,N)}$ of a system is known, all its thermodynamics can be straightforwardly derived: it is in fact sufficient to invert ${\displaystyle S}$ and express ${\displaystyle U}$ as ${\displaystyle U=U(S,V,N)}$ and then take some derivatives in order to obtain all the state equations of the system.

Let us also briefly see that, for example, ${\displaystyle T}$ is indeed the temperature of a system, namely that if two systems with different temperatures are allowed to exchange internal energy they will finally reach an equilibrium where both have the same temperature. Let us call 1 and 2 these systems, which can be represented for example by two compartments of a box, each of volume ${\displaystyle V_{i}}$, containing ${\displaystyle N_{i}}$ particles of gas (not necessarily of the same kind), at temperature ${\displaystyle T_{i}}$ and with internal energy ${\displaystyle U_{i}}$ (with ${\displaystyle i=1,2}$), separated by a wall that allows the exchange of heat (namely internal energy), but not particles (it's impermeable) or volume (it's fixed). Once the systems are in thermal contact, they will reach a new equilibrium, which will be a maximum for the entropy, namely ${\displaystyle dS=0}$ in the final state. However, since the whole system is isolated the total internal energy ${\displaystyle U_{1}+U_{2}}$ must remain constant in the process. Thus (remembering that ${\displaystyle dV=dN=0}$):

${\displaystyle {\begin{cases}dS=0\\U_{1}+U_{2}=0\end{cases}}\quad \Rightarrow \quad {\begin{cases}dS_{1}+dS_{2}={\frac {1}{T_{1}}}dU_{1}+{\frac {1}{T_{2}}}dU_{2}=0\\dU_{1}=-dU_{2}\end{cases}}\quad \Rightarrow }$
${\displaystyle \Rightarrow \quad dS=\left({\frac {1}{T_{1}}}-{\frac {1}{T_{2}}}\right)dU_{1}=0}$
and since ${\displaystyle dU_{1}}$ is an arbitrary (non null) quantity, in the final state we have:
${\displaystyle {\frac {1}{T_{1}}}-{\frac {1}{T_{2}}}=0\quad \Rightarrow \quad T_{1}=T_{2}}$
and so the two systems will have the same temperature. It can also be shown that the flow of heat goes, as intuition suggests, from the hotter to the colder system.

1. Since they are derivatives of a homogeneous function of degree one, they are homogeneous functions of degree zero.