Q:

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? 

A:

You should carefully identify the validity range of each statement.  A more general statement can contain a special case, but it is not possible to obtain the more general from special cases. 
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.