Chemical potential of particles with zero mass Why massless particles have zero chemical potential?
 A: Photons require matter in order to come into thermal equilibrium (if you ignore the negligible contribution from photon-photon scattering). This means that the particle number is not conserved. This further implies that in order for the free energy to be minimum (for a given temperature and volume), you also need $$\partial F/\partial N=0$$ because now $N$ can vary too. Since $$(\partial F/\partial N)_{T,V}=\mu$$ we have $$\mu=0$$.
A: Massless particles don't always have zero chemical potential. Suppose that you have a box full of photons and other particles, and it's possible for the photons to exchange energy with other particles, but the number of photons cannot change. Then the system will reach a thermal equilibrium in which the photons are described by a Bose-Einstein distribution with (in general) a nonzero chemical potential.
The reason this doesn't usually happen with photons is that the number of photons is often not conserved in situations like this. If there are photon-number-changing processes, then the equilibrium state for the photons will have zero chemical potential (since otherwise entropy could go up by creating or destroying a photon).
In summary, the rules are that the chemical potential must be zero if particle-number-changing interactions are possible, but not otherwise. That distinction often coincides with the massless or massive nature of the particles, but not always.
By the way, there was a period of time in the early Universe when we were in precisely this situation: photons could thermalize via Compton scattering with electrons, but at the temperature and density at the time, photon-number-changing processes essentially did not occur. That means that the cosmic microwave background radiation today could have a nonzero chemical potential. People have tried to measure the chemical potential, but as it turns out it's consistent with zero to quite good precision. This makes sense, as long as the photons and electrons came into thermal equilibrium at an earlier epoch (when photon-number-changing processes did occur), and nothing happened during the later epoch to mess up that equilibrium. Various theories in which particle decays inject energy into the Universe during the constant-photon-number epoch are ruled out by this observation.
A: The short answer: if the system is in thermal equilibrium the photons are absorbed/emitted and do not change the internal energy of the system. The chemical potential is zero. In all other occasions the absorption/emission of a photon (say single photon e/a) changes the internal energy and the photon has chemical potential.
