1. Motivation: how far away is a supernova at z = 0.5?

In 1998 two teams measured the apparent brightness of type Ia supernovae with redshifts and found them to be between 10 % and 15 % farther away than predicted by a universe without a cosmological constant (Riess et al. 1998; Perlmutter et al. 1999). For that sentence to make sense one has to say what “distance” means in an expanding universe: the separation between emitter and receiver changed while the light was traveling, space may be curved and the light arrives redshifted. In FLRW several distances coexist, all equal to for and all different beyond that. This lesson derives them one by one, computes them with the Planck 2018 parameters and shows how supernovae used them to discover the cosmic acceleration.
2. Radial comoving distance

We start from the FLRW metric of the previous lesson, with and the comoving coordinate :
A radial photon (, ) satisfies . For a photon emitted at and received today, the comoving distance (line of sight) is the coordinate of the emitter:
To express it in terms of what we measure, , we use , whence and, with , . Then and
where is the Hubble distance ( Mpc for km s⁻¹ Mpc⁻¹) and the present density parameters of radiation, matter, curvature and cosmological constant. is the proper distance today between us and the emitter (Hogg 1999, §4); it is not directly observable, but all the others are built from it.
3. Transverse comoving distance and angular-diameter distance

Two photons emitted at the same instant from the ends of a ruler of proper length , perpendicular to the line of sight and located at coordinate , arrive separated by an angle . In the metric, the proper length of a transverse arc at is . We define the transverse comoving distance , which with reads
(Hogg 1999, eq. 16). The angular-diameter distance is, by definition, the one that makes the Euclidean relation valid:
The factor has a surprising consequence: while grows with but saturates (the integral of converges), the denominator grows without bound, so reaches a maximum and then decreases: very distant galaxies look larger on the sky than nearer ones (§6).
4. Luminosity distance and the Etherington relation

A source of bolometric luminosity (energy per unit time in its rest frame) emits photons that today are spread over a sphere centered on the source. The proper area of that sphere, measured today (), is (the “angular” radius of the sphere is ). But the received flux is smaller than by two independent factors of :
- each photon arrives with energy ;
- photons emitted in an interval arrive in (cosmological time dilation, a consequence of being constant for two successive wavefronts).
Therefore and, defining through the Euclidean law ,
The equality is the Etherington reciprocity relation (1933): it does not depend on the Friedmann equations, only on photons following null geodesics and their number being conserved, so it is a test of general relativity itself on cosmic scales. The gap at is enormous: at they differ by a factor of 4.
Distance modulus
In magnitudes, . With in Mpc,
If the flux is measured in a band rather than bolometrically, one must add the K correction, which takes into account that the observed spectrum is shifted relative to the filter (Hogg 1999, §13; Hogg et al. 2002).
5. Low-redshift expansion: the Hubble law and q₀

For we expand around . Since and, differentiating ,
(use ), we have and
(to this order the curvature does not enter , since ). The linear term is the Hubble law, ; the quadratic one measures the deceleration: in an accelerating universe () the sources at a given are farther away and look fainter. For Planck 2018, .
6. The maximum of the angular-diameter distance

Einstein–de Sitter (exact solution)
With , and
Let . Then , whose derivative vanishes at , that is :
ΛCDM (general condition)
In a flat universe, and . The condition is
which must be solved numerically. In src/lib/math/distanciasCosmologicas.ts, zMaximoDiametroAngular
locates it by golden-section search (the problem is unimodal); the test checks in EdS with
error . For Planck 2018 (+BAO) the result is
so that corresponds at most to kpc. A galaxy of 10 kpc never looks smaller than , whether it is at or at . In the Milne universe () there is no maximum: monotonically (problem 2).
7. Results with Planck 2018

