For every vector n with integer components larger than or equal to zero, there are two photon states. This means that the number of photon states in a certain region of n -space is twice the volume of that region. An energy range of dε corresponds to shell of thickness dn = ⁠ 2 L / hc ⁠ d ε in n -space. Because the components of n have to be positive, this shell spans an octant of a sphere. The number of photon states g (ε) dε, in an energy range dε, is thus given by: g ( ε ε ) d ε ε = 2 1 8 4 π π n 2 d n = 8 π π L 3 h 3 c 3 ε ε 2 d ε ε . Inserting this in Eq. (3) and dividing by volume V = L gives the total energy density U V = ∫ ∫ 0 ∞ ∞ u ν ν ( T ) d ν ν , where the frequency-dependent spectral energy density u ν (T) is given by u ν ν ( T ) = 8 π π h ν ν 3 c 3 1 e h ν ν / k B T − − 1 . Since the radiation is the same in all directions, and propagates at the speed of light, the spectral radiance of radiation exiting the small hole is B ν ν ( T ) = u ν ν ( T ) c 4 π π , which yields the Planck's law B ν ν ( T ) = 2 h ν ν 3 c 2 1 e h ν ν / k B T − − 1 . Other forms of the law can be obtained by change of variables in the total energy integral. The above derivation is based on Brehm & Mullin 1989.