Solution (source code)

= Solution

For an ideal gas of identical <boson>[bosons], the <Bose-Einstein distribution> gives the mean occupation of a discrete one-particle state $r$ as
$$
\boxed{n_r=\frac1{e^{\beta(E_r-\mu)}-1}},
\qquad \beta=\frac1{k_BT},
$$
where $\mu$ is the <chemical potential>. If the spectrum is sufficiently dense to use a <density of states> $g(E)$, the discrete <sum> becomes
$$
\boxed{
N=\int_0^\infty
\frac{g(E)}{e^{\beta(E-\mu)}-1}\,dE,
\qquad
E_{\rm tot}=\int_0^\infty
\frac{E g(E)}{e^{\beta(E-\mu)}-1}\,dE.}
$$