# How is first law of thermodynamic denoted correctly?

In thermodynamics, the first law is

$$dU = \delta Q - p dV$$

Now, second law of thermodynamics say

$$\delta Q \le T dS$$

where equality is for reversible processes. So by combination I get

$$dU \le T dS - p dV$$

But in many cases the equation is written generally as

$$dU = T dS - p dV$$

If U is to be defined as a function of S, V, there must be the equality, because dU is a total derivative. But on the other hand, taking into account that $$\delta Q/T \le dS$$, the first form also give sense. So those two are somehow contradicting.

Which one is correct?

In some of my textbooks the first variant is first introduced, but suddenly it is written with the equality without notice.

**** EDIT 1 ****

This is an example I want to discuss:

Lets say I have an isolated vessel with an ideal gas in a state with T, p, V. When I open a door so that the new Volume is V+dV, with new new volume dV initially in vacuum, after some while I have a new equilibrium state where the gas occupies the new total volume. No heat can be exchanged and no external work is done.

The end state is an equilibrium state with

p, T, V+dV

(T must stay constant because U doesn't only depend on T and U stays constant, because there is neither heat nor extern work.

Using entropy change of ideal gas

$$dS = C_v/T \cdot dT + nR/V \cdot dV$$

we would get

$$TdS = nRT/V\cdot dV = pdV$$

and

$$dU=TdS-pdV = 0$$

This is what I expect: $$dU=0$$

Interestingly I used an irreversible process to come from the initial state to the end state, but the equal sign seems to be valid in $$dU=TdS-pdV$$. Surprising, because I thought all the time, I have to use inequality for irreversible processes.

So is it correct to say, that the exact kind of the process that drives me from from initial state I to the end state E is not relevant at all and it can even be irreversible as long as I and E are equilibrium states? So the process used has nothing to do with the state?

$$dU = d'Q+d'W$$ is a process equation whereas $$dU = TdS-pdV$$ is a state equation, independent of process?

Moreover I observe:

$$TdS = nRT/V \cdot dV > dQ = 0$$

$$TdS > dQ$$

and from

$$dU = dQ + dW$$

$$pdV > dW$$

So wouldn't it better instead of

$$dU \le TdS -pdV$$

to say

$$dU = TdS -pdV$$

$$dQ \le TdS$$ $$dW \le pdV$$

because this does not mix up process variables with state variables?

• A comment to expand on the answer given: The T you have in the inequality is not the T you have in the first law. In the first law, T is that of the system, in the inequality, is that of the surroundings. If you use the T of the system instead, you get an equality, valid also for an irreversible process
– user65081
Nov 10, 2021 at 16:09
• @Wolphramjonny do you have a citation for that claim? Nov 10, 2021 at 17:29
• @lalala wikipedia
– user65081
Nov 10, 2021 at 17:31
• @Wolphramjonny so probably wrong.... Nov 10, 2021 at 17:39
• @lalala you didnt even read it or said why it is wrong. If you are lazy is not my fault.
– user65081
Nov 10, 2021 at 17:43

We have conservation of energy which is expressed $$dU = dQ + dW \tag{1}$$ and by arguments involving Clausius' theorem one can arrive at $$dU = T dS - p dV. \tag{2}$$ Both the above equations hold no matter how the changes are taking place. (1) can be interpreted as a statement that there is a state function called internal energy and it changes by the amount of energy coming in via heat and work, no matter what the process may be. (2) can be interpreted as a statement about the change in various state functions between neighbouring equilibrium states. It does not depend on process. This may be compared to the fact that the height difference between two places on a hill does not depend on how you walk between them: it does not depend on the route, nor on whether you drag your feet or hop or whatever. (In this illustration dragging your feet is comparable to irreversible contributions such as friction, and hopping is comparable to passing out of equilibrium altogether).

When discussing irreversible processes one should note that $$T$$ and $$p$$ might not be well-defined or single-valued throughout a system during the process, but this fact is irrelevant to the use of (2) to make a statement about neighbouring equilibrium states. So we do not need any special notation for $$T$$ and $$p$$ when using (2).

The mistake is to think that $$dQ = T dS$$ and $$dW = - p dV$$. Those equalities only hold for reversible processes. More generally one has $$dQ = T dS - |d\epsilon| \\ dW = -p dV + |d\epsilon|$$ where the quantity $$d\epsilon$$ is some amount of energy associated with irreversible contributions coming from things like friction, turbulence, dissipation and the like. The modulus sign is to make it clear that $$dQ \le T dS$$ and $$dW \ge - pdV$$. The first of these can be seen as the statement that the entropy changes by at least the amount of entropy coming in via heat, and possibly by more than this. The second result (work) says that to compress something you have to supply at least enough work to push against the pressure, and possibly some more to overcome friction. Equally, when the system expands then its surroundings will receive less work than $$p dV$$ if there is friction.

In view of the above one should not write $$dU = dQ - p dV$$ because that is not always true (it is only true for reversible processes) whereas (1) and (2) above are both always true.

The problem is the relationship $$\delta Q\leq TdS$$. It should more properly read $$\int{\frac{dQ}{T_B}}\leq \Delta S$$where $$T_B$$ is the temperature at the boundary interface between the system and surroundings (through which dQ flows). For a reversible process, $$T_B$$ is equal to the system temperature T.

In all cases, between two closely neighboring thermodynamic equilibrium states of a closed system,$$dU=TdS-pdV$$

• I appreciate your answer very much, but I do no understand what you mean: What is the difference between T and $T_B$? Nov 10, 2021 at 15:34
• Do you think that, in an irreversible process, the temperature within the system is always spatially uniform? Nov 10, 2021 at 15:39
• If your process uses a single constant temperature reservoir at $T_R$, and this is the only entity that the system exchanges heat with, then it is correct to write for the actual irreversible process $dQ\leq T_RdS$. So you would have $\Delta U\leq T_R\Delta S-W$. However, for two closely neighboring thermodynamic equilibrium states, you must have dU=TdS-pdV, where dS is the entropy difference between the two differentially separated equilibrium states and dV is the volume difference between the two differentially separated equilibrium states. Nov 10, 2021 at 19:46
• This later equation is true regardless of how tortuous and/or irreversible the path was that took you from the first state to the second state, as long as the two states are both thermodynamic equilibrium states and differentially separated. Nov 10, 2021 at 19:51
• I'm uncomfortable discussing irreversible. processes in terms of differentials of system-wide parameters, since there are likely to be spatial variations of many of the parameters within the system. Express you thoughts in terms of differences between initial and final thermodynamic equilibrium states, and I will be glad to comment. Nov 10, 2021 at 21:01