# Thermodynamics

In the canonical ensemble, the Helmholtz free energy $$A (N, V, T)$$ is a natural function of $$N , V$$ and $$T$$. As usual, we perform a Legendre transformation to eliminate $$N$$ in favor of $$\mu = \frac {\partial A}{\partial N}$$:

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

It turns out that the free energy $$\tilde{A}(\mu,V,T)$$ is the quantity $$- PV$$. We shall derive this result below in the context of the partition function. Thus,

$-PV = A(N(\mu),V,T) - \mu N$

To motivate the fact that $$PV$$ is the proper free energy of the grand canonical ensemble from thermodynamic considerations, we need to introduce a mathematical theorem, known as Euler's theorem:

Euler's Theorem: Let $$f(x_1,...,x_N)$$ be a function such that

$f(\lambda x_1,...,\lambda x_N) = \lambda^n f(x_1,...,x_N)$

Then $$f$$ is said to be a homogeneous function of degree $$n$$. For example, the function $$f(x) = 3x^2$$ is a homogeneous function of degree 2, $$f(x,y,z) = xy^2 + z^3$$ is a homogeneous function of degree 3, however, $$f(x,y) = e^{xy}-xy$$ is not a homogeneous function. Euler's Theorem states that, for a homogeneous function $$f$$,

$nf(x_1,...,x_N) = \sum_{i=1}^N x_i \frac {\partial f}{\partial x_i}$

Proof: To prove Euler's theorem, simply differentiate the the homogeneity condition with respect to lambda:
 $$\frac {d}{d\lambda} f(\lambda x_1,...,\lambda x_N)$$ $$\frac {d}{d\lambda} \lambda^nf(x_1,...,x_N)$$ $$\sum_{i=1}^N x_i \frac {\partial f}{\partial (\lambda x_i)}$$ $$n\lambda^{n-1}f(x_1,...,x_N)$$

Then, setting $$\lambda = 1$$, we have

$\sum_{i=1}^N x_i \frac {\partial f}{\partial x_i} = nf(x_1,...,x_N)$

which is exactly Euler's theorem.

Now, in thermodynamics, extensive thermodynamic functions are homogeneous functions of degree 1. Thus, to see how Euler's theorem applies in thermodynamics, consider the familiar example of the Gibbs free energy:

$G = G (N, P, T )$

The extensive dependence of $$G$$ is on $$N$$, so, being a homogeneous function of degree 1, it should satisfy

$G (\lambda N, P, T) = \lambda G (N, P, T )$

Applying Euler's theorem, we thus have

$G(N,P,T) = N \frac {\partial G}{\partial N} = \mu N$

or, for a multicomponent system,

$G = \sum_{j} \mu_j N_j$

But, since

$G = E - TS + PV$

it can be seen that $$G = \mu N$$ is consistent with the first law of thermodynamics.

Now, for the Legendre transformed free energy in the grand canonical ensemble, the thermodynamics are

$d\tilde{A} = dA - \mu dN - Nd\mu = -PdV - SdT - Nd\mu$

But, since

 $$\tilde{A}$$ $$\tilde{A}(\mu,V,T)$$ $$d \tilde{A}$$ $$\left(\frac {\partial \tilde{A}}{\partial \mu}\right)_{V,T}d\mu+\left(\frac {\partial \tilde{A}}{\partial V}\right)_{\mu,T}dV+ \left(\frac {\partial \tilde{A}}{\partial T}\right)_{\mu,V}dT$$

the thermodynamics will be given by

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

Since, $$\tilde{A}$$ is a homogeneous function of degree 1, and its extensive argument is $$V$$, it should satisfy

$\tilde{A}(\mu,\lambda V,T) = \lambda \tilde{A}(\mu,V,T)$

Thus, applying Euler's theorem,

$\tilde{A}(\mu,V,T) = V \frac {\partial \tilde{A}}{\partial V} = -PV$

and since

$\tilde{A} = A-\mu N = E - TS - \mu N$

the assignment $$\tilde{A} = -PV$$ is consistent with the first law of thermodynamics. It is customary to work with $$PV$$, rather than $$- PV$$, so $$PV$$ is the natural free energy in the grand canonical ensemble, and, unlike the other ensembles, it is not given a special name or symbol!