Solution (source code)

= Solution

For a single barotropic <perfect fluid in general relativity>, the perturbations obey $\delta P=w\,\delta\rho=w\bar\rho\delta$. This adiabatic closure is needed: constant background $P/\rho$ alone would not eliminate an independent entropy perturbation. The absence of <scalar anisotropic stress> allows the common potential used in <Newtonian gauge in cosmology>.

Substituting the density constraint into the pressure equation gives the <gravitational potential evolution of a barotropic fluid>
$$
\Phi''+3(1+w)\mathcal H\Phi'
+\left[2\mathcal H'+(1+3w)\mathcal H^2\right]\Phi-w\nabla^2\Phi=0.
$$
Since $a\propto\tau^{2/(1+3w)}$, the <conformal Hubble parameter> is $\mathcal H=2/[(1+3w)\tau]$. The bracket cancels identically, leaving
$$
\boxed{\Phi''+\frac{6(1+w)}{1+3w}\frac{\Phi'}\tau-w\nabla^2\Phi=0}.
$$
For a <Fourier transform> mode, $\nabla^2$ becomes $-k^2$.

During <radiation domination>, $w=1/3$ and $\Phi_k''+4\Phi_k'/\tau+(k^2/3)\Phi_k=0$. Set $x=k\tau/\sqrt3$ and write $\Phi=u/x$. The resulting equation is $u_{xx}+2u_x/x+(1-2/x^2)u=0$, so the two <Spherical Bessel functions> in the hint give
$$
\boxed{\Phi_r(k,\tau)=C(k)\frac{\sin x-x\cos x}{x^3}
+D(k)\frac{\cos x+x\sin x}{x^3}}.
$$
At $x\ll1$, the two solutions approach a constant and a mode proportional to $\tau^{-3}$. The regular <adiabatic mode>, normalized to its primordial potential, is
$$
\Phi_r=3\Phi_{\rm prim}(k)\frac{\sin x-x\cos x}{x^3}
=\Phi_{\rm prim}(k)\left[1-\frac{x^2}{10}+O(x^4)\right].
$$
After entry into the <sound horizon>, $x\gg1$, the potential oscillates at <cosmological sound speed> $1/\sqrt3$ with envelope $x^{-2}\propto a^{-2}$. The <Hubble radius> and <sound horizon> differ by the sound-speed factor; outside the <Hubble radius> the regular potential is constant, while well inside it radiation supports acoustic oscillations.

During <matter domination>, $w=0$ gives $\Phi_k''+6\Phi_k'/\tau=0$ at every wavenumber. Hence
$$
\boxed{\Phi_m(k,\tau)=A(k)+B(k)\tau^{-5}=A(k)+\widetilde B(k)a^{-5/2}}.
$$
The growing density mode has a constant potential both outside and inside the <Hubble radius>; the other potential mode decays. Pressureless matter has zero <cosmological sound speed>, so horizon entry does not produce the radiation acoustic decay. These formulas cover both independent solutions, while the subsequent sketches select the regular adiabatic growing mode.