The standard procedure (or at least how I think about it) for getting the temperature of a planet from that of the star consists of alternating between *power* and *power per unit area*.

- You start with $\sigma T^4$, the total power per unit area of the star.
- To get the total power, multiply by the area of the star.
- To get the power per unit area at the distance of the planet, you have to divide by the area of the sphere over which this energy is (by assumption evenly) distributed. This gets you to the quantity you have.
- Now you can find the total power absorbed by the planet, given the power per unit area it gets and an area
^{1}.
- Then you can divide by an area
^{1} to get the power per unit area given off by the planet, which is a quantity you can set equal to $\sigma T_\text{planet}^4$ to find its temperature.

So there is a lot of multiplying and dividing by areas, and lots of factors of $\pi$ will cancel when you string it all together. Note one can modify these steps to take additional complexities into account (the $R$ and $A$ of your problem, for example).

Further, note that I used the planet's radius - twice in fact. And if you go through the arithmetic, you should find that it cancels itself. Intuitively, you might expect that an object's temperature (an *average* thermal energy) only depends on the strength of the heat source and its distance, but not on the object's size. Both you and your pet hamster^{2} get to about the same temperature sitting at equal distances from the fireplace.

^{1} Be careful about these two areas. You have to think about what area is appropriate where.

^{2} I have no idea how I came up with this example.

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.

## Best Answer

Multiply those together (energy*number in each state*number of states), and you have the total energy in the light from photons with wavelengths between $\lambda$ and $\lambda+d\lambda$. That's $\phi\left(\lambda\right)d\lambda$.

If you integrate over all $\lambda$, you can get the total energy in a given volume.

That can be used to calculate the total energy in a cavity. A black body is equilivent to a cavity with a small hole that lets the light inside to escape. Find the amount of energy escaping from this cavity per unit time, and you have the Stefanâ€“Boltzmann law.