# Density of states of a photon gas in volume V and temperature T

I have a question on the density of states for a photon gas:

Suppose I have a photon gas in a box of volume $V$ at temperature $T$. If I enumerate the total number of states accessible to the system given that the system has a total energy $E$, and differentiate this with respect to the Energy, I should obtain the density of states in the energy space. However, when I do this I obtain:

$$\Gamma = \int d^{3}r_{1} d^{3}r_{2} d^{3} p_{1} d^{3}p_{2} \delta((\frac{|p_{1}|}{\hbar}+\frac{|p_{2}|}{\hbar})c-E)$$ where the two momenta are for the independent polarizations (modes of oscillation) of the gas. Then $\frac{d \Gamma}{d E}$ is not the "correct" density of states given in a textbook. What is wrong with this approach?

Edit: Showing more work:
The answer I obtain is $\frac{d \Gamma}{E}=\frac{8 * (4 \pi )^{2} V^{2} \hbar^{6} E^{7}}{c^{6} 4*280}$ the textbook says that it is $\frac{E^{2}}{\pi^{2} c^{3} \hbar^{3}}$

-
Can you show more of your work? –  joshphysics Jun 3 '13 at 3:25
Need more details. Please outline your approach and the resulting density of states that you have calculated. Also please include the textbook density of states. –  Joe Jun 3 '13 at 3:34
To begin with, if $p$ is momentum, why is there an $\hbar$ in your first formula? One should have $E^2-p^2c^2=0$ for photons. –  Raskolnikov Jun 3 '13 at 7:42
Your formula also implies there are only two photons possible in your system. But the thing is photon systems can have an arbitrary number of them. Of course, taking into account quantization, for each frequency or momentum, only discrete multiples of the corresponding energy will be accessible. Also, you are making a computation for the microcanonical ensemble with fixed energy. They are asking for a canonical ensemble with fixed temperature. And since photon number is not fixed, it's even grand canonical. –  Raskolnikov Jun 3 '13 at 8:03