Solution (source code)

= Solution

Use the <Gibbs-Duhem equation> for a homogeneous, extensive, single-component <thermodynamic phase>:
$$
S\,dT-V\,dp+N\,d\mu=0.
$$
At fixed <temperature>, this becomes $dp=n\,d\mu$, with <number density> $n=N/V$. Separately, at fixed <particle number>,
$$
\left(\frac{\partial n}{\partial p}\right)_{T,N}
=-\frac{N}{V^2}\left(\frac{\partial V}{\partial p}\right)_{T,N}
=n\kappa_T.
$$
The <chain rule> along the same <isothermal process> in the <equation of state> now gives
$$
\left(\frac{\partial n}{\partial\mu}\right)_T
=\left(\frac{\partial n}{\partial p}\right)_T
\left(\frac{\partial p}{\partial\mu}\right)_T
=n\kappa_T\,n.
$$
Consequently
$$
\boxed{\kappa_T=\frac1{n^2}\left(\frac{\partial n}{\partial\mu}\right)_T.}
$$
This is <isothermal compressibility from chemical-potential response>. Since <chemical potential> has units of <energy> per particle, the right-hand side has units of <volume (thermodynamics)> per <energy>, or $\mathrm{Pa^{-1}}$, as required. The derivation assumes a smooth bulk <equation of state>; changing the fractions of coexisting <thermodynamic phases> at fixed <pressure> needs separate treatment.