# Determination of chemical potential

I've written a partition function for a problem $Z_1=e^{\mu+\beta\varepsilon_1}+2e^{\mu+\beta\varepsilon_1}$ and calculated the free energy for N particles $F=-kT\ln{Z_1^N}$. I'd like to get the chemical potential, and the most reasonable way seems to be $\mu=(\frac{\delta F}{\delta N})_{T,V}$, but when I do this I get $\mu^2$ in the expression. I tried out the quadratic formula, getting two complicated answers (and I don't know which is real), but I think it shouldn't be necessary. Is there something I've done wrong here? I thought maybe I shouldn't have $\mu$ in the partition function but that doesn't make sense either.

It is quite hard to answer your question without knowing exactly what type of system you are dealing with. If you are considering a system which can only exchange heat with its surroundings, you would have a canonical partition function, with zero chemical potential. However, if you are considering a system which can exchange heat and particles with a source, then your partition function is for a grand canonical ensemble, and the chemical potential must be included in it.

As for your calculation, it doesn't seem to make sense to find the chemical potential as a function of itself, and you need to be sure depending on your system whether the chemical potential should be present or not in your partition function. If it isn't, then there would be no point to calculate the chemical potential at all, since it would be zero. What is it you are exactly trying to calculate? There might be a different way to approach your problem.

• I've figured out where the issue was. The ultimate goal was to describe equilibrium for two systems that can exchange particles. The partition function I was trying to create there was in fact supposed to be canonical, since it was meant to only describe the particles in that system. I could then set the potentials of the two systems equal. – Radagast May 18 '18 at 22:45

When you write the partition function for a single particle, the partition function is the canonical partition function for N=1. What made you think that just summing just the Boltzmann factors doesn't make sense? Maybe I'm missing what situation you're thinking of. If it is N-particle system with two energy levels, one with degeneracy 2, just removing chemical potential in the first place would work.

## How it should go

You can either start with the canonical ensemble or grand canonical ensemble, but the methods should not be mixed up.

### Canonical ensemble

Working in the canonical ensemble means the number of particles $N$ is fixed. In consequence, the canonical partition function does not explicitly include the chemical potential. In this case, $$Z_1 = e^{\beta\epsilon_1} + 2e^{\beta\epsilon_2}.$$ The following steps apply generally to a non-interacting $N$-particle system. $$Z_N = Z_1^N , \qquad$$ $$F_N(T) = -kT \ln Z_N = -NkT \ln Z_1 = NF_1$$ $$\mu \approx \left(\frac{\partial F_N}{\partial N}\right)_T = -kT \ln Z_1 = F_1$$

### Grand canonical ensemble

When you see a partition function including $\mu$, you're probably looking at the grand canonical partition function. Again, let's say $$Z_N = Z_1^N,$$ which is the best we can say without the knowledge whether the particles are fermions or bosons. $$\mathcal{Z} = \sum_{N}Z_Ne^{\beta\mu N} = \frac{1}{1 - Z_1e^{\beta\mu}}$$ $$\Omega(T,\mu) = -kT \ln \mathcal{Z} = kT \ln{(1 - Z_1e^{\beta\mu})}$$ $$\langle N \rangle = -\left(\frac{\partial \Omega}{\partial \mu}\right)_T = \frac{Z_1e^{\beta\mu}}{1 - Z_1e^{\beta\mu}}$$ $$\mu = -kT \ln Z_1 + kT \ln{\left(\frac{\langle N \rangle}{\langle N \rangle +1}\right)}$$ In the limit $\langle N \rangle \to \infty$, the result converges with the canonical ensemble.

• How would I remove the chemical potential? You are correct in the type of system. Are you saying it is not necessary to include the chemical potential in the partition function? – Radagast May 16 '18 at 0:00
• I think you should include a $N!$ factor (ie $Z_N = \frac{1}{N!} Z_1^N$) if you wand to avoid the Gibbs paradox ? – Pen Apr 26 at 8:54
• @Pen Indeed Z_N doesn't equal Z_1^N when you consider interacting N particles. Reducing by N! would be an example, in the case of a classical system with free particle exchange (as the post owner later added). – j824h Apr 26 at 9:36