The following table was computed with distanciasCosmologicas.ts for km s⁻¹ Mpc⁻¹,
, , (TT,TE,EE+lowE+lensing+BAO column
of table 2 of Planck 2018 VI). is the lookback time.
| (Mpc) | (Mpc) | (Mpc) | (mag) | (Gyr) | |
|---|---|---|---|---|---|
| 0.1 | 432.6 | 393.2 | 475.8 | 38.39 | 1.35 |
| 0.5 | 1946.4 | 1297.6 | 2919.6 | 42.33 | 5.20 |
| 1 | 3395.6 | 1697.8 | 6791.2 | 44.16 | 7.94 |
| 1.59 | 4646 | 1792 | 12 043 | 45.40 | 9.73 |
| 2 | 5308.1 | 1769.3 | 15 924 | 46.01 | 10.51 |
| 6 | 8424.8 | 1203.5 | 58 970 | 48.85 | 12.86 |
| 10 | 9635.7 | 875.9 | 105 985 | 50.13 | 13.32 |
| 1089.9 | 13 850 | 12.69 | 60.90 | 13.82 |
Two independent checks of the code:
- Age. Gyr against Planck’s Gyr.
- Acoustic scale. Planck measures to 0.03 % precision the angle subtended by the comoving sound horizon Mpc at : . With the column without BAO (, ) our Mpc gives , within 0.05 % of the published value (the difference comes from treating the neutrinos as massless radiation inside ).
8. Type Ia supernovae and the acceleration

SNe Ia are standardizable candles: after correcting for the width–luminosity relation their scatter in is about 0.15 mag. The Hubble diagram plots , that is ; and only shift the curve vertically (they appear in the combination ), so it is the shape of that fixes and .
| Model () | |||
|---|---|---|---|
| Einstein–de Sitter | 41.86 | 43.06 | 43.50 |
| Open, | 42.08 | 43.40 | 43.91 |
| Milne (empty) | 42.14 | 43.51 | 44.04 |
| Flat, , | 42.26 | 43.60 | 44.10 |
At the ΛCDM model predicts supernovae 0.40 mag fainter than EdS and 0.19 mag fainter than an open universe with ; this last figure is precisely the 10–15 % excess in distance (0.2–0.3 mag) that Riess et al. (1998) saw with 16 distant supernovae and 34 nearby ones. Perlmutter et al. (1999), with 42 supernovae at , obtained the constraint and, for a flat universe, (statistical), with . Riess et al. (1998) rejected at 3–4 σ and a closed matter-only universe at 7–8 σ. The sensitivity is modest: mag at for flat models, so measuring to ±0.05 requires controlling systematics of 0.04 mag (extinction, evolution, K correction).
9. Numerical and error analysis

