Prelude to Maxwell Relations: Exact Differentials and Partial Differential Relations

Posted by Youssef Moawad on: 16/02/2018, in Physics

## Something new!

I had gotten a bit burned out after writing a few posts just about wave physics, so I thought I'd start exploring and writing about something else.

This post and the next one are inspired (and really sourced) directly from what I'm currently studying in my third year university physics course. As usual, I will be giving my take on things and explaining them in the way that was easy to understand for me. Much like the waves series, this will be mathsy!

### What we'll cover

There's some very pretty mathematics that I encountered while studying and deriving the Maxwell relations of thermodynamics. I thought this would be pretty cool to write about on here. So that's what we'll be doing in the next post.

Meanwhile, there's some prerequisite maths that we should cover first. Specifically, we'll be covering total derivatives, exact and inexact differentials and partial differential differential relations.

I will be assuming that the reader has had at least an introduction to multivariate calculus (i.e. comfortable using partial derivatives). And for the next part, I will assume the reader knows some thermodynamics: studied the first and second laws, isobaric, isochoric, isothermal and adiabatic reactions, knows about the work done in some process: $\delta W = -PdV$, and perhaps knows some about thermodynamic potentials (although I will likely be going through those).

## Total Derivatives

Very briefly, let's define the concept of a total derivative of a function of more than one variable. Consider a function $f=f(\underline{r})$ for $\underline{r}=(x,y)$ such that $f=f(x,y)$, then we can define the total derivative of $f$ to be:

$$df = \underline{\nabla}f\cdot d\underline r = \frac{\partial f}{\partial x}dx + \frac{\partial f}{\partial y}dy$$

Note: if you're not familiar with what $\underline\nabla$ does, don't worry! The important result is the one on the far right side.

In our consideration of thermodynamics, we will have more than 2 (about 8, in fact) thermodynamic variables, which could all be related to each by some function. In which case, we will usually define one variable as a function of two others. But in this case, we need to explicitly specify which variables are constant with respect to taking the partial derivative.

Let's take an example. Consider some system with three variables: $x$, $y$ and $z$. This system is governed by some state equation: $f(x,y,z) = 0$, in which case we can write any of: $x = x(y,z)$, $y = y(x,z)$ and $z = z(x,y)$. Now if we want to define the total derivatives of these, we have to explicitly specify that in the partial derivative, the other variable is being held constant. This is denoted by a subscript of the constant variable next to the partial derivative. For instance:

$$(\frac{\partial y}{\partial x})_z$$

denotes the partial derivative of $y$ with respect to $x$ while explicitly keeping $z$ constant. This is often referred to as constrained variable notation. This concept will hopefully become clearer as we continue using it.

We can now take the total derivatives of $x$, $y$ and $z$:

$$dx = (\frac{\partial x}{\partial y})_zdy + (\frac{\partial x}{\partial z})_ydz$$ $$dy = (\frac{\partial y}{\partial x})_zdx + (\frac{\partial y}{\partial z})_xdz$$ $$dz = (\frac{\partial z}{\partial x})_ydx + (\frac{\partial z}{\partial y})_xdy$$

## Exact and Inexact Differentials

Consider again the function $f$ as defined above: $f=f(x,y)$, such that the total derivative of $f$ is (while being clear about which variables are kept constant):

$$df = (\frac{\partial f}{\partial x})_ydx + (\frac{\partial f}{\partial y})_xdy$$

Here, the differential $df$ is called an exact derivative if and only if:

$$\frac{\partial}{\partial y})_x(\frac{\partial f}{\partial x})_y = \frac{\partial}{\partial x})_y(\frac{\partial f}{\partial y})_x$$

or, when the mixed second partial derivatives of $f$ are equal, that is to say that $f$ obeys Clairaut's theorem.

A differential which does not obey this relation is called an inexact differential, and is sometimes denoted with a $d$ crossed at the top. I will denote them here simply with a $\delta$ symbol: $\delta f$.

