Making use of Planck's formula, derive the expressions determining the number of photons per \(1 \mathrm{~cm}^{3}\) of a cavity at a temperature \(T\) in the spectral intervals \((\omega, \omega+d \omega)\) and \((\lambda, \lambda+d \lambda)\).