2.3. Manipulating partial derivatives#

We sometimes need to find derivatives we don’t obtain easily from one of these potentials. For this, we use some calculus rules.


The inversion rule states that the partial derivative of each variable with respect to each other are reciprocals if the two variables are related through an inverse function.

To demonstrate use of this rule, consider two ways of calculating the partial derivative \((\partial x/\partial y)_z\) for the function

(2.22)#\[\begin{equation} x = \frac{y^2}{z} \end{equation}\]

and the inverse function

(2.23)#\[\begin{equation} y = \sqrt{xz} \end{equation}\]

Evaluating the partial derivative of x with respect to y directly gives

(2.24)#\[\begin{equation} \td{}{x}{y}{z} = \frac{2y}{z} \end{equation}\]

while the partial derivative of y with respect to x is:

(2.25)#\[\begin{equation} \td{}{y}{x}{z} = \frac{1}{2} \sqrt{\frac{z}{x}} \end{equation}\]

Now, use the inversion rule and substitute \(x(y,z)\) back in:

(2.26)#\[\begin{equation} \frac{1}{(\partial y/\partial x)_z} = 2 \sqrt{\frac{x}{z}} = 2 \sqrt{\frac{y^2/z}{z}} = \frac{2y}{z} \end{equation}\]

The results are the same!


When working with multivariable functions, we often want to compute the derivative of one variable with respect to another, even when the relationship between them is indirect. In such cases, the chain rule allows us to break down the derivative into intermediate steps.

To demonstrate use of this rule, let \(w = yz\), which means that

(2.28)#\[\begin{equation} x = \frac{y^2}{z} = \frac{w^2}{z^3} \end{equation}\]

We will calculate the partial derivative of x with respect to y using the chain rule, then show it gives the same as if we differentiated directly. First, we need partial derivatives of x with respect to w and w with respect to y:

(2.29)#\[\begin{equation} \td{}{x}{w}{z} = \frac{2w}{z^3}, \qquad \td{}{w}{y}{z} = z \end{equation}\]

Therefore, by the chain rule:

(2.30)#\[\begin{equation} \td{}{x}{y}{z} = \left(\frac{2w}{z^3} \right)z = \frac{2yz}{z^2} = \frac{2y}{z} \end{equation}\]

This matches our previous result for the derivative!

2.3.1. Derivatives as functions#

The first law of thermodynamics for a pure substance is:

(2.31)#\[\begin{equation} \d{U} = T\d{S} - P \d{V} \end{equation}\]

where U is the molar internal energy, T is the temperature, S is the molar entropy, P is the pressure, and V is the molar volume. This is an exact differential for \(U(S,V)\). Mathematically, we also have the total differential:

(2.32)#\[\begin{equation} \d{U} = \td{}{U}{S}{V} \d{S} + \td{}{U}{V}{S} \d{V} \end{equation}\]

By comparing the two, we see that

(2.33)#\[\begin{equation} T = \td{}{U}{S}{V} \qquad P = -\td{}{U}{V}{S} \end{equation}\]

This shows that T and P are functions of S and V! Their derivatives can be computed and manipulated using rules of multivariable calculus in order to relate measurable quantities like T and P to the derivatives of an unmeasurable quantities like U! For example, the change in internal energy for an adiabatic process (constant S) is:

(2.34)#\[\begin{equation} \Delta U = \int_{V_1}^{V_2} \td{}{U}{V}{S} \d{V} = \int_{V_1}^{V_2} -P \d{V} \end{equation}\]

We can also relate quantities as mixed derivatives. For example, the entropy derivative of the pressure cannot be measured easily, but it is related to the temperature change during adiabatic compression:

(2.35)#\[\begin{equation} -\td{}{P}{S}{V} = \frac{\partial ^2 U}{\partial S \partial V} = \frac{\partial^2 U}{\partial V \partial S} = \td{}{T}{V}{S} \end{equation}\]

2.3.2. Swapping variables and derivatives#

We say U has S and V as “natural” variables because they are what appears in the differential first law. But, we do not like S as a variable because we cannot measure it. We would love to use T instead. Can we swap the two?

Yes, if we define the Helmholtz free energy:

(2.36)#\[\begin{equation} A = U - T S \end{equation}\]

where S is now a function of T and V and so is U as a result. The total differential for A confirms this:

(2.37)#\[\begin{align} \d{A} &= \d{U} - (T \d{S} + S \d{T}) \\ &= (T \d{S} -P \d{V}) - T \d{S} - S \d{T} \\ &= -S \d{T} -P \d{V} \end{align}\]

As a result,

(2.38)#\[\begin{align} S &= -\td{}{A}{T}{V} \\ P &= - \td{}{A}{V}{T} \\ \td{}{S}{V}{T} &= \td{}{P}{T}{V} \end{align}\]

Other quantities can be defined to use different sets of natural variables.

  • Enthalpy H

    (2.39)#\[\begin{align} H &= U + P V \\ \d{H} &= T \d{S} + V \d{P} \end{align}\]
  • Gibbs free energy G

    (2.40)#\[\begin{align} G &= A + P V = U - T S + P V \\ \d{G} &= - S \d{T} + V \d{P} \end{align}\]

