Mathematics / Composite Trapezoidal & Romberg Quadrature
FREE TO EXPLORE
LABORATORY 26 · MATHEMATICS

Composite Trapezoidal Quadrature & Romberg Extrapolation

Implement the composite trapezoidal quadrature rule, evaluate second-order asymptotic truncation error attenuation as panel width h decreases, and execute Richardson extrapolation to build the triangular Romberg integration tableau achieving high-order precision. Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.

COMPUTE · CONVERGE · ANALYSE

Your virtual mathematics laboratory.

QUADRATURE ERROR |I - T(H)|—
COMPUTATION STATUS

Ready to execute Step = 1.

1 step
Definite integral target: ∫₀¹ exp(x) dx = e - 1 ≈ 1.718281828459045

Adjust Step, then execute computation.

Mathematical operations are computed deterministically using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations.

Numerical assumptions and limits

The composite trapezoidal rule is inefficient for oscillatory or peaked integrands unless adaptive mesh refinement is employed. The simulation evaluates composite trapezoidal quadrature for step sizes h = 0.20 / 2^{k-1} on the exponential test function. The logarithmic fit ln(E) = α·ln(h) + ln(C) extracts the asymptotic order α = 2.000 with R² = 1.000000.

Computational tools & numerical modules.

Definite Integral Test Bed

Provides the smooth benchmark integrand f(x) = e^x with known analytic integral I = e - 1.

Dyadic Mesh Subdivider

Generates sequence of step sizes h_k = (b - a)/2^k, reusing function evaluations from previous levels.

Composite Trapezoidal Integrator

Computes T(h) = h [0.5 f(a) + ∑ f(x_i) + 0.5 f(b)] with O(N) evaluations.

Euler-Maclaurin Analyzer

Calculates theoretical error coefficients c_2k = [B_{2k}/(2k)!] · [f^{(2k-1)}(b) - f^{(2k-1)}(a)] based on Bernoulli numbers.

Richardson Extrapolation Matrix

Cancels leading O(h²) error terms to systematically construct higher columns of the Romberg tableau.

Log-Log Asymptotic Slope Engine

Performs linear regression on (ln(h), ln(E_h)) to empirically confirm the second-order slope α = 2.000.

FOLLOW THE METHOD

A reason behind every step.

Implement the composite trapezoidal quadrature rule, evaluate second-order asymptotic truncation error attenuation as panel width h decreases, and execute Richardson extrapolation to build the triangular Romberg integration tableau achieving high-order precision. Standardized input settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 step.

01

Define Quadrature Domain & Integrand

Set up f(x) = exp(x) on [0, 1] with exact analytic reference value I = e - 1 = 1.718281828459045.

02

Initialize Dyadic Panel Spacing

For subdivision level k = 1 to 6, set panel count N = 2^{k-1} and spacing h = 1.0 / N.

03

Evaluate Composite Trapezoidal Sum

Compute T(h) = (h/2) [f(0) + 2 ∑_{i=1}^{N-1} f(i·h) + f(1)] in double precision registers.

04

Calculate Absolute Truncation Error

Compute E_h = |I - T(h)| and verify that halving h reduces the error by approximately a factor of 4 (2²).

05

Construct Romberg Extrapolation Columns

Apply the Richardson recurrence R(j, m) = [4^m R(j, m-1) - R(j-1, m-1)] / (4^m - 1) to eliminate O(h²), O(h⁴), O(h⁶) terms.

06

Extract Convergence Order α

Transform panel widths and errors into logarithmic coordinates (ln(h), ln(E_h)) and perform linear regression to confirm α = 2.000.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into mathematical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Composite Trapezoidal & Romberg Quadrature mathematical scaling.

LINEAR ASYMPTOTIC FIT · y = mx + b
ln(E_h) = α · ln(h) + ln(C)
#Subdivision Level (k) (step)Quadrature Error |I - T(h)| (error)Logarithmic Panel Width ln(h)Logarithmic Quadrature Error ln(E_h)Remove

No readings yet. Execute a computation and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the mathematical metrics mean.

What is the theoretical asymptotic order of convergence α for the composite trapezoidal rule on smooth functions?

Why does the Euler-Maclaurin error expansion contain only even powers of h (h², h⁴, h⁶, ...)?

What well-known numerical quadrature rule is algebraically identical to the second column R(j, 1) of the Romberg tableau?

What remarkable convergence rate does the trapezoidal rule exhibit for smooth, periodic functions over a full period?