Using h n = ( b − a ) 2 n {\textstyle h_{n}={\frac {(b-a)}{2^{n}}}} , the method can be inductively defined by R ( 0 , 0 ) = h 0 ( f ( a ) + f ( b ) ) R ( n , 0 ) = 1 2 R ( n − 1 , 0 ) + 2 h n ∑ k = 1 2 n − 1 f ( a + ( 2 k − 1 ) h n − 1 ) R ( n , m ) = R ( n , m − 1 ) + 1 4 m − 1 ( R ( n , m − 1 ) − R ( n − 1 , m − 1 ) ) = 1 4 m − 1 ( 4 m R ( n , m − 1 ) − R ( n − 1 , m − 1 ) ) {\displaystyle {\begin{aligned}R(0,0)&=h_{0}(f(a)+f(b))\\R(n,0)&={\tfrac {1}{2}}R(n-1,0)+2h_{n}\sum _{k=1}^{2^{n-1}}f(a+(2k-1)h_{n-1})\\R(n,m)&=R(n,m-1)+{\tfrac {1}{4^{m}-1}}(R(n,m-1)-R(n-1,m-1))\\&={\frac {1}{4^{m}-1}}(4^{m}R(n,m-1)-R(n-1,m-1))\end{aligned}}} where n ≥ m {\displaystyle n\geq m} and m ≥ 1 {\displaystyle m\geq 1\,} . In big O notation, the error for R(n, m) is:3 O ( h n 2 m + 2 ) . {\displaystyle O\left(h_{n}^{2m+2}\right).}
The zeroeth extrapolation, R(n, 0), is equivalent to the trapezoidal rule with 2n + 1 points; the first extrapolation, R(n, 1), is equivalent to Simpson's rule with 2n + 1 points. The second extrapolation, R(n, 2), is equivalent to Boole's rule with 2n + 1 points. The further extrapolations differ from Newton-Cotes formulas. In particular further Romberg extrapolations expand on Boole's rule in very slight ways, modifying weights into ratios similar as in Boole's rule. In contrast, further Newton-Cotes methods produce increasingly differing weights, eventually leading to large positive and negative weights. This is indicative of how large degree interpolating polynomial Newton-Cotes methods fail to converge for many integrals, while Romberg integration is more stable.
By labelling our O ( h 2 ) {\textstyle O(h^{2})} approximations as A 0 ( h 2 n ) {\textstyle A_{0}{\big (}{\frac {h}{2^{n}}}{\big )}} instead of R ( n , 0 ) {\textstyle R(n,0)} , we can perform Richardson extrapolation with the error formula defined below: ∫ a b f ( x ) d x = A 0 ( h 2 n ) + a 0 ( h 2 n ) 2 + a 1 ( h 2 n ) 4 + a 2 ( h 2 n ) 6 + ⋯ {\displaystyle \int _{a}^{b}f(x)\,dx=A_{0}{\bigg (}{\frac {h}{2^{n}}}{\bigg )}+a_{0}{\bigg (}{\frac {h}{2^{n}}}{\bigg )}^{2}+a_{1}{\bigg (}{\frac {h}{2^{n}}}{\bigg )}^{4}+a_{2}{\bigg (}{\frac {h}{2^{n}}}{\bigg )}^{6}+\cdots } Once we have obtained our O ( h 2 ( m + 1 ) ) {\textstyle O(h^{2(m+1)})} approximations A m ( h 2 n ) {\textstyle A_{m}{\big (}{\frac {h}{2^{n}}}{\big )}} , we can label them as R ( n , m ) {\textstyle R(n,m)} .
When function evaluations are expensive, it may be preferable to replace the polynomial interpolation of Richardson with the rational interpolation proposed by Bulirsch & Stoer (1967).
To estimate the area under a curve the trapezoid rule is applied first to one-piece, then two, then four, and so on.
After trapezoid rule estimates are obtained, Richardson extrapolation is applied.
As an example, the Gaussian function is integrated from 0 to 1, i.e. the error function erf(1) ≈ 0.842700792949715. The triangular array is calculated row by row and calculation is terminated if the two last entries in the last row differ less than 10−8.
The result in the lower right corner of the triangular array is accurate to the digits shown. It is remarkable that this result is derived from the less accurate approximations obtained by the trapezium rule in the first column of the triangular array.
Here is an example of a computer implementation of the Romberg method (in the C programming language):
Here is an implementation of the Romberg method (in the Python programming language):
Romberg 1955 - Romberg, W. (1955), "Vereinfachte numerische Integration", Det Kongelige Norske Videnskabers Selskab Forhandlinger, 28 (7), Trondheim: 30–36 ↩
Richardson 1911 - Richardson, L. F. (1911), "The Approximate Arithmetical Solution by Finite Differences of Physical Problems Involving Differential Equations, with an Application to the Stresses in a Masonry Dam", Philosophical Transactions of the Royal Society A, 210 (459–470): 307–357, Bibcode:1911RSPTA.210..307R, doi:10.1098/rsta.1911.0009, JSTOR 90994 https://ui.adsabs.harvard.edu/abs/1911RSPTA.210..307R ↩
Mysovskikh 2002 - Mysovskikh, I.P. (2002) [1994], "Romberg method", in Hazewinkel, Michiel (ed.), Encyclopedia of Mathematics, Springer-Verlag, ISBN 1-4020-0609-8 https://www.encyclopediaofmath.org/index.php?title=Romberg_method ↩