Isothermal compressibility from chemical-potential response (source code)

= Isothermal compressibility from chemical-potential response
{title2=$\kappa_T=n^{-2}(\partial n/\partial\mu)_T$}

For a homogeneous extensive single-component <thermodynamic phase>, the <Gibbs-Duhem equation> at fixed <temperature> gives $dp=n\,d\mu$. With <number density> $n=N/V$, fixed $N$ gives $dn=-(n/V)dV$. The <chain rule> therefore gives
$$
\kappa_T=\frac1n\left(\frac{\partial n}{\partial p}\right)_T
=\frac1{n^2}\left(\frac{\partial n}{\partial\mu}\right)_T.
$$
The <derivatives> are evaluated within the same smooth <equation of state>; an interface contribution or <phase coexistence> can invalidate this simple homogeneous derivation.