Solution (source code)

= Solution

For <radiation in cosmology>, $\bar P_r=\bar\rho_r/3$ and $\delta P_r=\delta\rho_r/3$, so both terms proportional to the equation-of-state difference vanish. During matter domination the gravitational potential is constant, $\Phi'=0$. Writing $\theta_r=\nabla\mathbin\cdot\mathbf v_r$, the continuity and Euler equations reduce to
$$
\delta_r'=-\frac43\theta_r,
\qquad
\theta_r'=-\frac14\nabla^2\delta_r-\nabla^2\Phi.
$$
Differentiate the first equation and substitute the second:
$$
\delta_r''=\frac13\nabla^2\delta_r+\frac43\nabla^2\Phi.
$$
Thus the radiation perturbation obeys the forced acoustic equation
$$
\boxed{\delta_r''-\frac13\nabla^2\delta_r
=\frac43\nabla^2\Phi}.
$$