---
title: "Deriving the Mode Equation Behind a Computed Spectrum"
description: "Write the inflaton background in e-folds, derive the curvature mode equation, start it in the Bunch–Davies vacuum and check it with the Wronskian."
canonical_url: "https://sandboxphysics.com/stories/inflation-perturbations/slow-roll-and-the-mode-equation/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/inflation-perturbations/slow-roll-and-the-mode-equation/"
last_modified: "2026-11-12"
---

[From quantum ripples to cosmic texture](https://sandboxphysics.com/stories/inflation-perturbations/)

# Deriving the Mode Equation Behind a Computed Spectrum

Sandbox Physics · 2026-11-12

The Lab does not use slow-roll formulas to make its spectrum. It integrates the background and then every mode from its quantum vacuum until the mode freezes. This chapter derives those equations and the two checks that tell you a run can be trusted.

## Before you begin

The horizon-exit chapter, the chain rule and complex numbers. We use the reduced Planck mass {{M\_{\\mathrm{pl}}=1}}; a prime means {{d/dN}} with {{N=\\ln a}}.

## The background in e-fold time

Start from the Friedmann equation $3H^2=\tfrac12\dot\phi^2+V$ and the field equation $\ddot\phi+3H\dot\phi+V_{,\phi}=0$. Replace time derivatives with $\dot\phi=H\phi'$.

The Friedmann equation becomes $H^2(3-\tfrac12\phi'^2)=V$. With $\epsilon=\tfrac12\phi'^2$, which equals $-\dot H/H^2$, this is the first formula below. Using $H'/H=-\epsilon$ in the field equation gives the second.

These two lines are the whole background. Inflation ends where $\epsilon=1$. Nothing here assumes slow roll; the field may lurch over a step and the equations still hold.

$$
H^{2}=\frac{V}{3-\epsilon},\qquad \phi''=-(3-\epsilon)\,\phi'-\frac{V_{,\phi}}{H^{2}},\qquad \epsilon=\tfrac12\phi'^{2}
$$

Exact single-field background equations in e-fold time.

Reading: Ellis, Vennin & Wands, Review 23: Inflation, Review of Particle Physics (PDG 2025, revised August 2025) · Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2

## Slow roll is an approximation, not the model

When the potential is flat, $\phi''$ is small and $\epsilon\approx\epsilon_V=\tfrac12(V_{,\phi}/V)^2$. The Lab uses this only for its dashed reference curve.

Worked example on the $R^2$ plateau $V=V_0(1-e^{-\sqrt{2/3}\,\phi})^2$. Where the pivot exits for $N_*=55$, the integrator finds $\phi_*=5.3213$. There $e^{-\sqrt{2/3}\,\phi_*}=0.012974$, so $V_{,\phi}/V=0.021464$ and $\epsilon_V=2.30\times10^{-4}$. The integrated background gives $\epsilon=2.28\times10^{-4}$, about one per cent lower.

Reading: Planck Collaboration, Planck 2018 results. X. Constraints on inflation, arXiv:1807.06211v2 · Original background and mode calculations with an independent Python reference

## From the field to a wave equation

Expanding the action to second order in comoving gauge leaves one scalar degree of freedom, the curvature perturbation $\mathcal{R}$. The combination $v=z\mathcal{R}$ with $z=a\phi'$ obeys a wave equation in conformal time with an effective mass $z''/z$.

Rewritten in e-folds, it becomes the first equation below. The friction term is $d\ln(z^2aH)/dN$; this is the flux form of the previous chapter, expanded. Each tensor polarisation has the same structure with $z$ replaced by $a$, so its friction is only $3-\epsilon$.

A sharp step makes $\phi''/\phi'$ jump for a fraction of an e-fold. The friction term then kicks the modes crossing the horizon at that moment. That is where the ringing comes from.

$$
\mathcal{R}''+\left(3-\epsilon+\frac{2\phi''}{\phi'}\right)\mathcal{R}'+\left(\frac{k}{aH}\right)^{2}\mathcal{R}=0,\qquad h''+(3-\epsilon)\,h'+\left(\frac{k}{aH}\right)^{2}h=0
$$

Scalar and tensor mode equations in e-fold time. Both are linear, so every $k$ can be integrated on its own.

Reading: Maldacena, Non-Gaussian features of primordial fluctuations in single field inflationary models (2003), astro-ph/0210603v5 · Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2

## Starting in the Bunch–Davies vacuum

Deep inside the horizon the mode is a flat-space wave, which fixes the starting state $v\to e^{-ik\tau}/\sqrt{2k}$. We use the exact de Sitter form of that solution at $\tau=-1/(aH)$ and start when $k/aH=100$.

Starting too late would add an error from the approximate initial state; starting earlier only costs time. The benchmark script checks this choice: against the exact power-law answer, the error stays below $2\times10^{-6}$ whether the start is $k/aH=50$, $100$ or $200$.

$$
v_k(\tau)=\frac{e^{-ik\tau}}{\sqrt{2k}}\left(1-\frac{i}{k\tau}\right),\qquad \mathcal{R}_k=\frac{v_k}{z}
$$

The de Sitter mode function used for the initial data; $\tau$ is conformal time.

Reading: Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2 · Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1 · Original background and mode calculations with an independent Python reference

## The Wronskian, a free accuracy check

Canonical quantisation requires $v\,\partial_\tau v^*-v^*\partial_\tau v=i$ for all time. Since $v=z\mathcal{R}$ and $\partial_\tau=aH\,d/dN$, this becomes the condition below. Exact solutions keep it; numerical errors break it.

In the Lab’s fixed-step integrator the drift falls with the step size as expected. For a power-law test, step factors $0.3$, $0.15$ and $0.075$ give Wronskian drifts of $1.1\times10^{-3}$, $4.3\times10^{-5}$ and $5.5\times10^{-6}$, beside power errors of $7.7\times10^{-4}$, $4.4\times10^{-5}$ and $6.5\times10^{-6}$. The two shrink together, so the drift is a usable warning light.

$$
z^{2}aH\left(\mathcal{R}\,\mathcal{R}^{*\prime}-\mathcal{R}^{*}\mathcal{R}'\right)=i
$$

Must hold at every step. Its deviation from $i$ measures integration error without knowing the answer.

Reading: Original background and mode calculations with an independent Python reference · Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1

## Reading out the spectrum

We stop each mode at $k/aH=10^{-3}$, when it has frozen, and form the spectra below. The tensor factor $8$ combines two polarisations with the $2/M_{\mathrm{pl}}$ normalisation of each.

The leading slow-roll estimate $H^2/(8\pi^2\epsilon)$ at $k=aH$ is the dashed curve. On the plateau it sits $2.5\%$ below the numerical result at the pivot; for $\tfrac12m^2\phi^2$ the gap is $0.8\%$. The leading formula drops terms of the order of the slow-roll parameters. On the plateau $|\eta_V|$ is about $0.017$ while $\epsilon$ is near $2\times10^{-4}$, so a gap of a few per cent is the expected size.

$$
\mathcal{P}_{\mathcal{R}}=\frac{k^{3}|\mathcal{R}_k|^{2}}{2\pi^{2}},\qquad \mathcal{P}_{t}=\frac{8k^{3}|h_k|^{2}}{2\pi^{2}},\qquad \mathcal{P}_{\mathcal{R}}\approx\left.\frac{H^{2}}{8\pi^{2}\epsilon}\right|_{k=aH}
$$

Numerical readout and the leading slow-roll estimate. In our variables $h_k=v_k/a$ for one polarisation.

Reading: Original background and mode calculations with an independent Python reference · Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1

## Exercises and explained answers

1. Check that $v=e^{-ik\tau}/\sqrt{2k}$ satisfies $v\,\partial_\tau v^*-v^*\partial_\tau v=i$.

   Read the explanation

   $\partial_\tau v^*=ik\,e^{ik\tau}/\sqrt{2k}$, so $v\,\partial_\tau v^*=i/2$. Likewise $v^*\partial_\tau v=-i/2$. The difference is $i$, independent of time.

2. Derive $H^2=V/(3-\epsilon)$ from the Friedmann equation, and say what happens to $H$ as $\epsilon$ rises to $1$.

   Read the explanation

   With $\dot\phi=H\phi'$, $3H^2=\tfrac12H^2\phi'^2+V$, so $H^2(3-\epsilon)=V$. As $\epsilon\to1$, $H^2\to V/2$ instead of $V/3$: kinetic energy now makes up a third of the total, and acceleration stops.

3. Why does a step change the scalar spectrum strongly but the tensor spectrum hardly at all?

   Read the explanation

   The step enters the scalar friction through $2\phi''/\phi'$, which jumps when the field lurches. The tensor friction $3-\epsilon$ only sees $\epsilon$, which a small step barely changes. The Lab’s tensor ratio at the pivot stays $0.00355$ with or without the default step.

## Try the prediction

### [Compare the full calculation with slow roll](https://sandboxphysics.com/labs/inflation-mode-freezing/)

1. Choose Smooth plateau. In the spectrum chart, compare the computed line with the dashed slow-roll reference: they are parallel but a few per cent apart.
2. Choose Steep slope, strong gravitational waves. The gap shrinks, as the $0.8\%$ figure predicts.
3. Choose Sharp step, exaggerated. The slow-roll reference shows one dip where the field lurches, while the computed spectrum rings over a wider band. The leading formula reads only the local background, so it misses the ringing.

[Previous: Why a Stretched Ripple Stops Changing After Horizon Exit](https://sandboxphysics.com/stories/inflation-perturbations/why-a-stretched-ripple-stops-changing/) [Next: What the Tilt, Tensors and Squeezed Triangles Measure](https://sandboxphysics.com/stories/inflation-perturbations/what-tilt-tensors-and-squeezed-triangles-measure/)

## Sources and calculation scope

1. [Planck Collaboration, Planck 2018 results. X. Constraints on inflation, arXiv:1807.06211v2](https://arxiv.org/abs/1807.06211v2)

   Full v2 PDF (2 August 2019) read for Sections 4.2 and 7.1–7.3: equations 47–48, the step template in equations 57–62, Table 11 priors, Table 12 step results and Figure 28. The headline spectral index and amplitude quoted in this course come from its parameter tables.

2. [Ellis, Vennin & Wands, Review 23: Inflation, Review of Particle Physics (PDG 2025, revised August 2025)](https://pdg.lbl.gov/2025/reviews/rpp2025-rev-inflation.pdf)

   Full review read. Used: Section 23.3.4 equations 23.55–23.57 and its sentence on the ACT combination, Section 23.6 on reheating and the number of e-folds after the pivot exits, and Section 23.7.3.2 equations 23.101–23.103 for the sign convention of the local non-Gaussian amplitude and its single-field squeezed-limit value.

3. [Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2](https://arxiv.org/abs/astro-ph/0102236v2)

   Full v2 read. Equation 1 defines the tanh step we use; equations 6–19 set out the mode equation in e-fold time and its initial data. Our code is written independently and puts the step on the Starobinsky plateau and on a quadratic potential, not only on the paper’s quadratic case.

4. [Maldacena, Non-Gaussian features of primordial fluctuations in single field inflationary models (2003), astro-ph/0210603v5](https://arxiv.org/abs/astro-ph/0210603v5)

   Full v5 read. Equation 1.2 gives the squeezed-limit argument. In that paper the tilt symbol means the deviation from scale invariance, which modern papers write as the spectral index minus one.

5. [Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1](https://arxiv.org/abs/gr-qc/9302019v1)

   Full v1 read, with printed pages 4–6 checked as images. Equations 31, 41 and 43 give the exact power-law-inflation spectra that our solver must reproduce.

6. [Original background and mode calculations with an independent Python reference](https://sandboxphysics.com/stories/inflation-perturbations/materials/inflation-spectrum-recompute-v1.zip)

   Our own calculations: the Lab integrator and a separate NumPy/SciPy reference agree to better than three parts in ten thousand on all five presets. The ZIP holds the Python reference, closed-form benchmarks, five inputs and expected outputs. No Engine code and no paper text is included.

## Keep reading

From quantum ripples to cosmic texture · Reading path

### Horizon exit, the mode equation and spectral constraints

1. [Article **How a Quantum Ripple Becomes Cosmic Structure**](https://sandboxphysics.com/stories/inflation-perturbations/how-a-quantum-ripple-becomes-cosmic-structure/)
2. [Article **Why a Stretched Ripple Stops Changing After Horizon Exit**](https://sandboxphysics.com/stories/inflation-perturbations/why-a-stretched-ripple-stops-changing/)
3. [You are here **Deriving the Mode Equation Behind a Computed Spectrum**](https://sandboxphysics.com/stories/inflation-perturbations/slow-roll-and-the-mode-equation/)
4. [Article **What the Tilt, Tensors and Squeezed Triangles Measure**](https://sandboxphysics.com/stories/inflation-perturbations/what-tilt-tensors-and-squeezed-triangles-measure/)
5. [Article **Recompute a Primordial Spectrum and Test the Solver**](https://sandboxphysics.com/stories/inflation-perturbations/recompute-a-primordial-spectrum/)
6. [Article **Reading Planck’s Searches for Inflation Features and Non-Gaussianity**](https://sandboxphysics.com/stories/inflation-perturbations/read-feature-and-non-gaussianity-searches/)
