Solution (source code)

= Solution

Along the unperturbed photon path, combine the temperature and gravitational-redshift terms and use $\mathcal T'=-\Gamma$:
$$
\frac d{d\tau}(\Theta+\Psi)+\Gamma(\Theta+\Psi)
=\Phi'+\Psi'+\Gamma(\Theta_0+\Psi-\widehat{\mathbf n}\mathbin\cdot\mathbf v_e).
$$
The <integrating factor> is $e^{-\mathcal T}$, and $g=\Gamma e^{-\mathcal T}$. Neglecting the exponentially hidden initial boundary term gives the <Cosmic microwave background line-of-sight solution>
$$
(\Theta+\Psi)_0
=\int^{\tau_0}d\tau\,e^{-\mathcal T}(\Phi'+\Psi')
+\int^{\tau_0}d\tau\,g(\Theta_0+\Psi-\widehat{\mathbf n}\mathbin\cdot\mathbf v_e).
$$
For instantaneous recombination, $g(\tau)=\delta(\tau-\tau_{\rm dec})$, and the observer potential contributes only an unobservable monopole. Therefore
$$
\boxed{
\Theta(\tau_0,\mathbf0,\widehat{\mathbf n})
=\Theta_{0,{\rm dec}}+\Psi_{\rm dec}
-\widehat{\mathbf n}\mathbin\cdot\mathbf v_{e,{\rm dec}}
+\int_{\tau_{\rm dec}}^{\tau_0}d\tau\,(\Phi'+\Psi')}.
$$
The first two terms form the ordinary <Sachs-Wolfe effect>, the velocity term is the <Doppler CMB anisotropy> at last scattering, and the integral is the <Integrated Sachs-Wolfe effect> produced by evolving potentials.