# Simpson's Rule and Other Fourth-Order Quadrature Formulas

## September 11, 2014

Reading time ~2 minutes

## 1. Closed formulas

By dividing the closed interval $[a, b]$ into $N-1$ uniform subintervals with length of $h=(b-a)/(N-1)$, the extended Simpson’s rule is given by (1)

where $f_i = f(x_i)$ for $x_i = ih$, and $\xi$ is in $(a, b)$. The number of points, $N$, must be odd, meaning that there are even number of subintervals. This requirement is a consequence of the fact that the coefficients alternate in a specific pattern, namely there are $n$ pairs of $(4, 2)$ coefficient terms plus an extra $4$-coefficient term and two end-point terms. Therefore, there are $2n+3$ terms in total, while $2n+3$ is always odd.

To relax the constraint of odd number of points, which is important for situations when it is not convenient to freely choose the number of points such as in experiments or numerical simultaions, we can use

Note that the coefficients are no longer alternate except the first and last three terms. See Arif Zaman’s Note (2) for a derivation of the exact form of the error. Other non-alternate forms of fourth-order quadrature formulas are possible. An example from Wolfram Mathworld (3)

## 2. Open and semi-open formulas

Sometimes open and semi-open formulas are required. Below is a fourth-order open formula for $(0, N-1)$

And here is a fourth-order semi-open formula for $(0, N-1]$

Note that above formulas share the same discrete scheme as the closed formulas.

## Reference

1. Press, W. H.; Teukolsky, S. A.; Vetterling, W. T.; Flannery, B. P. Numercial Recipes: The Art of Scientific Computing; 3rd ed.; Cambridge University Press: Cambridge, 2007.
2. Arif Zaman’s Note
3. An example from Wolfram Mathworld
Updated on

### Test PolyFTS with Polyorder

A comparison of two polymer SCFT software, PolyFTS and Polyorder, by computing a blend of miktoarm star block copolymers and homopolymers. Continue reading

#### Polyorder Configuration File

Published on April 06, 2015

#### mpltex: A Tool for Creating Publication Quality Plots

Published on September 09, 2014