# Factor of 4 discrepancy between integral of Planck's law vs Stefan-Boltzmann law

Consider an absolutely black sphere with unit surface area and temperature $$T$$. Planck's law states for the power emitted per unit area of the emitter per unit solid angle of emission per unit wavelength:

$$B_\lambda(\lambda,T)=\frac{2hc^2}{\lambda^5}\frac1{\exp\left(\frac{hc}{\lambda k_B T}\right)-1}.\tag1$$

Multiplying it by the complete solid angle $$4\pi$$ and unit surface area, and then integrating it over all wavelengths should give the total power emitted:

$$P(T)=4\pi\int_0^\infty B_\lambda(\lambda,T)\,d\lambda=\frac{8k_B^2\pi^5}{15c^2h^3}T^4.\tag2$$

But, according to Stefan-Boltzmann law, I should have obtained 4 times smaller result:

$$P(T)=\frac{2\pi^5k_B^4}{15c^2h^3}T^4.\tag3$$

Wikipedia says that the expression for Stefan-Boltzmann law gives

total energy radiated per unit surface area of a black body across all wavelengths per unit time

and for Planck's formula it's

power emitted per unit area of the body, per unit solid angle of emission, per unit frequency [wavelength, in my case].

Energy per unit time is power, solid angle is taken into account by the factor $$4\pi$$ in $$(2)$$, wavelengths are eliminated by integration. So it would seem that $$(2)$$ should be equal $$(3)$$. But it isn't.

So, what's the reason for this discrepancy?

The Stefan-Boltzmann law is $$\frac{P}{A}=\frac{2\pi^5 k^4}{15 h^3 c^2} T^4, \tag{1}$$ where $$P/A$$ denotes the emitted power per unit surface area of the blackbody. In equation (1), the coefficient of $$T^4$$ is the Stefan-Boltzmann constant. In contrast, the energy per unit volume ($$E/V$$) of the radiation inside the blackbody is $$\frac{E}{V}=\frac{8\pi^5 k^4}{15 h^3 c^3} T^4. \tag{2}$$ In equation (2), the coefficient of $$T^4$$ is the radiation constant. Equation (2) is used, for example, to compute the energy density of the cosmic microwave background radiation, because in that case we are inside the blackbody (the universe). These two quantities are related to each other by $$\frac{P}{A} = \frac{c}{4}\times \frac{E}{V}.$$ The question is, where does the factor of $$4$$ come from?
The essence of the answer is that inside the blackbody, the radiation at any point is coming and going equally in all directions; but outside the blackbody, that is no longer true. The distribution over directions is not uniform outside the body, and the difference ends up being a factor of $$4$$. Equation (1) describes the emitted power outside the blackbody, whereas equation (2) describes the energy density inside.
The derivation of both equations, (1) and (2), involves the quantity $$B(\lambda)$$ that was given in the OP. Consider the quantity $$\frac{4\pi}{c}B(\lambda)\,d\lambda \tag{3}$$ where $$d\lambda$$ is an infinitesimal range of wavelengths. The quantity (3) is the energy density of the electromagnetic (EM) radiation that is contained inside the blackbody, within the given range of wavelengths. The factor of $$4\pi$$ accounts for the full sphere's worth of possible directions of the radiation at each point inside the blackbody. Integrating (3) over all wavelengths gives the total energy density (2).
To derive the Stefan-Boltzmann law (1), suppose for a moment that radiation is only able to escape through a small hole of area $$A$$ in the surface of the blackbody. How much energy leaks out per unit time? If we consider plane waves moving in a particular direction, then the amount that escapes through the hole depends on the direction in which the plane wave is moving compared to the orientation of the hole. So, to calculate this, we should start with the quantity $$\frac{1}{c}B(\lambda)\,d\lambda, \tag{4}$$ which is the energy density per unit solid angle inside the blackbody. This is obtained from (3) by omitting the factor of $$4\pi$$. EM radiation travels at speed $$c$$, so the energy per unit time that escapes through the hole into a given narrow cone of solid angle $$d\Omega$$ is $$\frac{1}{c}B(\lambda)\,d\lambda\times cA\cos\theta\,d\Omega \tag{4}$$ where $$\theta$$ is the angle of the radiation's direction of travel relative to the direction normal to the hole. The factor $$A\cos\theta$$ is the area of the hole projected orthogonally to the direction in which the radiation is traveling. This is the key. To calculate the rate at which energy escapes, we should integrate the quantity (4) over all directions with $$\theta < \pi/2$$. Directions with $$\theta > \pi/2$$ don't contribute, because that radiation is moving toward the inside of the body instead of toward the outside. Doing this integral (and cancelling the factors of $$c$$) gives $$B(\lambda)\,d\lambda\times A \int_0^{2\pi}d\phi\int_0^{\pi/2} d\theta\,\sin\theta\,\cos\theta = B(\lambda)\,d\lambda\times A\pi, \tag{5}$$ so the quantity $$\pi B(\lambda)\,d\lambda \tag{6}$$ is the power per unit surface area of the radiation that escapes from the hole. Even though this analysis considered radiation escaping through a "hole" in the surface, the same analysis applies to every piece of the surface of a blackbody that allows radiation to escape. The Stefan-Boltzmann law comes from integrating (6) over all wavelengths.
You have to take into account the Lambert cosine law, which add a $$\cos (\theta )$$ factor. Is is explained at the end of the wikipedia article. https://en.wikipedia.org/wiki/Planck%27s_law#The_law