The Romberg quadrature formula is also called the successive half-acceleration method. It is based on the relationship between the trapezoidal formula, the Simpson’s formula and the higher-order Newton-Cotes formula to construct a method to accelerate the calculation of integral. The Romberg algorithim is an extrapolation method of combining the previous approximations to generate more accurate apprximations in the process of successively dividing the integration interval into half. It improves the accuracy of the integral without increasing the amount of calculation.

According to the error estimation of the trapezoidal rule, it can be seen that the truncation error of the integral or tyhe approximation value is roughly proportional to . So, when the step size is divided by two sub-intervals which are double than that of the numerator, the truncation error will them be reduced to of the original error. Mathematically,

Rearranging the terms, we get

It can be seen that as long as the two successive integral values and , before and after the further division are close enough, the error of will alos be small. The error of is roughly equal to . We can use this error to compensate for to get a better approximation, that is a more accurate approximation

In other words, we can say that we linearly combine two integral values and computed using the trapezoidal rule to get more accurate approximations. We can go further using the similar approach.

We can generate a Simpson sequence, , by linearly ombining the values from the trapezoidal sequence . The Simpson sequence has a faster convergence rate than that of the trapezoidal sequence.

Similary,

We can go further by combining the values from the Simpson sequence to produce a Newton-Cotes sequence with a faster onvergence rate. It can be shown thart

Similarly,

Similarly, like or the above three sequences, we can go further from the Newton-Cotes sequence to produce a Romberg sequence with an even faster convergence rate.

By using the acceleration formula in the process of variable step size, we gradually process the rough trapezoidal values into the fine Simpson values , then into the even finer Newton-Cotes sequence and then further into the Romberg sequence which has the highest precision. The following diagram illustrates the following sequences.

Now consider the example of calculating using the integral given,

Below are the sequence of Trapezoidal values, Simpson alues, Newton-Cotes values and the Romberg values produced.

` ````
```val f: final UnivariateRealFunction f = new AbstractUnivariateRealFunction() {
override public double evaluate(double x) {
return exp(2 * x) - 4 * x - 7;
}
};
IterativeIntegrator integrator1 = new Trapezoidal(1e-8, 20); // using the trapezoidal rule
Integrator integrator1 = new Simpson(1e-8, 20); // using the Simpson rule
Integrator integrator3 = new Romberg(integrator1);
double a = 0, b = 1; //the limit
// the integrations
double I1 = integrator1.integrate(f, a, b);
Sysytem.out.println(String.format("S_[%.0f,%.0f] f(x) dx = %.16f, using the trapezoidal rule", a, b, I1));
double I2 = integrator2.integrate(f, a, b);
Sysytem.out.println(String.format("S_[%.0f,%.0f] f(x) dx = %.16f, using the Simpson rule", a, b, I2));
double I3 = integrator3.integrate(f, a, b);
Sysytem.out.println(String.format("S_[%.0f,%.0f] f(x) dx = %.16f, using the Romberg formula", a, b, I3));

The output is:

` ````
```S_[0,1] f(x) dx = -5.8054719346672840, sing the trapezoidal rule
S_[0,1] f(x) dx = -5.8054719494768790, sing the Simpson rule
S_[0,1] f(x) dx = -5.8054719505327520, sing the Romberg formula