Quadrature. cosmology.comovingDistance applies Simpson’s rule with 1000 subintervals to . The
integrand is very steep near when is large (it varies as ), and at the
step produces an error of 1.5 %. distanciasCosmologicas.distanciaComovil changes
variable to :
whose integrand is smooth on all of ; with 2000 subintervals the relative error against the exact EdS formula is below up to (test). Since Simpson’s rule is of order , doubling divides the error by 16: check it in problem 6.
Propagation. From , . The uncertainty in (0.42/67.66 = 0.6 %) gives mag, common to all . At low the peculiar velocity dominates: for km s⁻¹, which at is 10 % in distance, 0.2 mag; that is why cosmological samples discard –0.02.
10. Simulator
- Set Planck 2018 and read : at what instant was the light we see today with emitted? Compare with Gyr.
- Switch to Einstein–de Sitter with the same and estimate by eye how much the age shrinks; relate it to the fact that is smaller in EdS (table of §8).
- In a closed model (), what happens to when ? What would an observer see of an object at the “antipodal point”?
Problems
1. (Proof) Cosmological time dilation. Prove that two wavefronts emitted at and arrive separated by , and deduce from it and the factor in the flux.
Proof
Both wavefronts travel the same comoving coordinate: . Subtracting, , and since barely changes over one period, . Taking as the period of the wave, . The energy of each photon drops by and so does the arrival rate, hence the flux carries .
2. (Proof) Milne. For (), prove that , which is increasing for all and tends to .
Proof
, so and . Dividing by gives . With , . And as , hence . There is no maximum because in Milne space is hyperbolic and grows exponentially, compensating the .
3. (Proof) Second order in z. Complete the derivation of §5: from obtain and prove . What is the sign of the correction for Planck 2018 and how large is it at ?
Proof
; at , , hence . Then , , and . For the correction is , that is of at (check: Mpc against Mpc, +7.4 %; the rest is the order ).
4. Apparent sizes. With the table of §7: (a) how many kpc does subtend at , and ? (b) What angular size does a 10 kpc galaxy have at and at ? (c) The last-scattering surface is at : how many proper Mpc does span?
Show solution
(a) : 6.29 kpc, 8.69 kpc and 4.25 kpc. (b) rad ; rad : the more distant galaxy looks larger. (c) proper Mpc (241 comoving Mpc).
5. Discriminating models with supernovae. A set of SNe Ia at has mag each. (a) How many are needed to distinguish ΛCDM from EdS at 5 σ? (b) And from an open universe with ? (c) Why does the answer depend neither on nor on ?
Show solution
The error of the mean is . (a) : , so 4 suffice (without systematics). (b) : , about 16, which is the size of the distant sample of Riess et al. (c) and enter as , a common offset that is calibrated with the nearby sample (), where all models agree.
6. (Computational) Quadrature and order of convergence. Implement with Simpson’s rule in the variable and in the variable , and measure the relative error against the exact EdS formula at and for .
Outline in Python
import numpy as np
def simpson(f, a, b, n):
x = np.linspace(a, b, n + 1); w = np.ones(n + 1); w[1:-1:2] = 4; w[2:-1:2] = 2
return (b - a) / (3 * n) * np.sum(w * f(x))
def DC_z(z, n): # EdS, en unidades de D_H
return simpson(lambda zz: (1 + zz) ** -1.5, 0, z, n)
def DC_u(z, n):
return simpson(lambda u: 2 * u / np.sqrt(u ** 2), np.sqrt(1 / (1 + z)), 1, n) # Ω_m u² bajo la raíz
exacto = lambda z: 2 * (1 - (1 + z) ** -0.5)
for z in (2, 1090):
for n in (50, 100, 200, 400):
print(z, n, abs(DC_z(z, n) / exacto(z) - 1), abs(DC_u(z, n) / exacto(z) - 1))At both errors fall as (a factor of 16 per doubling). At the version in needs to get below , whereas the version in is exact to round-off already with (the integrand is constant in EdS). For ΛCDM the integrand in is still smooth and the order 4 is preserved.
7. Peculiar velocities. An SN Ia at belongs to a galaxy with an unknown peculiar velocity of dispersion 300 km s⁻¹. Estimate the error it introduces in and compare it with mag. From which on is it negligible (less than 0.03 mag)?
Show solution
, , mag, comparable to . For one needs , that is .
✦ Self-assessment
Further reading
- Hogg, D. W. (1999). Distance measures in cosmology, arXiv:astro-ph/9905116. A brief and complete reference; our notation follows his.
- Ryden, B. (2017). Introduction to Cosmology, 2nd ed., ch. 6: distances, standard candles and rulers, supernovae.
- Weinberg, S. (2008). Cosmology, §1.4 (distances and the expansion in ), §1.6 (supernovae).
- Riess et al. (1998), AJ 116, 1009; Perlmutter et al. (1999), ApJ 517, 565: the papers of the 2011 Nobel Prize.
- Planck Collaboration (2020), A&A 641, A6, table 2: parameters used in the calculations.
🍎 Teacher guide
- Time
- 2 classes of 90 min
- Learning outcome
- By the end, the student derives the cosmological distances from the FLRW metric, computes them numerically for ΛCDM with error control and explains how the Hubble diagram of type Ia supernovae measures Ω_m and Ω_Λ.
- Evidence of learning
- Submission of problem 6 (quadrature in u versus z with order of convergence) and of problem 5 with a discussion of systematics.
Materials
- Python 3 with NumPy or the library src/lib/math/distanciasCosmologicas.ts
- Table 2 of Planck 2018 VI
- Figure 4 of Riess et al. 1998 or figure 2 of Perlmutter et al. 1999 (Hubble diagram)
Suggested sequence
Class 1. Derivation of , , , and Etherington (§§2–4) on the board; expansion in (§5) as a guided exercise. Close with the maximum of in EdS (§6) and the Planck table (§7).
Class 2. Supernovae: read in groups the abstract of Riess et al. (1998) and translate “10–15 % farther away” into magnitudes with the table of §8. Lab: problem 6 (quadrature) and 5 (number of supernovae). Final discussion on systematics and the peculiar velocity (problem 7).
Common mistakes
- Believing that “the distance” is unique: insist that each definition answers a different measurement (angle, flux, time).
- Confusing the comoving D_M with the proper D_A: the factor 1/(1+z) is the scale factor at emission.
- Attributing the faintness of the supernovae to H₀: H₀ and M only shift the diagram vertically; the shape fixes Ω_m and Ω_Λ.
- Thinking that the maximum of D_A is a strange optical effect: it is a direct consequence of the universe being smaller when the light was emitted.