# $dU=dQ$ and $dU=TdS$, but $dQ$ not always equal to $TdS$? Why?

$$dU = dQ+dW$$ $$dU=TdS-pdV$$ The equations above are always true for a thermodynamic state of a certain system. Now let's say that we have a situation where $dW=0$, this tells us that $$dU=dQ$$ $$dU=TdS$$But still I can't write $dQ=TdS$, since this only works for a reversible change of my system. So if I don't have a reversible system I can work with $dU=dQ$ and $dU=TdS$, but I can't work with $dQ=TdS$.

I get this, but I have been trying to figure out why this is, and I just can't seem to get it.

• did you understand what you were getting confused about? – Rick Nov 27 '17 at 16:05
• yes, thank you! I understood after reading your answer and a bit from this link: physicsforums.com/insights/grandpa-chets-entropy-recipe – armara Nov 27 '17 at 16:06
• Reminding yourself that the entropy is a state function within the context of thermodynamics will tell you all you need to solve this mystery. – Vendetta Apr 2 '18 at 19:14

In $dS = \frac{dQ}{T}$, the $dQ$ is the heat exchange on a reversible path from the initial state to the final state, irrespective of how the process is actually carried out.
Even if dW = 0 (e.g., constant volume), you can't write dQ=TdS for an irreversible process because, for irreversible heating or cooling of a body, T is not constant spatially within the body (i.e., T varies with spatial position). For transient irreversible heating, the temperatures near the boundary are hotter than in the interior, and for transient irreversible cooling, the reverse is true. So what value of T are you supposed to use? If you use the value of T at the boundary at which the heat transfer Q is occurring (i.e., $T = T_B$), you find that $dQ<T_BdS$. More precisely, $$\int{\frac{dQ}{T_B}}<\Delta S$$This is just the statement of the Clausius Inequality.
• This is the reason why I never use differentials to describe irreversible processes. I reserve the use of differentials only for reversible paths. The equation $dU=TdS-PdV$ describes the mutual variations in dU, dS, and dV between two closely neighboring thermodynamic equilibrium states. But, if you want to move between two equilibrium states that are separated by a finite amount, you can't simply integrate $T_BdS$ to get Q. For example, you heat a body from T1 to T2, with the boundary held const at T2. For this change $\Delta U=Q=mC(T_2-T_1)$, but $\Delta S=mC\ln{(T_2/T_1)}>Q/T_2$ – Chet Miller Nov 27 '17 at 20:26
For an arbitrary process between equilibrium states of a closed system, we have $$\Delta U = Q + W$$ which is just conservation of energy.
If the process happens quasi-statically, state variables are well-defined at each point in time and we can go to an infinitesimal description $$dU = \delta Q + \delta W$$ where $$\delta Q \leq TdS \qquad \delta W = -p dV$$ Equality holds if the process is reversible, ie when the change in entropy is given by $dS = \delta Q/T$ without additional entropy production (due to friction, chemical reactions, what have you...).