# Basic Thermodynamics

In the microcanonical ensemble, the entropy $$S$$ is a natural function of $$N$$,$$V$$ and $$E$$, i.e., $$S=S(N,V,E)$$. This can be inverted to give the energy as a function of $$N$$, $$V$$, and $$S$$, i.e., $$E=E(N,V,S)$$. Consider using Legendre transformation to change from $$S$$ to $$T$$ using the fact that

$T= \left(\frac {\partial E}{\partial S}\right)_{N,V}$

The Legendre transform $$\tilde{E}$$ of $$E(N,V,S)$$ is

$\tilde {E} (N, V, T ) = E (N,V,S(T)) - S \frac {\partial E}{\partial S}$

$= E(N,V,S(T)) - TS$

The quantity $$\tilde{E}(N,V,T)$$ is called the Hemlholtz free energy and is given the symbol $$A(N,V,T)$$ and is the fundamental energy in the canonical ensemble.
The differential of $$A$$ is

$dA = \left( \partial A \over \partial T \right)_{N,V}dT + \left( \partial A \over \partial V \right)_{N,T} dV +\left( \partial A \over \partial N \right)_{T,V} dN$

However, from $$A = E - TS$$, we have

$dA = dE - TdS - SdT$

From the first law, $$dE$$ is given by

$dE = TdS - PdV + \mu dN$

Thus,

$dA = - PdV - S dT + \mu dN$

Comparing the two expressions, we see that the thermodynamic relations are

$S = -\left(\frac {\partial A}{\partial T}\right)_{N,V}$

$P = -\left(\frac {\partial A}{\partial V}\right)_{N,T}$

$\mu = -\left(\frac {\partial A}{\partial N}\right)_{V,T}$