We can write the rate equation for $latex N_2$ in steady state, in which case the time derivative goes to zero. Rearranging to solve for the ratio $latex N_2 / N_1$ we obtain:
$latex \displaystyle \frac{N_2}{N_1} = \frac{B_{12} \rho(\nu)}{A_{21} + B_{21} \rho(\nu)} $
If we consider the particular case of equilibrium, we also know that
$latex \displaystyle \frac{N_2}{N_1} = \frac{g_2}{g_1} \exp{\left( – \frac{E_2 – E_1}{k_B T} \right)} $
$latex \displaystyle = \frac{g_2}{g_1} \exp{\left( – \frac{h \nu}{k_B T} \right)} $
We can set these two equations equal to one another and solve for the electromagnetic energy spectral density $latex \rho(\nu)$. Doing so yields
$latex \displaystyle \rho(\nu) = \frac{A_{21}}{B_{21}} \frac{1}{(\frac{B_{12}g_1}{B_{21}g_2} \exp{(h \nu / k_B T)} – 1)} $
Let’s consider a blackbody, which is an idealized object that is capable of absorbing or emitting any wavelength of light. One real-world approximation to a blackbody is a small hole in the side wall of a box made of light absorbing material. It can be shown that a blackbody always emits a characteristic spectrum that depends only on its temperature; fundamentally this is because the electronic energy states in the blackbody are filled according to thermodynamic principles. The electromagnetic spectral energy density produced by an ideal blackbody is:
$latex \displaystyle \rho(\nu) = \frac{8 \pi h \nu^3}{c^3} \frac{1}{\exp{(h \nu / k_B T)} – 1} $
Comparing this to the equation for $latex \rho$ we derived above, we see that the following relationships must hold amongst the $latex A$ and $latex B$ coefficients:
$latex \displaystyle \frac{B_{12}}{B_{21}} \frac{g_1}{g_2} = 1$
or
$latex \displaystyle g_2 B_{21} = g_1 B_{12}$
also
$latex \displaystyle \frac{A_{21}}{B_{21}} = \frac{8 \pi h \nu^3}{c^3}$
or
$latex \displaystyle A_{21} = \frac{8 \pi h \nu^3}{c^3} B_{21}$
these are the Einstein relations, which hold for the A and B coefficients between any pair of states. One thing to note is that making an x-ray laser would be extremely difficult, as $latex B / A$ decreases with photon frequency cubed $latex \nu^3$.