# General expression of internal energy change in a closed system

let's say we have a classical closed system. What I've understood is that during a reversibile process the internal energy $E$ undergoes a change which could be expressed (as generally as possible) as

$dE=-VdP-PdV+SdT+TdS+\mu dN+Nd\mu$.

But if we consider that the system is closed, that the chemical potential $\mu$ is constant, we have:

$dE=-VdP-PdV+SdT+TdS$

And only if if we have that the temperature $T$ and pressure $P$ are constant, we get:

$dE=-PdV+TdS$

Am I wrong somewhere?

• You've misunderstood the way the thermodynamic variables work. You only need to specify 3 to have a full description of the system. So you should have dU=TdS-PdV+udN in your first expression. Commented Jun 27, 2016 at 13:40
• so @MaxTyler you'd say that my first expression is wrong or just redundant? Commented Jun 27, 2016 at 14:37
• More: why $dE=-PdV+TdS+\mu dN$ and not $dE=-VdP+SdT+Nd\mu$? Commented Jun 27, 2016 at 14:43
• The first expression is wrong, yeah. You can see where the expression for dE comes from in valerio's answer. For why dE doesn't equal that second term, you should learn about thermodynamic potentials - link, and the legendre transformation, which is what you use to change between them. Commented Jun 27, 2016 at 15:27

For a general closed systems containing only a single chemical species, you have, if you express $U$ as a function of its natural variables $\{S,V,N\}$

$$U=U(S,V,N)=TS-PV+\mu N$$

from which we obtain

$$d U = \frac{\partial U}{\partial S} dS + \frac{\partial U}{\partial V} dV + \frac{\partial U}{\partial N}dN=T dS - P dV + \mu dN$$

$U$ is a function of $\{S,V,N\}$ and not of $\{S,V,N,T,P,\mu\}$ because the last three are actually the conjugate variables of the first three.

Notice that the above formula is valid in general. What is not valid in general are the identities

$$\delta Q = T dS$$

and

$$\delta W = -P dV$$

Although the last two relations imply $dU = TdS-PdV$, the reverse is not true (for example $a=1, b=3$ implies that $a+b=4$ but $a+b=4$ does not imply that $a=1, b=3$) .