I am trying to calculate the partition function of a photon gas. The book I'm currently following is "Thermal Physics by Garg, Bansal, and Ghosh"
It does the following:
The parition function is
$$Z = \sum_{n_i=0}^{\infty}\exp[-\frac{n_1 h \nu_1}{k_BT}-\frac{n_2 h \nu_2}{k_BT}-...]$$
$$=\sum_{n_1=0}^{\infty}\exp(-\frac{n_1 h \nu_1}{k_BT}) \sum_{n_2=0}^{\infty}\exp(-\frac{n_2 h \nu_2}{k_BT})...$$
$$=\prod_{i=1}^\infty \frac{1}{1 - \exp(-h \nu_i/kT)}$$ by using infinite series.
$$\ln Z = - \sum_{i=0}^\infty \ln(1 - \exp(-h \nu_i/kT))$$
This much is fine, but then it says exactly this:
Note that the summation is over all single photon states. Therefore, we have to multiply the expression on the right hand side by the number of states in volume $V$ and in the frequency range $\nu$ to $\nu + d\nu$. You may recall that this number is $\frac{8 \pi V \nu ^2 d\nu}{c^3}$. Hence, on replacing summation by integration and multiplying by the number of states, we get:
$$\ln Z = -\frac{8 \pi V}{c^3} \int_0^{\infty} \nu ^2 \ln(1-\exp(-h \nu/kT) d\nu$$
This last step is difficult to understand. The summation is over $i$, which is an index to designate separate frequencies of photons. This is not over states so that I could multiply by D.O.S function. Also, why would we multiply it here? The quantity is not even $Z$, it is $\ln Z$...