The acoustic wave equation in the expanding universe.  
Sachs-Wolfe theorem.

Code (Mathematica 6)

Variables:

Clear[K,a,c,ϵ,H,Lap,Ψ]

X={η,χ,ϑ,φ};XX={η_,χ_,ϑ_,φ_};
x=Sequence@@X;xx=Sequence@@XX;

Friedman-Robertson-Walker background for ϵ=3p

c[η_]=(Sqrt[(1/3)]); a[η_]= Limit[(( Sin[(Sqrt[κ]) η])/( (Sqrt[κ]))),κ->K];

H[η_]=((a'[η])/((a[η])^2))//Simplify; ϵ[η_]=((3 K)/((a[η])^2))+3 ((H[η])^2)//Simplify;

The perturbation equations

Derivative[2,0,0,0][λ][xx]=-((2 a'[η] )/(a[η]))(∂_η)λ[x]-(1/3) (Lap[λ][x]+Lap[μ][x]);
Derivative[2,0,0,0][μ][xx]=-(2+3 ((c[η])^2)) (( a'[η] )/(a[η]))  (∂_η)μ[x]+(1/3)(1+3 ((c[η])^2))((Lap[λ][x]+3 K λ[x])+(Lap[μ][x]+3 K μ[x]));

The density contrast

δ[xx]= ((1 )/(3 ϵ[η]((a[η])^2)))( -((Lap[λ][x]+3 K λ[x])+(Lap[μ][x]+3 K μ[x]))+3((a'[η])/(a[η])) (∂_({η,1}))μ[x])//Simplify;

Derivatives of higher order

Derivative[k_Integer/;k>2,0,0,0][λ][xx]:=D[Derivative[2,0,0,0][λ][x],{η,k-2}]
Derivative[k_Integer/;k>2,0,0,0][μ][xx]:=D[Derivative[2,0,0,0][μ][x],{η,k-2}]
Derivative[2,d1_,d2_,d3_][λ][xx]=D[Derivative[2,0,0,0][λ][x],{χ,d1},{ϑ,d2},{φ,d3}];
Derivative[2,d1_,d2_,d3_][μ][xx]=D[Derivative[2,0,0,0][μ][x],{χ,d1},{ϑ,d2},{φ,d3}];

Laplacian in the maximally symmetric 3-dim curved space

w[K_,χ_]=Limit[2(Sqrt[κ]) Cot[(Sqrt[κ]) χ],κ->K];
Lap[f_][xx]=(((w[K,χ])^2)/(4((Cos[(Sqrt[K]) χ])^2))) (((Csc[ϑ])^2) (∂_({φ,2}))f[x]+Cot[ϑ] (∂_ϑ)f[x]+(∂_({ϑ,2}))f[x])+w[K,χ] (∂_χ)f[x]+(∂_({χ,2}))f[x];

The gauge-invariant variable Ψ

τ[K_,η_]=Limit[(( ((Tan[(Sqrt[κ]) η])^2))/(κ )),κ->K];

Ψ[xx]=((1/(Cos[(Sqrt[K]) η]))(∂_({η,1}))((1/(τ[K,η])) (∂_η)(τ[K,η] Cos[(Sqrt[K]) η] δ[x])));

The wave equation

(∂_({η,2}))Ψ[x]-(1/3)Lap[Ψ][x]==0;

Timing[Simplify[%,TimeConstraint->5000]]

This notebook source

http://drac.oa.uj.edu.pl/usr/woszcz/kody/acoucticRWcode.nb

Wojciech Czaja
Zdzisław A. Golda
Andrzej Woszczyna

The Faculty of Physics, Astronomy and Applied Computer Science
Jagiellonian University, Kraków, Poland