# Why is dU an exact differential and dq an inexact differential?

dU, dG, dH etc are all exact differentials and the variables themselves are known as state functions because they only depend on the state of the system. However, dq and dw for example, are inexact differentials. My questions is, what does this actually mean? I've been told that exact differentials are not dependent on the path (what does 'path' mean?) but inexact differentials are. I have been told this is related to line integrals but I am not sure how. Also is this relevant?

As opposed to an exact differential, an inexact differential cannot be expressed as the differential of a function, i.e. while there exist a function $U$ such that $U = \int \mathrm{d} U$, there is no such functions for $\text{đ} q$ and $\text{đ} w$. And the same is, of course, true for any state function $a$ and any path function $b$ respectively: an infinitesimal change in a state function is represented by an exact differential $\mathrm{d} a$ and there is a function $a$ such that $a = \int \mathrm{d} a$, while an infinitesimal change in a path function $b$ is represented by an inexact differential $\text{đ} b$ and there is no function $b$ such that $b = \int \text{đ} b$.

Consequently, for a process in which a system goes from state $1$ to state $2$ a change in a state function $a$ can be evaluated simply as $$\int_{1}^{2} \mathrm{d} a = a_{2} - a_{1} \, ,$$ while a change in a path function $b$ can not be evaluated in such a simple way, $$\int_{1}^{2} \text{đ} b \neq b_{2} - b_{1} \, .$$ And for a state function $a$ in a thermodynamic cycle $$\oint \mathrm{d} a = 0 \, ,$$ while for a path function $b$ $$\oint \text{đ} b \neq 0 \, .$$ The last mathematical relations are important, for instance, for the first law of thermodynamics, because while $\oint \text{đ} q \neq 0$ and $\oint \text{đ} w \neq 0$ it was experimentally found that $\oint (\text{đ} q + \text{đ} w) = 0$ for a closed system, which implies that there exist a state function $U$ such that $\mathrm{d} U = \text{đ} q + \text{đ} w$.

Not a complete answer, but the path is exactly what it sounds like. Say you are rolling a boulder up a hill. This increases its potential energy, which can be released by rolling the boulder down the hill. But the path you take to get to the top of the hill is irrelevant, only the height you raise the boulder matters for potential energy. So if you roll it up half way, let it fall back a quarter of the way, or any such combination of forward and back, none of this matters to the total change in potential energy (assuming perfect conditions, no friction, etc.).

With respect to Wildcat's great answer, this means for state functions the endpoints of your definite integral are all that matter: you could parameterize any path you want between the endpoints and the resulting (line) integral is the same.

Be careful, there are lots of confusion and misleading claims in introductory textbooks, like that "thermodynamics only applies to macroscopic objects", ignoring the whole field of nanothermodynamics or the thermodynamics of small objects; or that "thermodynamics only applies to equilibrium", ignoring that two Nobel Prizes for Chemistry were awarded to advances in the thermodynamics of non-equilibrium.

It is not true that an infinitesimal change in a path function "is represented by an inexact differential". Heat, as any other path function, can be represented by an exact differential. Precisely, one of those Nobel laureates has a book where heat is treated as an exact differential. The book is "Modern Thermodynamics: From Heat Engines to Dissipative Structures" by Kondepudi and Prigogine and the pair of authors explain this topic very well, so I will copy and paste the relevant part:

For a closed system, the energy exchanged by a system with the exterior in a time dt may be divided into two parts: $$dQ$$, the amount of heat, and $$dW$$: the amount of mechanical energy. Unlike the total internal energy $$dU$$, the quantities $$dQ$$ and $$dW$$ are not independent of the manner of transformation; we cannot specify $$dQ$$ or $$dW$$ simply by knowing the initial and final states. Hence it is not possible to define a function $$Q$$ that depends only on the initial and final states, i.e. heat is not a state function. Although every system can be said to possess a certain amount of energy $$U$$, the same cannot be said of heat $$Q$$ or work $$W$$. But there is no difficulty in specifying the amount of heat exchanged in a particular transformation. If the rate process that results in the exchange of heat is specified, then $$dQ$$ is the heat exchanged in a time interval $$dt$$.

Most introductory texts on thermodynamics do not include irreversible processes but describe all transformations as idealized, infinitely slow, reversible processes. In this case, $$dQ$$ cannot be defined in terms of a time interval $$dt$$ because the transformation does not occur in finite time, and one has to use the initial and final states to specify $$dQ$$. This poses a problem because $$Q$$ is not a state function, so $$dQ$$ cannot be uniquely specified by the initial and final states. To overcome this difficulty, an "imperfect differential" $$\text{đ} Q$$ is defined to represent the heat exchanged in a transformation, a quantity that depends on the initial and final states and the manner of transformation. In our approach we will avoid the use of imperfect differentials. The heat flow is described by processes that occur in a finite time and, with the assumption that the rate of heat flow is known, the heat exchanged $$dQ$$ in a time $$dt$$ is well defined. The same is true for the work $$dW$$. Idealized, infinitely slow reversible processes still remain useful for some conceptual reasons and we will use them occasionally, but we will not restrict our presentation to reversible processes as many texts do.

The total change in energy $$dU$$ of a closed system in a time $$dt$$ is

$$dU = dQ + dW \>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>\>(2.2.3)$$

The quantities $$dQ$$ and $$dW$$ can be specified in terms of the rate laws for heat transfer and the forces that do the work. For example, the heat supplied in a time $$dt$$ by a heating coil of resistance $$R$$ carrying a current $$I$$ is given by $$dQ = (I^2 R)dt = VI dt$$, in which $$V$$ is the voltage drop across the coil.

In more advanced formulations one always work with rates

$$\frac{dU}{dt} = \frac{dQ}{dt} + \frac{dW}{dt}$$

with heat and work rates given by

$$\frac{dQ}{dt} = - \int_{B(t)} \mathbf{q} \mathbf{n} dB$$

$$\frac{dW}{dt} = - \int_{B(t)} \mathbf{T} \mathbf{v} dB + \int_{V(t)} \rho \mathbf{F} \mathbf{v} dV$$

For a system enclosed in a volume $$V$$ with a boundary $$B$$, with the work performed by the body forces per unit mass $$F$$ and the contact forces $$T$$, $$\mathbf{v}$$ being the velocity field, and $$\mathbf{q}$$ the heat flux vector on the normal $$\mathbf{n}$$ to the boundary, and $$\rho$$ the mass density.

• To clarify, are you saying the the typical formulation of heat exchange is an inexact differential, but treating these changes as occurring over finite time we can produce a formulation that involves exact (though time dependent) differentials? Does this agree with the conclusions you reached here: juanrga.com/2016/12/what-is-heat.html – Tyberius Mar 1 '19 at 16:30
• @Tyberius A change in any physical quantity only can happen is that quantity depends on time. The 19th century formulation of thermodynamics pretends quantities can change without using time as variable, which doesn't make sense. This pretension is the reason why concepts as inexact differentials have to be introduced in the classical formalism. Modern formalisms developed since 20th century use time and exact differentials for both heat and work. – juanrga Mar 1 '19 at 20:03