The reasons for making these definitions are based on a concept called a Legendre transformation and this has important implications in thermodynamics (e.g., why \(\Delta G < 0\) for a spontaneous process at constant T and P).

Example: Change in internal energy

We want to compute the change in molar internal energy \(\Delta U\) of a substance as we vary the temperature T and pressure P in terms of quantities we can measure. In addition to T and P, these quantities are the molar volume V, the thermal expansion coefficient \(\alpha_V\), the isothermal compressibility \(\kappa_T\), and the constant-pressure heat capacity \(c_P\):

(2.41)#\[\begin{align} \alpha_V &= \frac{1}{V} \td{}{V}{T}{P} \\ \kappa_T &= -\frac{1}{V} \td{}{V}{P}{T} \\ c_P &= \td{}{H}{T}{P} \end{align}\]

where \(H\) is the molar enthalpy. The following total differentials are known from thermodynamics:

(2.42)#\[\begin{align} \d{U} &= T \d{S} - P \d{V} \\ \d{H} &= T \d{S} + V \d{P} \\ \d{G} &= -S \d{T} + V \d{P} \end{align}\]

where S is the molar entropy and \(G\) is the molar Gibbs free energy.


First, we express the total differential for U as a function of T and P:

(2.43)#\[\begin{equation} \d{U} = \td{}{U}{T}{P} \d{T} + \td{}{U}{P}{T} \d{P} \end{equation}\]

Next, we form the derivatives using the given total differential for U:

(2.44)#\[\begin{align} \td{}{U}{T}{P} &= T \td{}{S}{T}{P} - P \td{}{V}{T}{P} \\ \td{}{U}{P}{T} &= T \td{}{S}{P}{T} - P \td{}{V}{P}{T} \end{align}\]

Then, we go about replacing what we don’t like because we can’t measure it with things that we can. For \((\partial S/ \partial T)_P\), use the chain rule followed by the inversion rule:

(2.45)#\[\begin{align} \td{}{S}{T}{P} &= \td{}{S}{H}{P} \td{}{H}{T}{P} \\ &= \frac{ (\partial H/\partial T)_P }{ (\partial H/\partial S)_P } \\ &= \frac{c_P}{T} \end{align}\]

where the last step used the total differential for \(H\) to replace the derivative in the denominator. Additionally using the definition of \(\alpha_V\) gives

(2.46)#\[\begin{align} \td{}{U}{T}{P} &= T \left( \frac{c_P}{T} \right) - P V \alpha_V \\ &= c_P - P V \alpha_V \end{align}\]

For \((\partial S/\partial P)_T\), use the total differential for \(G\) and equate its mixed second derivatives:

(2.47)#\[\begin{equation} -\td{}{S}{P}{T} = \td{}{V}{T}{P} = V\alpha_V \end{equation}\]

Additionally using the definition of \(\kappa_T\) gives

(2.48)#\[\begin{align} \td{}{U}{P}{T} &= T (-V \alpha_V) - P(-V\kappa_T) \\ &= P V \kappa_T - T V \alpha_V \end{align}\]

Putting it all together:

(2.49)#\[\begin{equation} \d{U} = (c_P - PV\alpha_V)\d{T} + V(P\kappa_T - T\alpha_V)\d{P} \end{equation}\]

This total differential is now suitable for integration with respect to T and P using only measurable quantities!

2.3.3. Skill builder problems#

Given

(2.50)#\[\begin{equation} $\d{f} = p \d{x} - q \d{y}$ \end{equation}\]

Evaluate the following for \(f=\cos(4x+y^2)+x^2y\)

  1. \(\displaystyle\td{}{x}{f}{y}\)

    Solution
    (2.51)#\[\begin{align} \td{}{x}{f}{y} &= \frac{1}{(\partial f/\partial x)_y} \\ &= \frac{1}{p} \\ &= \left(-4\sin(4x+y^2)+ 2xy\right)^{-1} \end{align}\]
  2. \(\displaystyle\td{}{f}{p}{y}\)

    Solution
    (2.52)#\[\begin{align} \td{}{f}{p}{y} &= \td{}{f}{x}{y} \td{}{x}{p}{y} \\ &=\frac{(\partial f/\partial x)_y}{(\partial p/\partial x)_y} \\ &=\frac{p}{(\partial p/\partial x)_y} \\ &=\frac{-4 \sin(4x+y^2)+2xy}{-16 \cos(4x+y^2)+2y} \end{align}\]
  3. \(\displaystyle\td{}{x}{y}{f}\)

    Solution
    (2.53)#\[\begin{align} \td{}{x}{y}{f} & \td{}{y}{f}{x} \td{}{f}{x}{y} = -1 \\ \td{}{x}{y}{f} &= -\frac{1}{(\partial y/\partial f)_x(\partial f/\partial x)_y} \\ &= -\frac{(\partial f/\partial y)_x}{(\partial f/\partial x)_y} \\ &= \frac{q}{p} \\ &=\frac{2y\sin(4x+y^2)+x^2}{-4\sin(4x+y^2)+2xy} \end{align}\]