Solution (source code)

= Solution

For fixed amount of substance, take the <internal energy> $U=U(S,V)$. The <first law of thermodynamics> identifies $T=U_S|_V$ and $-P=U_V|_S$. Equality of mixed second <derivatives> gives
$$
\boxed{\left(\frac{\partial T}{\partial V}\right)_S
=-\left(\frac{\partial P}{\partial S}\right)_V}.
$$
For the <Helmholtz free energy>, subtract the product differential $d(TS)$ from the <first law of thermodynamics> to obtain $dF=-S\,dT-P\,dV$. Its natural variables are $(T,V)$, so $F_T=-S$ and $F_V=-P$. Exactness therefore gives
$$
\boxed{\left(\frac{\partial S}{\partial V}\right)_T
=\left(\frac{\partial P}{\partial T}\right)_V}.
$$
For the <Gibbs free energy>, the <product rule> gives $dG=-S\,dT+V\,dP$. Thus $G_T=-S$, $G_P=V$, and
$$
\boxed{\left(\frac{\partial S}{\partial P}\right)_T
=-\left(\frac{\partial V}{\partial T}\right)_P}.
$$
For the <enthalpy>, $dH=T\,dS+V\,dP$, giving $H_S=T$, $H_P=V$ and
$$
\boxed{\left(\frac{\partial T}{\partial P}\right)_S
=\left(\frac{\partial V}{\partial S}\right)_P}.
$$
These are the four <Maxwell relations>, each following from exactness in the appropriate pair of natural variables.