Solution (source code)

= Solution

Let $T_-$ be the residual gas <temperature> immediately before decay. This is the $T_d$ that enters the target abundance formula, not the higher <reheating temperature> after decay. Before the decay, separately conserved relic number and gas entropy give the <conserved cosmological relic abundance> $Y=n_\phi/s_-$. The cold nonrelativistic relic has negligible kinetic energy, hence
$$
\rho_\phi\simeq mn_\phi=mYs_-=mc_1g_\star YT_-^3.
$$
Assume its density dominates over that of the residual gas and that curvature and dark energy are negligible in the <Friedmann equation>. Using the <reduced Planck mass> $M_{\rm Pl}^2=(8\pi G)^{-1}$ gives $3M_{\rm Pl}^2H_d^2\simeq\rho_\phi(t_d^-)$. Under the allowed <sudden decay of a dominant nonrelativistic relic> convention $H_d\simeq\Gamma=t_d^{-1}$, the \b[temperature immediately before decay] is
$$
\boxed{T_d^3=T_-^3\simeq\frac{3M_{\rm Pl}^2}{c_1g_\star Ym\,t_d^2}.}
$$
The coefficient inherits the approximation $H_d\simeq1/t_d$: the result is a sudden-decay estimate, not an exact age relation for a matter-only universe. If $t_d$ were instead the exact cosmic age in an uninterrupted spatially flat matter era, $H_d=2/(3t_d)$ would replace the numerator $3M_{\rm Pl}^2$ by $4M_{\rm Pl}^2/3$.

The assumptions also require <thermal decoupling in cosmology> and negligible prior decay so that $Y$ remains conserved, a fixed relativistic count $g_\star$, and rapid thermalization after the energy release. In the same approximation, the <reheating temperature> $T_+$ follows from $c_2g_\star T_+^4\simeq3M_{\rm Pl}^2/t_d^2$:
$$
T_+\simeq\left(\frac{3M_{\rm Pl}^2}{c_2g_\star t_d^2}\right)^{1/4}.
$$
Its absence of $Y$ at fixed decay rate makes clear why the two temperatures must be distinguished.