MTH 343 · 4.5 Romberg integration

Romberg Integration Lab

Apply the composite trapezoidal rule with n = 1, 2, 4, …, 2k−1 subintervals, then use Richardson's extrapolation again and again. Each new column of the Romberg table removes the next term of the error K1h2 + K2h4 + K3h6 + …, without any new function values.

f(x) =

Use x as the variable. You can write + − * / ^, sin, cos, tan, exp, ln (or log), sqrt, abs, pi, e.

sin x on [0, π] with k = 3 is the exercise on slide 10. Column 3 is exact for x⁵. For the periodic e^sin x the trapezoidal rule is already far more accurate than h² suggests, so extrapolation makes it worse, and the stopping test is fooled at row 2. For √x the error has no expansion in even powers of h, so extrapolation helps little.

Interval [a, b]

Numbers or expressions such as pi/2 or sqrt(2), or drag the a and b handles on the plot.

Exact value —
Trapezoidal — Absolute error —
Romberg — Absolute error —

Trapezoids of a row

  • f(x)
  • Line segments
  • Area under the segments
  • New nodes (f evaluated)
  • Nodes of earlier rows (values reused)
Row
—
Shade

Romberg table

|Ri,i − Ri−1,i−1| <

Type 10^-6, 1e-6 or 0.000001.

A common way to decide when to stop adding rows: stop once two consecutive diagonal entries agree to within a tolerance. The last column of the table shows these differences, and the first row that passes gets a stop mark on Ri,i.

Show

Row i uses n = 2i−1 subintervals. Click an entry to see how it is computed; the entries it is built from are outlined.

Each entry uses the entry to its left and the one above that: Ri,j = Ri,j−1 + (Ri,j−1 − Ri−1,j−1)/(4j−1 − 1). Column 1 is the composite trapezoidal rule with n = 2i−1. Column 2 equals the composite Simpson's rule with the same n, and column 3 the composite Boole's rule. The table is built row by row; a new row needs f only at the new midpoints. The last column is the stopping test: |Ri,i − Ri−1,i−1| for each row, with a check mark when it is below the tolerance.

Error of each column as h shrinks