Solution (source code)

= Solution

Set $\theta_{\rm rot}=hc\widetilde B/k_{\rm B}$, the <rotational temperature>. For a continuous nonnegative variable $J$,
$$
\frac{d}{dJ}\log\frac{N_J}{N_0}
=\frac{2}{2J+1}-\frac{\theta_{\rm rot}}T(2J+1).
$$
Equating this <derivative> to zero gives the <most populated rotational level>
$$
\boxed{J_*=\frac12\left(\sqrt{\frac{2T}{\theta_{\rm rot}}}-1\right)
=\sqrt{\frac{k_{\rm B}T}{2hc\widetilde B}}-\frac12.}
$$
The second <derivative> is $-4/(2J+1)^2-2\theta_{\rm rot}/T<0$, so this is a maximum when $J_*\geq0$. At lower temperatures the constrained continuous maximum is $J=0$. For the physical integer maximum compare the nearby allowed levels explicitly.