Solution (source code)

= Solution

In a spatially flat <FLRW metric>, a radial <null geodesic> satisfies $d\chi/dt=\pm c/a(t)$. For a source and observer at fixed comoving separation, $\chi=\int_{t_e}^{t_0}c\,dt/a(t)$. Applying this to successive wave crests gives $dt_0/a(t_0)=dt_e/a(t_e)$ and therefore the <cosmological redshift> $1+z=a(t_0)/a(t_e)$.

Each photon's energy is reduced by $1+z$, and the arrival interval is increased by $1+z$. The received power crossing the observation sphere is consequently $L/(1+z)^2$. Its physical area is $4\pi a(t_0)^2|x|^2$, so the <radiative flux> is
$$
\boxed{F=\frac{L}{4\pi a(t_0)^2|x|^2(1+z)^2}.}
$$
This is the <luminosity distance> relation with $d_L=(1+z)a(t_0)|x|$. The Euclidean area formula presumes spatial flatness; in a curved <FLRW metric> the transverse comoving distance replaces $|x|$.