Solution (source code)

= Solution

After the real scalar decouples at $T_d$, its temperature redshifts as $a^{-1}$. The other particles continue sharing entropy. Just before standard-neutrino decoupling their entropy degrees of freedom are
$$
g_{*s}(T_{\nu,\rm dec})=2+\frac78(4+6)=\frac{43}{4}.
$$
The <temperature of a decoupled relativistic relic> therefore obeys
$$
\frac{T_s}{T_\nu}
=\left[\frac{43/4}{g_{*s}(T_d)}\right]^{1/3}.
$$
A real scalar has one bosonic degree of freedom, whereas one effective neutrino species has energy weight $(7/8)\times2=7/4$. Hence the <contribution of a decoupled real scalar to Neff> is
$$
\boxed{\Delta N_{\rm eff}
=\frac47\left[\frac{43}{4g_{*s}(T_d)}\right]^{4/3}}.
$$
Here $g_{*s}(T_d)$ counts the other particles still coupled to the thermal bath, as specified in the question.