$$ S(E,V,N)=S_1(E_1,V_1,N_1)+S_2(E_2,V_2,N_2) $$
Since the overall system is isolated it reaches equilibrium when entropy is maximised i.e. $\text dS=0$ so:
$$ \text dS=\left ( \frac{\partial S}{\partial E} \right ){V,N}\text dE+\left ( \frac{\partial S}{\partial V} \right ){E,N}\text dV+\left ( \frac{\partial S}{\partial N} \right )_{E,V}\text dN=0 $$
⚙️ Properties
- $T_1=T_2$ no heat flow between systems
- $P_1=P_2$ the systems are at mechanical equilibrium
- $\mu_1=\mu_2$ there is no preference to be in one state over the other
The Clausius-Clapeyron relation related different point of phase coexistence
$$ \frac{\text d P}{\text d T}=\frac{\Delta S^m}{\Delta V^m}=\frac{\Delta H^m}{T\Delta V^m} $$
Where $S^m$ and $V^m$ refer to entropy and volume per mole, respectively, and $H^m$ is the enthalpy per mole(latent heat transformation)
$$ P=\frac{nRT}{V-nb}-a\frac{n^2}{V} $$
$$ PV^2(V-nb)-nRTV^2+an^2(V-nb)=0 $$
There is either one real root or three, this depends on temperature
$$ \left ( \frac{\partial P}{\partial V}\right ){T_C} =\left ( \frac{\partial^2 P}{\partial V^2}\right ){T_C}=0 $$
at $V_C=3nb$