An important property of exact differentials is that the integral from some initial state to some final state is simply the different between the function evaluated at the final state and the function evaluated at the initial state:

$$\int^{\textrm{final}}_{\textrm{initial}}df = f(\textrm{final}) - f(\textrm{initial})$$

i.e. it is independent of the path followed. And so, this means that over a closed cycle, the integral must be zero:

$$\oint df = 0$$

And so, for an inexact differential, $\delta f$, in general, we have:

$$\oint \delta f \ne 0$$

### Relation with thermodynamics

It's important to introduce the concepts of exact and inexact differentials here, because in the first law of thermodynamics, the $Q$ (heat exchanged) and $W$ (work done) terms, are generally not exact differentials:

$$dU = \delta Q + \delta W$$

This is the differential form of the first law of thermodynamics, where $dU$ is an infinitesimal change in internal energy of a system for some process, $\delta Q$ is the infinitesimal heat transferred in the process and $\delta W$ is the infinitesimal work done on the system.

#### Showing that $\delta W$ is an inexact differential

This is a good chance to take an example and show that $\delta W$ is inexact. We know from previous studies of thermodynamics that the work done is given by:

$$\delta W = -PdV$$

Here, our variables are $P$, the pressure on the system, and $V$, the volume of the system. Hence, we can define the function $W = W(P,V)$ and write its total derivative:

$$dW = (\frac{\partial W}{\partial P})_VdP + (\frac{\partial W}{\partial V})_PdV$$

We can equate these two expressions to obtain:

$$(\frac{\partial W}{\partial P})_VdP + (\frac{\partial W}{\partial V})_PdV = -PdV + 0 \cdot dP$$

We can now equate coefficients of $dP$ and $dV$ to get:

$$(\frac{\partial W}{\partial V})_P = -P, (\frac{\partial W}{\partial P})_V = 0$$

Now remember from the above definition of an exact differential: the second mixed partial derivatives must be equal. So let's take the derivative with respect to $P$ while keeping $V$ constant of the first expression, and the derivative with respect to $V$ while keeping $P$ constant of the second expression:

$$(1): \frac{\partial}{\partial P})_V(\frac{\partial W}{\partial V})_P = \frac{\partial}{\partial P})_V(-P) = -1$$ $$(2): \frac{\partial}{\partial V})_P(\frac{\partial W}{\partial P})_V = \frac{\partial}{\partial V})_P(0) = 0$$

We find that these are clearly not equal, and we conclude that the second mixed partial derivatives of W are not equal. Hence, the differential $\delta W$ is not exact!

We can also perform similar analysis to prove that $\delta Q$ is also an inexact differential.

## Partial Differential Relations

With these concepts in mind, let's now define some relations between partial derivatives which will come quite handy in our discussion of Maxwell Relations, particularly the reciprocity relation and the cyclic relation.

Consider again three variables, $x$, $y$ and $z$, as above, bound by some condition $f(x,y,z) = 0$. Then we can define the following exact differentials (same as above), by taking total derivatives of $x(y,z)$, $y(x,z)$ and $z(x,y)$:

$$dx = (\frac{\partial x}{\partial y})_zdy + (\frac{\partial x}{\partial z})_ydz \quad (1)$$ $$dy = (\frac{\partial y}{\partial x})_zdx + (\frac{\partial y}{\partial z})_xdz \quad (2)$$ $$dz = (\frac{\partial z}{\partial x})_ydx + (\frac{\partial z}{\partial y})_xdy \quad (3)$$

#### Side note: Ideal Gas Example

I have been using arbitrary variables, $x$, $y$ and $z$, but I think it's important to relate these definitions to concepts in thermodynamics that we're going to discuss later.

Consider for instance an ideal gas in a box. For the system at a temperature, $T$, under pressure $P$ and occupying a volume $V$, we can write the state equation of the system, the ideal gas law:

$$PV = nRT$$

for $n$, the number of moles of the gas. Therefore, we can write:

