# 6.1. Thermodynamics¶

## 6.1.1. Fundamental Thermodynamic Relation¶

The first law of thermodynamics is , where is the heat supplied to the system and is the work done by the system. The second law of thermodynamics is . By substituting into the first law, and expressing the work using pressure and volume, we obtain:

This can then be generalized to:

where is the chemical potential and the number of particles in the system.

## 6.1.2. Thermodynamic Potentials¶

We start by writing the internal energy (derived in the previous section)

as a function of entropy , volume and a number of particles . Now we want to express it as a function of temperature , pressure or a chemical potential , without losing any information, i.e. we still want to just differentiate to obtain other quantities. In order to do that, we have to use the Legendre transform. Including , there are 8 possible combinations of Legendre transforms that one can do (three of them are applying it to just one variable, three of them to two variables, one to all three variables):

Of these, is the internal energy, is the Helmholtz free energy, is the enthalpy, is the Gibbs free energy, is the grand potential (sometimes also called a Landau potential). The unnamed potentials are simply labeled , and . The is sometimes called a null function.

From the differentials, we can then read off the derivatives (and what other variables are constant), here are all the combinations:

A large system is defined as: if the number of particles is made times as large, , , and all become times larger. In other words, the internal energy of a large system is a homogeneous function of , , and of order one:

Now we can apply the Euler’s theorem (see Homogeneous Functions (Euler’s Theorem)):

And from the definitions of all the potentials we can calculate their forms for large systems:

### Other first derivatives¶

Other commonly used first derivatives are the heat capacity at constant volume:

and the heat capacity at constant pressure

Note that these first derivatives are differentiating the thermodynamic potential that is not expressed in its canonical variables (the only canonical first derivatives are already enumerated in the previous section). In both cases the quantity can be expressed as a second derivative of a potential in its canonical variables. As shown below, the canonical second derivatives can also be enumerated.

### Second derivatives¶

Here are the most commonly used second derivatives. The particle density:

The speed of sound:

where is the density and is the specific volume. The isothermal speed of sound:

The isothermal bulk modulus:

Isothermal coefficient of compressibility:

The Grüneisen parameter:

The coefficient of thermal expansion

Note: there are three possible second derivatives of the Gibbs free energy with respect to and :

Every other second derivative of other thermodynamic potentials can be expressed using these three derivatives (i.e., using , and ). For example:

## 6.1.3. Examples¶

### Ideal Gas¶

The internal energy as a function of , and is equal to:

(6.1.3.1)

where is the heat capacity at a constant volume ( for monoatomic gases, for diatomic gases), is the Boltzman constant and is a constant that may vary for different gases, but it is independent of the thermodynamic state of the gas.

At this level, the above expression is simply given. We would have to use statistical physics in order to calculate any of the thermodynamic potentials.

Now we calculate the free energy . First we must calculate the temperature :

(6.1.3.2)

In order to calculate the the free energy, we must use (6.1.3.2) to eliminate :

(6.1.3.3)

and then express as a function of , and only:

(6.1.3.4)

This calculation shows that one can also express the internal energy as a function of , and as . This is a valid expression, but unlike , this is not a thermodynamic potential, because we lost some information. In particular, if we use to find :

we can see, that we recovered the correct formula for except an arbitrary function of and . Compared to (6.1.3.1) we can see that it must be , but this information got lost. For this reason, only as well as , that we just calculated, are thermodynamic potentials and both contain equivalent information. But is not and it does not contain full information.

To convert back to , we first calculate the entropy :

which is the same equation as (6.1.3.3). From this, we express , we get (6.1.3.2). Finally, we can calculate the internal energy and substitute for using (6.1.3.2):

This is the same equation as (6.1.3.1). This shows that all thermodynamic potentials contain the same information and can be converted to one another using the Legendre transformation.

Note: in equations like , we can use any expressions for and (e.g. we can use or , etc.) in the intermediate steps, but at the end, we must express the final formula using , and only.

To calculate the Gibbs energy, we need to calculate pressure first. We can use any of the potentials , , or to do so. Since the equation of state is typicaly expressed as , then the free energy is the natural choice:

and we get the ideal gas law . The Gibbs energy is equal to:

(6.1.3.5)

For the enthalpy, we first need:

we need to use this to express the volume :

now we can calculate :

(6.1.3.6)

The enthalpy in terms of temperature can be calculated as:

The specific heat capacity at a constant volume can be calculated as:

This provides proof that the in (6.1.3.1) is indeed the specific heat capacity at a constant volume.

The specific heat capacity at a constant pressure can be calculated as:

Using this relation we can then express (6.1.3.5):

and (6.1.3.6) as:

In order to calculate the grand potential, we first need to find the chemical potential:

and express using :

Now we can calculate :

(6.1.3.7)

To compute , we can do:

where we used:

As we can see, the last equation cannot be used to compute as a function of , and also the potential evaluates to zero, so it cannot be used as a thermodynamic potential, because we have cannot convert it back to the other potentials.