Solution (source code)

= Solution

Use units $c=\hbar=k_B=1$, and write $H=\dot a/a$ for the <Hubble parameter>, with dots denoting <cosmic time>. Differentiating the <Friedmann equation> gives
$$
2H\dot H=\frac{8\pi G}{3}\dot\rho+\frac{2KH}{a^2}.
$$
On an interval where $H\ne0$, use the <Hubble parameter identity> $\dot H=\ddot a/a-H^2$ and the <Friedmann acceleration equation> to find
$$
\dot H=-4\pi G(\rho+P)+\frac K{a^2}.
$$
Substitution cancels the curvature term and gives the \b[continuity equation]
$$
\boxed{\dot\rho=-3H(\rho+P).}
$$
The <cosmological perfect-fluid continuity equation> extends by continuity through a regular isolated turning point. Physically it states that the change of energy in a <comoving volume> is the negative of the pressure work: $d(\rho a^3)=-P\,d(a^3)$.

For <separately conserved cosmological fluids>, each component obeys this equation individually. A constant <equation-of-state parameter> $w_i=P_i/\rho_i$ therefore gives
$$
\frac{d\log\rho_i}{d\log a}=-3(1+w_i),
\qquad \rho_i(a)=\rho_{i,0}a^{-3(1+w_i)},
$$
where the present <scale factor> is normalized to $a_0=1$. Thus the \b[component density laws] are
$$
\boxed{\rho_r=\rho_{r,0}a^{-4},\qquad
\rho_m=\rho_{m,0}a^{-3},\qquad
\rho_\Lambda=\rho_{\Lambda,0}.}
$$
The extra factor for <radiation in cosmology> is the <cosmological redshift> of each photon's energy; <pressureless matter> has only number dilution, while the specified <dark energy> is a <cosmological constant>.

The <critical density> at a given expansion rate is the total density that makes the spatial curvature vanish:
$$
\rho_{\rm crit}(t)=\frac{3H(t)^2}{8\pi G},\qquad
\Omega_i(t)=\frac{\rho_i(t)}{\rho_{\rm crit}(t)}.
$$
These <cosmological density parameters> use the critical density at that same time. Put $E(a)=H(a)/H_0$ and $\Omega_{K,0}=-K/H_0^2$. The <Friedmann equation> yields
$$
E(a)^2=\Omega_{r,0}a^{-4}+\Omega_{m,0}a^{-3}
+\Omega_{\Lambda,0}+\Omega_{K,0}a^{-2}.
$$
Consequently the \b[fractional-density evolution], rather than just the component-density evolution, is
$$
\boxed{\Omega_r(a)=\frac{\Omega_{r,0}a^{-4}}{E(a)^2},\qquad
\Omega_m(a)=\frac{\Omega_{m,0}a^{-3}}{E(a)^2},\qquad
\Omega_\Lambda(a)=\frac{\Omega_{\Lambda,0}}{E(a)^2}.}
$$
In particular $\sum_i\Omega_i=1+K/(a^2H^2)$. The simple powers of $a$ alone apply to $\rho_i$, or to $\rho_i/\rho_{{\rm crit},0}$, not to the instantaneous <cosmological density parameters>. At a recollapse turning point $H=0$, those instantaneous ratios are undefined even though the component densities remain finite.