Solution (source code)

= Solution

For an ideal mixture, the <Helmholtz free energy> is a sum over species. At fixed $T,V$ and all other populations, the <molecular partition function> $q_i$ does not depend on $N_i$. Differentiating the contribution written using each species' own energy reference gives
$$
\frac{\partial}{\partial N_i}\left[-N_i k_BT\ln q_i+k_BT(N_i\ln N_i-N_i)\right]
=-k_BT\ln q_i+k_BT\ln N_i.
$$
The desired additive energy term requires a consistent <energy reference in molecular partition functions>. Let $\varepsilon^{0,i}$ be the energy per molecule of species $i$ in its reference state, measured relative to a common chemical energy zero, and let $q_i$ sum excitations above that reference. Then
$$
q_i^{\rm abs}=e^{-\varepsilon^{0,i}/(k_BT)}q_i,
\qquad
A_i=N_i\varepsilon^{0,i}-N_i k_BT\ln q_i+k_BT(N_i\ln N_i-N_i).
$$
Therefore
$$
\boxed{\mu_i=\left(\frac{\partial A}{\partial N_i}\right)_{T,V,N_{j\ne i}}
=\varepsilon^{0,i}-k_BT\ln\frac{q_i}{N_i}}.
$$
One convenient choice is each species' rovibrational ground state, so the molecular reference includes its <zero-point energy>. A different consistent reference is possible, but the corresponding <partition function> must change. The offset cannot arise from differentiation of a formula that has already omitted it, and it must not be counted twice. These <chemical potentials> are per particle; molar expressions instead use the <molar gas constant>.