Solution
= Solution
With constant <equation-of-state parameter> $w$, the <cosmological perfect-fluid continuity equation> becomes $\dot\rho+3(1+w)H\rho=0$. Consequently
$$
\frac{d}{dt}\bigl(\rho a^{3(1+w)}\bigr)=a^{3(1+w)}\bigl[\dot\rho+3(1+w)H\rho\bigr]=0,
\qquad\boxed{\rho a^{3(1+w)}=C.}
$$
The <constant-equation-of-state density scaling> includes $\rho\propto a^{-3}$ for <pressureless matter> and $\rho\propto a^{-4}$ for <radiation in cosmology>.