Wolfram Alpha:

```Black Body Radiation
--------------------

It can either be within or surround a body in thermodynamic
equilibrium with its environment.  It can also be emitted by
an opaque and non-reflective 'black' body held at constant,
uniform temperature. The radiation has a specific spectrum
and intensity that depends only on the temperature of the
body.

Consider electromagnetic radiation inside a cavity with sides
L.  The standing waves in the cavity have to satisfy the wave
equation ∇2E = (1/c2)∂2/∂t2.  With solution:

E = E0sin(2πx/λ)sin(2πy/λ)sin(2πz/λ)sin(2πct/λ)

This can be written as:

E = E0sin(kxx)sin(kyy)sin(kzz)sin(2πct/λ)

where k = 2π/λ

The solution must give zero amplitude at the walls, since a
non-zero value would dissipate energy and violate the condition
of equilibrium.  This requirement can be met by:

L = nλ/2 ∴ λ = 2L/n

Now k = 2π/λ

= nπ/L

In 3D we can write:

k2 = kx2 + ky2 + kz2 = (nx2 + ny2 + nz2)π2/L2

= n2π2/L2

The number of states in n space occupies 1/8 of a sphere.
The volume of a shell of radius n and thickness dn is:

N(n)dn = (1/8)4πn2dn

Now n2 = k2L2/π2 so n = kL/π and dn = Ldk/π

N(k)dk = (1/8)(4πk2L2/π2)(L/π)dk

= (1/2π2)L3k2dk

= (1/2π2)(Vω2/c3)dω since ω = ck and dk = dω/c

Now there are 2 polarizations allowed for the photon therefore,

N(ω)dω = (Vω2/π2c3)dω

Therefore, the energy density of radiation per unit frequency
using the classical harmonic oscillator is:

Eω = (ω2/π2c3)(KBT)

This is the classical RAYLEIGH-JEANS law that says the energy is
proportional to the square of the frequency.  Since there was no
reason to believe that their existed a maximum frequency inside
the cavity, the energy would increase towards infinity as the
frequency is increased.  However, experimentally this did not
happen.  This was referred to as the ULTRAVIOLET CATASTROPHE.
was solved. If we replace the classical oscillator with the
quantum oscillator we get:

Eω = (hω3/π2c3)(1/(exp(βhω) - 1))

A comparison between the Rayleigh-Jeans law and Planck's
law is shown below.

We can find the total energy density by integrating the Planck
formula over all frequencies:

ETotal = (h/π2c3)∫ω3/(exp(βhω) - 1)dω

If we make the substitution x = hβω and dx = hβdω we can write:

ETotal = (h/π2c3)(1/hβ)4∫x3/(exp(x) - 1)dx

This is a standard integral equal to π4/15.  Therefore, we get:

ETotal = (h/π2c3)(1/hβ)4(π4/15)

= {π2KB4/15c3h3}T4

= σT4

This is the STEFAN-BOLTZMANN LAW.  It represents the total
energy radiated per unit surface area of a black body across
all wavelengths per unit time.  To get the total power it is
necessary to multiply the above equation by the area, A.

Eω = (hω3/π2c3)(1/(exp(βhω) - 1))

Now ω = 2πc/λ and dω = -2πc/λ2 so we can write

Eλ = (16π2hc/λ5)(1/(exp(βh2πc/λ) - 1))

= (8πhc/λ5)(1/(exp(hc/KBTλ) - 1))

If we differentiate this w.r.t. λ and set the result = 0 we get
the following relationship:

λT = (hc/KB)/(5[1 - exp(-hc/KB/λT)]

Which must be solved numerically to give:

λpeakT = 2.898 x 10-3 meter Kelvin

This is WIEN'S DISPLACEMENT LAW.   This law is useful for
determining the temperature of stars by looking at their
spectra.  The observed temperature will always be slightly
less than the actual temperature because the photons have
to overcome the gravitational field of the emitting object.
```