## Romberg's Method

The Euler-Maclaurin summation formula relates the integral of a function*f(x)*over a closed and bounded interval

*[a,b]*,

*∫*, and the composite trapezoidal rule,

_{a}^{b}f( x ) dx*T*,

_{h}(f) = h [ f(a)/2 + f(a+h) + ··· + f(b-h) + f(b)/2 ]*T*=

_{h}(f)*∫*+

_{a}^{b}f( x ) dx*(h*

+ ··· + K h,

^{2}/12) [ f'(b) - f'(a) ] - (h^{4}/720) [ f'''(b) - f'''(a) ]+ ··· + K h

^{ 2p-2}[f^{(2p-3)}(b) - f^{(2p-3)}(a) ] + O(h^{ 2p})*f'*,

*f'''*, and

*f*are the first, third and (p-3)rd derivatives of

^{(2p-3)}*f*and

*K*is a constant.

If the subinterval length is halved, then

*T*=

_{h/2}(f)*∫*+

_{a}^{b}f( x ) dx*(h*

+ ··· + K (h/2)

^{2}/4·12) [ f'(b) - f'(a) ] - (h^{4}/16·720) [ f'''(b) - f'''(a) ]+ ··· + K (h/2)

^{ 2p-2}[f^{(2p-3)}(b) - f^{(2p-3)}(a) ] + O(h^{ 2p}).*(4T*=

_{h/2}(f) - T_{h}(f))/3*∫*

+ ··· + K h.

_{a}^{b}f( x ) dx + (h^{4}/2880) [ f'''(b) - f'''(a) ] - (h^{6}/96768) [ f^{(5)}(b) - f^{(5)}(a) ]+ ··· + K h

^{ 2p-2}[f^{(2p-3)}(b) - f^{(2p-3)}(a) ] + O(h^{ 2p})The

*h²*term has vanished. This process can be continued, each halving of the subinterval length results in a new composite trapezoidal rule estimate of the integral which can be combined with previous estimates to yield an estimate in which the lowest order term involving

*h*vanishes.

The easiest way to combine all the estimates from applications of the trapezoidal rule by halving the length of the subintervals is to arrange the estimates in a column from the coarsest estimate to the finest estimate. To form the second, column take two adjacent values from the first column, subtract the finer estimate from the coarser estimate divide by 3 and add to the finer estimate. The second column is automatically arranged from the coarsest estimate to the finest with one less element. Continue, form the third column by taking two adjacent values from the second column, subtract the finer estimate from the coarser estimate, divide by 15 and add to the finer estimate. The third column is automatically arranged from the coarsest to the finest estimate with one fewer element than in the second column. This process is continued until there is only one element in the last column, this is the estimate of the integral. The numbers which are used the divide the difference of two adjacent elements in the

*i*column is

^{th}*4*.

^{i}- 1### Function List

- double Rombergs_Integration_Method( double a, double h, double tolerance, int max_cols, double (*f)(double), int *err )

Integrate, using Romberg's method, the user supplied function (*f)(x) from a to a + h where a is the lower limit of integration, h > 0 is the length of the interval, tolerance is the tolerance, max_cols is the maximum number of columns to be used in the Richardson extrapolation to the limit, and err is set to 0 if iteration was successful and -1 if not.

*C* Source Code

- The file, rombergs_method.c, contains a version of

Rombergs_Integration_Method( ) written in*C*.