Solution (source code)

= Solution

Take a fixed comoving region, whose physical volume is $V=V_0a^3$. Its energy is $E=\rho V$, so the first-law relation $dE=-P\,dV$ gives
$$
d(\rho a^3)=-P\,d(a^3).
$$
Differentiating with respect to <cosmic time> and using the <Hubble parameter> $H=\dot a/a$ yields the <cosmological perfect-fluid continuity equation>
$$
a^3\dot\rho+3a^2\dot a\rho=-3a^2\dot aP,
\qquad
\boxed{\dot\rho=-3H(\rho+P)}.
$$

For the <barotropic equation of state> $P=w\rho$, separation gives the <constant-equation-of-state density scaling>
$$
\rho=\rho_0\left(\frac a{a_0}\right)^{-3(1+w)}.
$$
Substituting this into the flat <Friedmann equation> and integrating the expanding branch gives, for $w\ne-1$,
$$
\boxed{a(t)\propto(t-t_*)^{2/[3(1+w)]}}.
$$
For $w=-1$, the density and <Hubble parameter> are constant and instead $a(t)\propto e^{Ht}$.

<Conformal time> is defined by
$$
d\tau=\frac{dt}{a(t)},
\qquad
\frac{da}{d\tau}=a\dot a=a^2H.
$$
At radiation–string equality, let each component have density $\rho_{\rm eq}$ at $a=a_{\rm eq}$. Since <radiation in cosmology> has $w=1/3$ and a <cosmic string network> has $w=-1/3$,
$$
\rho_r=\rho_{\rm eq}\left(\frac{a_{\rm eq}}a\right)^4,
\qquad
\rho_s=\rho_{\rm eq}\left(\frac{a_{\rm eq}}a\right)^2.
$$
Consequently
$$
\left(\frac{da}{d\tau}\right)^2
=a^4\frac{8\pi G}{3c^2}(\rho_r+\rho_s)
=\frac{8\pi G a_{\rm eq}^2}{3c^2}\rho_{\rm eq}
(a^2+a_{\rm eq}^2).
$$
Thus
$$
\boxed{B=\frac{8\pi G a_{\rm eq}^2}{3c^2}}.
$$
On the expanding branch, integration gives
$$
\operatorname{arsinh}\!\left(\frac a{a_{\rm eq}}\right)
=\sqrt{B\rho_{\rm eq}}\,(\tau-\tau_0).
$$
Choosing the Big Bang to occur at $\tau=0$ gives the <radiation--cosmic-string Friedmann solution>
$$
\boxed{a(\tau)=a_{\rm eq}\sinh\!\left(\sqrt{B\rho_{\rm eq}}\,\tau\right)}.
$$