# First law of Thermodynamics and the definition of Internal Energy

From the Wikipedia page on internal energy I get the following definition

$$U=TS-PV+\sum\mu_iN_i$$

Hence, $$dU=TdS+SdT-VdP-PdV+\sum\mu_idN_i$$

For constant pressure and temperature and when there is no transfer of matter, $$dU=TdS-PdV$$

which is the 1st law of thermodynamics. My question is: For isothermal processes (constant temperature) $$dU=0$$. Then how will I get to the 1st law of thermodynamics from this definition?

• For an isothermal process, dU is zero only for an ideal gas. Your reference gives dU for the more general case of a real gas when U also depends on V (if you look for it). Commented Aug 17, 2020 at 14:55

First principle of thermodynamics is actually $$\Delta U = q + w,$$ where $$q$$ and $$w$$ are heat and work exchanged by the system with the environment.
For the special case of a reversible transformation $$dU = TdS -PdV.~~~~~~~~~~~~~~~~~[1]$$ In general, $$U$$ depends on $$S$$ and $$V$$, and such a dependence can be transformed into a dependence on $$T$$ and $$V$$. It is only for the special case of a perfect gas that $$U$$ depends on $$T$$ only. Therefore, from the special case of the isothermal behavior of a perfect gas it is impossible to obtain a relation like $$[1]$$ which is valid for all phases and for all systems.