# 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}}$

-
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