4.1. Differentials

Thermodynamic quantities share many deep relationships with one another and these are often revealed through use of differentials. A (total) differential tells you the amount of change in a variable as a function of all the other variables. For example, the familiar slope-intercept equation of a line \(y=mx+b\) has the differential \(dy=mdx\), indicating how small changes in variable \(x\) which are symbolized as \(dx\) couple to small changes in \(y\) which are symbolized as \(dy\).

A general expression for a differential is shown below. It says that the differential is the sum of the partial derivatives of the function with respect to each variable (\(x_1\), \(x_2\), … \(x_n\)) times an infinitesimal change for each variable. The subscript \(x_{j\ne i}\) on the right parenthesis indicates explicitly that all variables are held constant except for the one where the partial derivative is being taken.

\[df(x_1,x_2,\cdots x_n) = \sum_i \left(\frac{\partial}{\partial x_i}f\right)_{x_{j\ne i}}dx_i\]

When expanded, the first few terms look like this.

\[df(x_1,x_2,\cdots x_n) = \left(\frac{\partial}{\partial x_1}f\right)_{x_{i\ne 1}}dx_1 + \left(\frac{\partial}{\partial x_2}f\right)_{x_{i\ne 2}}dx_2 + \left(\frac{\partial}{\partial x_3}f\right)_{x_{i\ne 3}}dx_3 + \cdots\]

I think that for many students seeing differentials the first time, the notation is often the hardest part, so let’s look at a couple of examples. This will help make things a bit more concrete and will help to demonstrate the procedure. Consider the function \(z=x^2+2y^2\).

\[\begin{split}dz &= \left(\frac{\partial}{\partial x}z\right)_y dx + \left(\frac{\partial}{\partial y}z\right)_x dy \\ dz &= 2xdx + 4ydy\end{split}\]

Differentials are sometimes useful to work with in a more generic fashion. If we wanted to write out the differential of \(z\) that depends on \(x\) and \(y\), but without necessarily knowing the quantitative relationship between the variables, we can write it out as follows.

\[dz = \left(\frac{\partial}{\partial x}z\right)_y dx + \left(\frac{\partial}{\partial y}z\right)_x dy\]

practice calculating a differential

Questions: What are the differentials of the following functions?

  1. \(f = 10gh^2 -4g^3 + 3h^4\)

  2. \(w = \sin(2\pi xy) + e^{-ax^2}\)

Answers:

  1. \(df = \left(10h^2-12g^2\right)dg + \left(20gh + 12h^3\right)dh\)

  2. \(dw = \left(2\pi y\cos(2\pi xy) - 2ax e^{-ax^2}\right)dx + 2\pi x\cos(2\pi xy)dy\)

4.1.1. Exact and Inexact Differentials

In thermodynamics, sometimes we will start with a function and construct a differential, while other times we will simply start with the differential.

An exact differential yields the same integral regardless of path. It turns out that state functions have exact differentials. This requirement comes from consideration that the path integrals of exact functions give the same result independent of the path. I just mention this to be thorough, but don’t worry if you don’t know about path integrals. In contrast to state functions, path functions have inexact differentials.

We can use Euler’s criterion for exactness to determine whether a differential is exact or inexact, where exact differentials are based on state functions and inexact ones are based on path functions. To do this, take partial derivatives with respect to all variables in all possible orders and then assess whether the same result is achieved. If the order of partial derivatives does not change the result, the variable is exact, whereas if the order of partial derivatives does change the result, the variable is inexact.

Let’s look at the function

\[\begin{split}V=\frac{nRT}{P} \\\end{split}\]

to see if its differential is exact. We will test for exactness by checking whether taking partial derivatives of \(V\) with respect to the variables \(T\) and \(P\) gives the same result regardless of the order (\(T\) then \(P\) or vice versa). That is equivalent to asking the question

\[\begin{split}\left(\frac{\partial}{\partial T}\left(\frac{\partial f}{\partial P} \right)_T \right)_P \stackrel{?}= \left(\frac{\partial}{\partial P}\left(\frac{\partial f}{\partial T} \right)_P \right)_T \\\end{split}\]

We can check \(P\) then \(T\) to get

\[\begin{split}\left(\frac{\partial}{\partial T}\left(\frac{\partial f}{\partial P} \right)_T \right)_P = \left(\frac{\partial}{\partial T}\left(-\frac{nRT}{P^2}\right) \right)_P = -\frac{nR}{P^2} \\\end{split}\]

as well as \(T\) then \(P\) to get

