Many consider Max Planck's investigation of blackbody radiation at the turn of the twentieth century as the beginning of quantum mechanics and modern physics. After all, given the technology of Planck's era, the blackbody represented perhaps the simplest macroscopic system that displayed an overt deviation from classical physics that could be easily measured.
An ideal blackbody absorbs all incident electromagnetic radiation, all of which is subsequently re-radiated. At thermal equilibrium, the rate at which a blackbody absorbs energy is equal to the rate at which it radiates energy. Using the principles of statistical physics, it can be shown that the resulting spectral distribution of the radiation of the blackbody depends only on its temperature .
Thermodynamically, one can model a blackbody essentially as a gas of photons. In general, one can consider each photon to have some energy as a function of its frequency The classical assumption is that is independent of and that, furthermore, is allowed to vary continuously. Where denotes the Boltzmann constant, these assumptions lead to the Rayleigh-Jeans law
which gives the spectral energy density (power per volume per frequency) of a blackbody.
The spectral energy density is given by
where is the average energy of the photons and denotes the density of photons per frequency . Statistical mechanics gives that the photons adhere to a Boltzmann distribution , so the average energy is
Meanwhile, it can be shown that the photons have a density of
For small , the Rayleigh-Jeans law agrees reasonably well with experimental values. However, for larger , such as the ultraviolet portion of the spectrum, the Rayleigh-Jeans distribution fails entirely. Worse yet, the form of is unbounded as grows large. When integrated over the entire spectrum, the Rayleigh-Jeans distribution would suggest that blackbodies radiate infinite energy, a problem that became known as the "ultraviolet catastrophe."
There were many failed approaches to resolving the ultraviolet catastrophe. Planck's key insight was that if the photons were not allowed to take on any arbitrary energy but, rather, only quantized (discrete) multiples proportional to their frequency, then the correct spectrum is obtained. In particular, Planck considered there to be some constant such that the energy of a photon with frequency could be any integer multiple of , or
for positive integers .
When summed over all , the average energy of the photons can be obtained, and the energy spectrum obtained has the form
which, unlike the Rayleigh-Jeans law, vanishes as grows large.
As with the derivation of the Rayleigh-Jeans law, for average photon energy and photon density , the spectral energy density is
where is the average energy of the photons and denotes the density of photons per frequency . Assuming a discrete distribution of photon energy , the average energy can be found by computing
(The sums can be evaluated using standard geometric series methods.)
As before, the photon density is
which is the Planck distribution.
At the time, Planck viewed the quantization of as a purely mathematical "trick," but eventually it became clear that the quantization of light had a physical basis, which was fleshed out by Einstein just a few years later in his explanation of the photoelectric effect.
Since the radiation emitted by a blackbody is isotropic (the same in all directions), it holds that the intensity (power per unit area) of radiation is simply . One can thus express Planck's law in terms of intensity and wavelength as
It can be shown that the wavelength at which the maximum intensity is achieved is directly proportional to :
a result known as the Wien displacement law. The constant of proportionality is the Wien displacement constant .
In general, as a blackbody heats up, its emission spectrum shifts to a high-energy spectrum, represented by emission at a shorter wavelength or, equivalently, higher frequency.
As a first approximation, many objects, such as stars, can be treated as ideal blackbodies, for which the Planck law applies. For instance, it can be experimentally determined that the sun has a peak intensity of about , so Wien's displacement law gives that the temperature of the sun is
(The temperature of stars are in fact determined by measuring their emission spectra.)
The Planck distribution can be integrated over the entire spectrum to show that the intensity of the radiation (power per unit area) is proportional to the fourth power of the temperature , a result known as the Stefan-Boltzmann law:
where is the Stefan-Boltzmann constant
This allows us to calculate, for example, the total power emitted by the sun. Since the radiation from the sun is emitted over a spherical surface of radius , one finds
Using the value of obtained earlier and yields .
Temperature of the universe:
The cosmic microwave background (CMB) originates from hot plasma in the early universe. Suppose we treat the source of the CMB as a blackbody. If the universe expands at a constant rate such that its volume is given by
where is the Hubble constant, then the total energy emitted by the CMB is given by
where is the temperature of the CMB. Because energy is conserved, over time the temperature of the universe will become
In other words, as the universe expands, its temperature will gradually cool down the current temperature of the CMB is about
 Historically, scientists would not have referred to electromagnetic radiation as photons but as oscillating waves (the first to do so was Einstein). But the same arguments essentially apply.