Questions on derivation of the Rayleigh-Jeans law I'm following this derivation of the Rayleigh-Jeans law:
https://thecuriousastronomer.wordpress.com/2013/10/28/derivation-of-the-rayleigh-jeans-law-part1/
There are a few points that I don't quite understand, and I would appreciate help in understanding them:


*

*In part 2, it is mentioned that the electric field at the walls must be zero, or otherwise electric field would impart energy to the cavity walls and lose energy itself. But why is this required? I thought that "thermal equilibrium" in this situation means the radiation and cavity are at the same temperature; so I thought the wall would be continuously absorbing some amount of radiation, only to re-radiate it and lose the gained energy again.

*It is mentioned that the energy of one mode is $kT$. This is the result of applying the equipartition theorem, which states that every degree of freedom has an energy $1/2kT$. So apparently every mode has two degrees of freedom. Do these correspond to two possible polarizations of light? But from other sources I've found out that the ultraviolet catastrophe arises from the idea that every mode has this energy $kT$. But why does every mode have this energy? Would this mean that the degrees of freedom are acctually the numbers $n_x$, $n_y$, $n_z$? 

*And why do we even apply equipartition theorem to radiation? I understand that for an ideal gas, $1/2kT$ is the energy per degree of freedom, but neither the radiation nor the cavity are ideal gasses. I don't even see what it means for radiation to have temperature $T$.


I would very much appreciate help in understanding this derivation.
 A: 
I thought the wall would be continuously absorbing some amount of radiation, only to re-radiate it and lose the gained energy again.

This is where you got confused. The wall is, by assumption, perfect reflector of radiation. Thus it does not absorb any part of radiation. It does not re-radiate any radiation after some thermalization - this does not take place. The wall can be at completely different temperature than the system inside, or does not have temperature at all. There is no thermal equilibrium  between the system inside and the wall. The theoretical purpose of the perfectly reflecting walls is just to completely contain the system including the radiation so that system can reach thermal equilibrium with itself. Without such walls, the system would lose or gain energy from the environment via radiation.

So apparently every mode has two degrees of freedom. Do these correspond to two possible polarizations of light?

No, cuboid cavity mode has only one polarization, but still has two degrees of freedom, because it takes both vector potential value and also rate of its change to express the contribution to the net Poynting energy. It is the same for any 1D harmonic oscillator - it has two quadratic terms in its Hamiltonian, one for position and one other for velocity.

But why does every mode have this energy?

This follows from the assumption that EM energy inside is given by the Poynting formula
$$
H = \int_V \frac{1}{2}\epsilon_0 E^2 +  \frac{1}{2\mu_0} B^2 \,dV.
$$
When E,B are expressed using vector potential A as superposition of mode oscillations, H turns out to be sum of quadratic terms. Then the second step is to assume that these obeys the equipartition theorem.

why do we even apply equipartition theorem to radiation? I understand that for an ideal gas, is the energy per degree of freedom, but neither the radiation nor the cavity are ideal gasses. 

From the standpoint of early 20 century physics, this was somewhat natural to do. Molecules of gas do produce and interact with EM radiation. When gas is in thermodynamic equilibrium, it is in equilibrium also with EM radiation. So it should be possible to apply similar statistical ideas to it that have been so successful for gases.

I don't even see what it means for radiation to have temperature $T$
  Radiation has temperature $T$ when it comes off body that is in thermodynamic equilibrium and has temperature $T$.

You are right to question whether results of classical statistical physics such as equipartition can be applied so directly to EM radiation. The failure of the Rayleigh and Jeans formula in high frequencies shows that the applicability is indeed limited.