\[\left(\frac{\partial}{\partial P}\left(\frac{\partial f}{\partial T}\right)_P \right)_T = \left(\frac{\partial}{\partial P}\left(\frac{nR}{P}\right)_P \right)_T = -\frac{nR}{P^2}\]

Then we can see that the same result is obtained regardless of the order of the partial derivatives, which is the criterion for exactness. We can then say that \(V\) is exact and that it is also a state function.

How can one determine whether a differential is exact if that is provided, rather than the full analytical function itself? Let’s evaluate the following equation to determine whether it is exact or inexact.

\[df = 2x^2dx + 3xydy\]

First, upon examining it, I hope you can see that we have the differential of a function \(f\) which has variables \(x\) and \(y\). The factor before the \(dx\) must be the partial derivative \(\partial f/\partial x\) and the factor before the \(dy\) must be the partial derivative \(\partial f/\partial y\).

\[\left(\frac{\partial f}{\partial x}\right)_y = 2x^2 \quad \textrm{and} \quad \left(\frac{\partial f}{\partial y}\right)_x = 3xy\]

In a sense, half of the derivatives have already been done for us. In that case, we can complete the test to see whether the order of partial derivatives matters or not. To answer the question

\[\begin{split}\left(\frac{\partial}{\partial x}\left(\frac{\partial f}{\partial y} \right)_x \right)_y \stackrel{?}= \left(\frac{\partial}{\partial y}\left(\frac{\partial f}{\partial x} \right)_y \right)_x \\\end{split}\]

we can observe that

\[\left(\frac{\partial}{\partial x} 3xy\right)_y = 3y\]

and that

\[\left(\frac{\partial}{\partial y} 2x^2\right)_x = 0\]

which shows us that different results are obtained for a different order of the derivatives. From this we conclude that the function \(f\) is inexact and therefore a path function.

practice calculating a differential

Questions: Use Euler’s criterion for exactness to determine whether \(f\) is a state function for the following relations.

  1. \(f = xy^3 + 2x + 4y\)

  2. \(df = 4xy^4dx + 8x^2y^3dy\)

  3. \(df = 4x^4ydx + 8x^3y^2dy\)

Answers:

  1. \(f\) is a state function as shown, below.

\[\begin{split}\left( \frac{\partial}{\partial y} \left( \frac{\partial}{\partial x}f \right)_y \right)_x = 3y^2 \\ \left( \frac{\partial}{\partial x} \left( \frac{\partial}{\partial y}f \right)_x \right)_y = 3y^2\end{split}\]
  1. The differential \(df\) is exact and \(f\) is a state function as shown, below.

\[\left( \frac{\partial}{\partial y} \left( \frac{\partial}{\partial x}f \right)_y \right)_x = \left( \frac{\partial}{\partial y} 4xy^4 \right)_x = 16xy^3\]

and

\[\left( \frac{\partial}{\partial x} \left( \frac{\partial}{\partial y}f \right)_x \right)_y = \left( \frac{\partial}{\partial x} 8x^2y^3 \right)_x = 16xy^3\]
  1. The differential \(df\) is inexact and \(f\) is a path function as shown, below.

\[\left( \frac{\partial}{\partial y} \left( \frac{\partial}{\partial x}f \right)_y \right)_x = \left( \frac{\partial}{\partial y} 4x^4y \right)_x = 4x^4\]

and

\[\left( \frac{\partial}{\partial x} \left( \frac{\partial}{\partial y}f \right)_x \right)_y = \left( \frac{\partial}{\partial x} 8x^3y^2 \right)_x = 24x^2y^2\]

4.1.2. Make Your Own Differential

Sometimes in thermodynamics it is useful to construct the differential of a funciton without necessarily knowing the function itself. If you have a function \(J(C,V)\), then even without knowing the functional form of \(J(C,V)\) you could write out its differential as follows.

\[dJ = \left( \frac{\partial J}{\partial C} \right)_V dC + \left( \frac{\partial J}{\partial V} \right)_C dV\]

Let’s think about what this tells us. Small changes \(dJ\) equal the sum of the derivative of \(J\) along the variable \(C\) times a little change \(dC\) and the derivative of \(J\) along the variable \(V\) times a little change \(dV\). It is a really generic statement. Try making one with your own initials.

If we somehow know that \(J\) is an exact (state) function, then we also know that the order of derivatives must commute.

\[\left( \frac{\partial}{\partial V} \left( \frac{\partial J}{\partial C} \right)_V \right)_C = \left( \frac{\partial}{\partial C} \left( \frac{\partial J}{\partial V} \right)_C \right)_V\]