# How to calculate the number of photons

• Buzz Bloom

#### Buzz Bloom

Gold Member
An issue arose in another thread about photons and gas in equilibrium. I made an effort to find an answer searching the internet, but my researching skills are not up to the task. The following is one example of the question for which I would like to learn how to calculate the answer.

Given one mole of H2 gas in a spherical container of radius one meter with a perfect insulation boundary, and the gas is in equilibrium with photons at a temperature of 300 kelvin, how many photons (approximately) are in the container with the gas?

The Planck blackbody function, radiation per unit area per unit wavelength ## M(\lambda, T)=\frac{2 \pi hc^2}{(\lambda^5)(e^{\frac{hc}{\lambda k T}}-1)} =n(\lambda) \, (\frac{c}{4})( \frac{hc}{\lambda} ) ## where ## n(\lambda) ## is the photon density per unit volume per unit wavelength. To get the photon density per unit volume ## n =\int\limits_{0}^{+\infty} n(\lambda) \, d \lambda ## . This is the easiest way I know of computing it. ## \\ ## Basically I worked backwards from a step in the derivation of ## M(\lambda, T) ##, where the photon density per unit volume per unit wavelength ## n(\lambda) ## has already been computed, and the next (final) step in getting ## M(\lambda, T) ## is to use the effusion rate formula ## R=\frac{n \bar{v}}{4} ## with ## \bar{v}=c ##, and ## n ## is made to be ## n(\lambda) ## because we are working with a spectral density here. This gets multiplied by ## E_p=\frac{hc}{\lambda} ## to give ## M(\lambda, T)=n(\lambda) (\frac{c}{4})(\frac{hc}{\lambda}) ##. The ## M(\lambda, T) ## in the form above (first line) is a very well-known result. This is easier than repeating the steps of the Planck function derivation where ## n(\lambda) ## gets computed after about 9 or 10 steps. ## \\ ## For a rough estimate, we can use ## \int\limits_{0}^{+\infty} M(\lambda, T) \, d \lambda=\sigma T^4 ##,(which is exact), where ## \sigma=5.67 \cdot 10^{-8} ## watts/(m^2 K^4), along with Wien's law, ## \lambda_p T=2.898 \cdot 10^{-3} ## m K, and a good estimate for ## \bar{\lambda} \approx 2 \lambda_p ##. This would get us an estimate for ## n ## without doing the integral of ## n=\int\limits_{0}^{+\infty} n(\lambda) \, d \lambda \approx \frac{\big{(}\int\limits_{0}^{+\infty} M(\lambda,T) \, d \lambda \big{)}\,(4) (2 \lambda_p)}{hc^2}=\frac{(\sigma T^4)(4)(2)(\frac{2.898 \cdot 10^{-3}}{T})}{hc^2} ##. My arithmetic (which I need to check) gets that ## n \approx 6 \cdot 10^{14} ## photons/m^3 . ## \\ ## A numerical (speadsheet) integration of ## n=\int\limits_{0}^{+\infty} n(\lambda) \, d \lambda ## would be more accurate, but I expect it would get a similar result.

Last edited:
• Dale and Buzz Bloom
A numerical (speadsheet) integration of n=+∞∫0n(λ)dλ n=\int\limits_{0}^{+\infty} n(\lambda) \, d \lambda would be more accurate, but I expect it would get a similar result.
Hi Charles:

Thank you very much for your post. I plan to use an online tool
to do the numerical integration. It has been very helpful to me in the past.

Regards,
Buzz

Hi Charles:

Thank you very much for your post. I plan to use an online tool
to do the numerical integration. It has been very helpful to me in the past.

Regards,
Buzz
You are welcome. I'd be very much interested in seeing what you get for an answer. I anticipate my estimate is reasonably good.

@Buzz Bloom I decided to google it, and it appears the answer can be written in closed form. See the formula for ## N ## in the table, which is proportional to ## V ##: https://en.wikipedia.org/wiki/Photon_gas ## \\ ## Edit: This result is giving me an answer about a factor of 250 smaller than what I computed above. I wonder if perhaps their ## h ## should be a ## \hbar=\frac{h}{2 \pi} ##.## \\ ## Additional edit: Comparing with what Reif has on p.375 of Statistical and Thermal Physics, it appears that indeed should be a ## \hbar ## in their formula. Yes, also see their footnote: Others have already pointed out this same error. (Just above the table in the fine print: see the words "disputed" in blue). It appears with the added factor of ## (2 \pi)^3 ## , they are now in agreement with my estimate above.

Last edited:
• Buzz Bloom
• 