Thermodynamic equation of differentials (and how to work with them) Disclaimer: I am not a mathematician, I am a physicist.
The thermodynamic identity is usually expressed in the following differential form
$$
dU = TdS - PdV + \mu dN,
$$
where $U$, $T$, $S$, $P$, $V$, $\mu$ and $N$ are the internal energy, temperature, entropy, pressure, volume, chemical potential and number of particles of the system respectively. If I am not mistaken, I can act with a vector, say $\frac{\partial}{\partial N}$, to yield
$$
 \frac{\partial U}{\partial N} = T \frac{\partial S}{\partial N} - P \frac{\partial V}{\partial N} + \mu \implies \mu = \frac{\partial U}{\partial N} - T \frac{\partial S}{\partial N} + P \frac{\partial V}{\partial N}.
$$
Consider the following question:
Consider a monoatomic ideal gas that lives at height $z$ above sea level, so each molecule has potential energy $mgz$ in addition to its kinetic energy. Show that the chemical potential $\mu$ is the same as if the gas were at sea level, plus am additional term $mgz$:
$$
\mu(z) = -k_b T \text{ln}\left[\frac{V}{N}\left(\frac{2\pi m k_bT}{h^2}\right)^{3/2}\right] + mgz.
$$
My attempt was knowing that:
The "ideal monoatomic gas" implies $U = \frac{3}{2}k_bT$ (by equipartition theorem) and the validity of Sackur-Tetrode equation: 
$$
S=k_bN\ln \left[{\frac {V}{N}}\left({\frac {4\pi m}{3h^{2}}}{\frac {U}{N}}\right)^{3/2}\right]+{\frac {5}{2}},
$$
together with the assumption that $V \neq V(N)$. If one uses the above formula for $\mu$ and takes the partial derivatives I yield
$$
\mu(z) = -k_b T \text{ln}\left[\frac{V}{N}\left(\frac{2\pi m k_bT}{h^2}\right)^{3/2}-\frac{3}{2}\right] + mgz,
$$
which is almost correct except for that $-\frac{3}{2}$, although it still exhibits the problems described below.
I came to the conclusion that I don't know how to manipulate these equations in differential form, am I allowed to do the above "act with $\frac{\partial}{\partial N}$" business? The solution provided by the book is to say, hey hold $U$ and $V$ fixed so that the thermodynamic identity now reads
$$
0 = TdS - 0 + \mu dN \implies \mu = T \left(\frac{\partial S}{\partial N}\right)_{V,U \text{ fixed}}
$$
but $U = U(N)$, in particular $U = \frac{3}{2} k_b N T$ I could litterally make all the $N$s in $S$ dissapear by substituting $N = \frac{2 U}{3 k_b T}$ and claim that  
$$
\mu = T \left(\frac{\partial S}{\partial N}\right)_{V,U \text{ fixed}} = 0,
$$
which is ridiculous. I'm really lost with the mathematics behind this type of calculations... Which would be the correct way to proceed? 
 A: Start from the fact that $S=S(U,V,N)$ and the relation $dU = TdS - p dV + \mu dN$.  As you say, holding $V$ and $U$ fixed, this yields
$$\mu = - T \left(\frac{\partial S}{\partial N}\right)_{V,U} = -T \lim_{h\rightarrow 0} \frac{S(U,V,N+h)-S(U,V,N)}{h}$$
Your claim is that if you write $U$ as a function of $N$, then you can make this zero by eliminating the explicit $N$ dependence of $S$.  This isn't true, because you'd be introducing an implicit N-dependence via your expression for $U$.  
To be more explicit, you are considering the following new function:
$$\Sigma(U,V,N) = S\left(U,V, \frac{2U}{3kT}\right)$$
and saying that the $N$-dependence has disappeared.  But you've forgotten about $T=T(U,V,N)$.  Taking the partial derivative of this beast with respect to $N$ while holding $U$ and $V$ fixed would give you
$$\left(\frac{\partial \Sigma}{\partial N}\right)_{U,V} = \lim_{h\rightarrow 0}\frac{1}{h}\left[S\left(U,V,\frac{2U}{3kT(U,V,N+h)}\right) - S\left(U,V,\frac{2U}{3kT(U,V,N)}\right)\right]$$
This is, of course, just the chain rule:
$$\left(\frac{\partial \Sigma}{\partial N}\right)_{U,V} = \frac{\partial S}{\partial N}\left(U,V, \frac{2U}{3kT}\right) \cdot \frac{-2U}{3kT^2} \cdot \left(\frac{\partial T}{\partial N}\right)_{U,V} $$
$$= \frac{\partial S}{\partial N}\left(U,V, \frac{2U}{3kT}\right)\cdot \frac{-N}{T}\cdot \left(\frac{\partial T}{\partial N}\right)_{U,V}$$
But since $ N = \frac{2U}{3kT}$, we have 
$$\left(\frac{\partial N}{\partial T}\right)_U = -\frac{2U}{3kT^2} = \frac{-N}{T}$$
$$\left(\frac{\partial T}{\partial N}\right)_U = -\frac{T}{N}$$
which leaves us with
$$\left(\frac{\partial \Sigma}{\partial N}\right)_{U,V} = \frac{\partial S}{\partial N} \left(U,V, \frac{2U}{3kT}\right)$$
as we would expect.
