Chemical potential of ideal gas under gravity Here is the 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 an 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.
$$
Here is my attempt:
The term "monoatomic ideal gas" implies that its kinetic energy $K=\frac{3}{2}Nk_bT$ (by the equipartition theorem). Thus its internal energy is given by $U= \frac{3}{2}Nk_bT + Nmgz$. Using the thermodynamic identity, $dU = TdS -PdV + \mu dN$ we can find an expression for the chemical potential $\mu$ by holding $S$ and $V$ fixed, $\mu = \left( \frac{\partial U}{\partial N} \right)_{S,V}$. Hence,
$$
\mu = \frac{3}{2}k_bT +\frac{3}{2}Nk_b \left( \frac{\partial T}{\partial N} \right)_{S,V} + mgz.
$$
Since it is an ideal monoatomic gas we can use the so-called Sackur-Tetrode equation for the entropy of the gas:
$$
S=k_bN\left\{\ln \left[{\frac {V}{N}}\left({\frac {4\pi m}{3h^{2}}}{\frac {U}{N}}\right)^{3/2}\right]+{\frac {5}{2}}\right\},
$$
where I believe $U$ is the internal energy of the gas. (I say "I believe" because not only it made sense when I derived the equation but also Wikipedia agrees. However, the solution manual says U is only the kinetic part, this distinction is important). We can solve the Sackur-Tetrode equation for $T$ in order to evaluate $\left( \frac{\partial T}{\partial N} \right)_{S,V}$, one yields
$$
T = \frac{2}{3 N K} \left[\text{exp}\left(\frac{2S}{3Nk_b}-\frac{5}{3}  \right)\left( \frac{N}{V}\right)^{2/3} \left( \frac{3h^2N}{4m}\right) - Nmgz \right],
$$
where I have used $U= \frac{3}{2}Nk_bT + Nmgz$. Then,
$$
\left( \frac{\partial T}{\partial N} \right)_{S,V} = \frac{h^2e^{-5/3}}{2mk_bV^{2/3}} \frac{\partial }{\partial N} \left( N^{2/3}\text{exp}\left( 
\frac{2S}{3Nk_b} \right)\right),
$$
which will not yield any logarithm or anything that resembles the solution.
This brings me to my questions:
1) Have I done anything conceptually wrong?
2) Is the $U$ in the Sackur-Tetrode equation supposed to be the internal energy as Wikipedia and I believe or just the kinetic energy as my book suggests?
3) Am I allowed to use the equipartition theorem to get the kinetic energy part of the internal energy $U$?
 A: Operationally, the Sackur-Tetrode equation is derived by calculating the volume of phase space which corresponds to a total energy less than $U$, dividing by $N!$ to resolve the Gibbs paradox, and then dividing by $h^{3N}$; the logarithm of this quantity is the entropy $S(U,V,N)$.
$$S(U,V,N) = \log\left[\frac{1}{N! h^{3N}}\underbrace{\int d^{3N}p \int d^{3N}x}_{E(p_i,x_i)<U\text{ and }x\in V}\right]$$
Assuming that the total energy $E = \sum_{i=1}^N \frac{p^2}{2m}$, the volume integral yields a factor of $V$ while the momentum integral is the volume of the $3N$-dimensional hypersphere of radius $\sqrt{2MU}$.
On the other hand, if the total energy is $E = \sum_{i=1}^N \left(\frac{p^2}{2m} + mgz\right) = \left(\sum_{i=1}^N \frac{p^2}{2m}\right) + N\cdot mgz$, then the position integral yields the same factor of $V$ (because $z$ is assumed to be constant over the volume in question) and the momentum integral yields the volume of the $3N$-dimensional hypersphere of radius $\sqrt{2M(U-N\cdot mgz)}$.
Working out that calculation is not particularly difficult - you just need to look up the formula for the volume of a hypersphere - but the details are not important here.  The relevant take-away is that the $U$ which typically appears in the Sackur-Tetrode equation is the kinetic part of the energy - the (squared) radius of the momentum hypersphere over which we perform the integral.

I don't see any egregious conceptual errors.  There is at least one typo that I pointed out in a comment - it's possible that there are others, but I have not followed the steps that you took precisely. You seem to be running into a mess - 
to give you a slightly different direction, you can take the Sackur-Tetrode equation, substitute $U = \frac{3}{2}Nk_b \cdot T(U,V,N)$, and apply the partial derivative $\left(\frac{\partial}{\partial N}\right)_{S,V}$ to both sides.  Obviously, the left hand side will be zero - the right hand side will involve $\left(\frac{\partial T}{\partial N}\right)_{S,V}$ via the chain rule, which should give you precisely what you're looking for.
(As a general rule, differentiating logarithms is a breeze, so I'd shoot for that when you can.)
