# Internal Energy and entropy in a open system

$$U= TS-PV+\sum_i \mu_i N_i$$

Let's suppose i=1 and a ideal gas. We know: $$U=N/N_A c_v T$$;

$$PV=NKT$$;

$$\mu=\frac{\partial U}{\partial N}= c_v T/N_A$$;

so $S=\frac{U+PV-\mu N}{T}$ would be $NK$

but it's not true. Where is the mistake?

-
I am having a hard time figuring out what each symbol means. Could you explicitly identify them, please? –  Mark Eichenlaub Mar 28 '11 at 2:11

The problem here is that the thermodynamic potentials are functions of three thermodynamic variables each. Now, each thermodynamic potential has a set of natural variables. For the internal energy $U$, these are S, V and N.
Now, your partial derivatives should explicitly state which other variables are held constant. For example, $$\mu = (\frac{\partial U}{\partial N})_{S,V}$$ i.e. you keep $S$ and $V$ constant.
You are, of course, free to express the internal energy as a function of other quantities, such as temperature instead of entropy. This would be achieved by expressing $S$ as a function of $V$, $N$ and $T$, so $S = S(T,V,N)$ or $T = T(S,V,N)$.
Thus, if you want to use the equation $U = N/N_A c_v T$ to compute $\mu$, you get $1/N_A c_v T$ from the $N$-dependency, but also some contribution from $$(\frac{\partial T}{\partial N})_{S,V}$$.