$$\Rightarrow PV - nRT = 0$$

Now define a function $F(P,V,T)$, such that $F(P,V,T) = PV - nRT = 0$. So we can say that this function, $F(P,V,T)$, is a state function of the system and $P$, $V$ and $T$ correspond to $x$, $y$ and $z$ in the above.

Keep in mind that using an ideal gas here is just an example and that most of the concepts we're going to discuss later will be applicable to any thermodynamic system. For instance, I could've just as correctly given an example of a Van der Waals gas, which obeys the Van der Waals equation:

$$(P + a(\frac{n}{V})^2)(\frac{V}{n}-b) = RT$$

Substituting $(1)$ into $(3)$:

$$dz = (\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_zdy + (\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial z})_ydz + (\frac{\partial z}{\partial y})_xdy$$ $$\Rightarrow dz = ((\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z + (\frac{\partial z}{\partial y})_x)dy + (\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial z})_ydz$$

Rearranging this we get:

$$(1-(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial z})_y)dz = ((\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z + (\frac{\partial z}{\partial y})_x)dy$$

Since $y$ and $z$ are independent variables (so we can choose $dz$ and $dy$ freely and this relation must hold), the only way for this to hold is for the bracketed terms to be zero. So we get:

$$1-(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial z})_y = 0 \quad (4)$$ $$(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z + (\frac{\partial z}{\partial y})_x = 0 \quad (5)$$

#### Reciprocity relation

Rearranging the first (equation $(4)$) of those, we get:

$$(\frac{\partial z}{\partial x})_y = 1/(\frac{\partial x}{\partial z})_y$$

Therefore, we can write:

$$(\frac{\partial z}{\partial x})_y = ((\frac{\partial x}{\partial z})_y)^{-1}$$

This is the first of the reciprocity relations. The other two can be obtained by a similar analysis of equations $(1)$, $(2)$ and $(3)$ above, first by substituting $(1)$ into $(2)$ then substituting $(2)$ into $(3)$. I will leave this for you to check. The other reciprocity relations then are:

$$(\frac{\partial x}{\partial y})_z = ((\frac{\partial y}{\partial x})_z)^{-1}$$ $$(\frac{\partial y}{\partial z})_x = ((\frac{\partial z}{\partial y})_x)^{-1}$$

#### Cyclic relation

Now consider the second bracketed term (equation $(5)$), we have:

$$(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z + (\frac{\partial z}{\partial y})_x = 0$$

Rearranging:

$$(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z = -(\frac{\partial z}{\partial y})_x$$

We can use one of the reciprocity relations to change the term on the right hand side to $-((\frac{\partial y}{\partial z})_x)^{-1}$, such that:

$$(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z = -((\frac{\partial y}{\partial z})_x)^{-1}$$

Therefore, by dividing both sides by the term on the right hand side, we have:

$$(\frac{\partial y}{\partial z})_x(\frac{\partial z}{\partial x})_y(\frac{\partial x}{\partial y})_z = -1$$

This is called the cyclic relation. It can be shown that using other substitution of the equation $(1)$, $(2)$ and \$(3) will lead to the same result. Feel free to carry out that analysis, as an exercise.

## Closing Remarks

We've covered three main concepts in this post: total derivatives, exact and inexact differentials and partial differential relations. Most importantly to take away from this is total differentials, as we will be using them extensively when deriving the Maxwell relations, in the coming post.

Thanks for reading! I hope you found this post informative. Feel free to start a discussion if you have any questions or anything to add. There's comments below and you can always contact me through the site.

I'm hoping to be able to publish the post on Maxwell relations by the end of next week. I'll make sure to update this post once that's out. Also, as I'm writing this, I've been thinking about possibly making a series about thermodynamics. I'm not sure however, so updates soon!

Happy Physics-ing!

Update (02/06/2018): Deriving the Maxwell Relations is now up, here.

### Related

You may also be interested in: