See attached file.
You need to use these formulas for the potential and kinetic parts of the internal energy in the formula of the entropy. The fundamental law of thermodynamics is:
dU = T dS - PdV + mu dN
From this you read off that
mu = -T(dS/dN)_U,V (1)
Let's first consider how the formula for the entropy will change if we include the potential energy due to the height. If you recall the derivation of the formula for the entropy:
S = k Log[Omega]
Omega = V^(N)/h^(3N) Integral d^(3N)p
where the momentum integral is over a shell in momentum space that corresponds to a certain internal energy of the gas, then it should be clear that you now need to substitute the kinetic part of the internal energy in that formula instead of the total internal energy, because the kinetic part fixes the shell in momentum space. The kinetic part of the total internal energy is, of course:
U_kin = U - mgzN
And the formula for the entropy ...
A detailed solution is given.