Derivation of Wien's displacement law (source code)

= Derivation of Wien's displacement law
{c}
{title2=$x_\lambda=5(1-e^{-x_\lambda})$}

At fixed $T>0$, substitute $x=hc/(\lambda k_BT)>0$ into the <Planck function>:
$$
B_\lambda(T)=\frac{2k_B^5T^5}{h^4c^3}\frac{x^5}{e^x-1}.
$$
Here $h$ is the <Planck constant>, $k_B$ the <Boltzmann constant>, and $c$ the <speed of light>. Since $dx/d\lambda=-x/\lambda\ne0$, an interior maximum in <wavelength> is also a stationary point in $x$. A <logarithmic derivative> gives
$$
\frac{d}{dx}\log\frac{x^5}{e^x-1}=\frac5x-\frac1{1-e^{-x}}=0,
\qquad x=5(1-e^{-x}).
$$
The required positive root is $x_\lambda=4.9651142317\ldots$. The rearranged equation also has $x=0$, but that endpoint is not a peak. For $g(x)=5(1-e^{-x})-x$, $g'(x)=5e^{-x}-1$ changes sign once, at $x=\log5$. Thus $g$ first increases and then decreases to negative values, crossing zero exactly once for $x>0$. Since $x^5/(e^x-1)$ tends to zero at both endpoints, this stationary point is the unique global maximum. Solving the definition of $x$ for <wavelength> gives
$$
\lambda_{\max}=\frac{hc}{k_BTx_\lambda},\qquad b=\frac{hc}{k_Bx_\lambda}.
$$
The inverse-<temperature> dependence follows before any numerical root-finding. More generally $B_\lambda(T)=T^5F(\lambda T)$ for one fixed function $F$, so spectra at all <temperatures> have the same rescaled shape. This is stronger than a relation between two peak positions. Replacing the denominator by $e^x$ in the <Wien approximation> would instead give $x=5$ and a peak <wavelength> about $0.70\%$ too short.