Newton–Cotes formulas

From HandWiki
Revision as of 19:05, 6 February 2024 by John Stpola (talk | contribs) (linkage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Formulas for numerical integration
Newton–Cotes formula for [math]\displaystyle{ n=2 }[/math]

In numerical analysis, the Newton–Cotes formulas, also called the Newton–Cotes quadrature rules or simply Newton–Cotes rules, are a group of formulas for numerical integration (also called quadrature) based on evaluating the integrand at equally spaced points. They are named after Isaac Newton and Roger Cotes.

Newton–Cotes formulas can be useful if the value of the integrand at equally spaced points is given. If it is possible to change the points at which the integrand is evaluated, then other methods such as Gaussian quadrature and Clenshaw–Curtis quadrature are probably more suitable.

Description

It is assumed that the value of a function f defined on [math]\displaystyle{ [a, b] }[/math] is known at [math]\displaystyle{ n + 1 }[/math] equally spaced points: [math]\displaystyle{ a \leq x_0 \lt x_1 \lt \dots \lt x_n \leq b }[/math]. There are two classes of Newton–Cotes quadrature: they are called "closed" when [math]\displaystyle{ x_0 = a }[/math] and [math]\displaystyle{ x_n = b }[/math], i.e. they use the function values at the interval endpoints, and "open" when [math]\displaystyle{ x_0 \gt a }[/math] and [math]\displaystyle{ x_n \lt b }[/math], i.e. they do not use the function values at the endpoints. Newton–Cotes formulas using [math]\displaystyle{ n+1 }[/math] points can be defined (for both classes) as[1] [math]\displaystyle{ \int_a^b f(x)\, dx \approx \sum_{i = 0}^n w_i\, f(x_i), }[/math] where

  • for a closed formula, [math]\displaystyle{ x_i = a + ih }[/math], with [math]\displaystyle{ h = \frac{b - a}{n} }[/math],
  • for an open formula, [math]\displaystyle{ x_i = a + (i + 1)h }[/math], with [math]\displaystyle{ h = \frac{b - a}{n + 2} }[/math].

The number h is called step size, [math]\displaystyle{ w_i }[/math] are called weights.

The weights can be computed as the integral of Lagrange basis polynomials. They depend only on [math]\displaystyle{ x_i }[/math] and not on the function f.

Let [math]\displaystyle{ L(x) }[/math] be the interpolation polynomial in the Lagrange form for the given data points [math]\displaystyle{ (x_0, f(x_0)), (x_1, f(x_1)), \ldots, (x_n, f(x_n)) }[/math], then [math]\displaystyle{ \int_a^b f(x)\, dx \approx \int_a^b L(x)\, dx = \int_a^b \left(\sum_{i = 0}^n f(x_i) l_i(x)\right)\, dx = \sum_{i = 0}^n f(x_i) \underbrace{\int_a^b l_i(x)\, dx}_{w_i}. }[/math]

Instability for high degree

A Newton–Cotes formula of any degree n can be constructed. However, for large n a Newton–Cotes rule can sometimes suffer from catastrophic Runge's phenomenon[2] where the error grows exponentially for large n. Methods such as Gaussian quadrature and Clenshaw–Curtis quadrature with unequally spaced points (clustered at the endpoints of the integration interval) are stable and much more accurate, and are normally preferred to Newton–Cotes. If these methods cannot be used, because the integrand is only given at the fixed equidistributed grid, then Runge's phenomenon can be avoided by using a composite rule, as explained below.

Alternatively, stable Newton–Cotes formulas can be constructed using least-squares approximation instead of interpolation. This allows building numerically stable formulas even for high degrees.[3][4]

Closed Newton–Cotes formulas

This table lists some of the Newton–Cotes formulas of the closed type. For [math]\displaystyle{ 0 \le i \le n }[/math], let [math]\displaystyle{ x_i = a + ih }[/math] where [math]\displaystyle{ h = \frac{b - a}{n} }[/math], and [math]\displaystyle{ f_i = f(x_i) }[/math].

Closed Newton–Cotes Formulas
n Step size h Common name Formula Error term
1 [math]\displaystyle{ b - a }[/math] Trapezoidal rule [math]\displaystyle{ \frac{1}{2} h(f_0 + f_1) }[/math] [math]\displaystyle{ -\frac{1}{12}h^3f^{(2)}(\xi) }[/math]
2 [math]\displaystyle{ \frac{b - a}{2} }[/math] Simpson's rule [math]\displaystyle{ \frac{1}{3} h(f_0 + 4f_1 + f_2) }[/math] [math]\displaystyle{ -\frac{1}{90} h^5f^{(4)}(\xi) }[/math]
3 [math]\displaystyle{ \frac{b - a}{3} }[/math] Simpson's 3/8 rule [math]\displaystyle{ \frac{3}{8} h(f_0 + 3f_1 + 3f_2 + f_3) }[/math] [math]\displaystyle{ -\frac{3}{80} h^5f^{(4)}(\xi) }[/math]
4 [math]\displaystyle{ \frac{b - a}{4} }[/math] Boole's rule [math]\displaystyle{ \frac{2}{45} h(7f_0 + 32f_1 + 12f_2 + 32f_3 + 7f_4) }[/math] [math]\displaystyle{ -\frac{8}{945} h^7f^{(6)}(\xi) }[/math]

Boole's rule is sometimes mistakenly called Bode's rule, as a result of the propagation of a typographical error in Abramowitz and Stegun, an early reference book.[5]

The exponent of the step size h in the error term gives the rate at which the approximation error decreases. The order of the derivative of f in the error term gives the lowest degree of a polynomial which can no longer be integrated exactly (i.e. with error equal to zero) with this rule. The number [math]\displaystyle{ \xi }[/math] must be taken from the interval (a,b), therefore, the error bound is equal to the error term when [math]\displaystyle{ f(\xi) = \max(f(x)), a\lt x\lt b }[/math].

Open Newton–Cotes formulas

This table lists some of the Newton–Cotes formulas of the open type. For [math]\displaystyle{ 0 \le i \le n }[/math], let [math]\displaystyle{ x_i = a + (i + 1)h }[/math] where [math]\displaystyle{ h = \frac{b - a}{n + 2} }[/math], and [math]\displaystyle{ f_i = f(x_i) }[/math].

Open Newton–Cotes Formulas
n Step size h Common name Formula Error term
0 [math]\displaystyle{ \frac{b - a}{2} }[/math] Rectangle rule, or
midpoint rule
[math]\displaystyle{ 2hf_0 }[/math] [math]\displaystyle{ \frac{1}{3} h^3f^{(2)}(\xi) }[/math]
1 [math]\displaystyle{ \frac{b - a}{3} }[/math] [math]\displaystyle{ \frac{3}{2} h(f_0 + f_1) }[/math] [math]\displaystyle{ \frac{3}{4}h^3f^{(2)}(\xi) }[/math]
2 [math]\displaystyle{ \frac{b - a}{4} }[/math] Milne's rule [math]\displaystyle{ \frac{4}{3} h(2f_0 - f_1 + 2f_2) }[/math] [math]\displaystyle{ \frac{14}{45} h^5f^{(4)}(\xi) }[/math]
3 [math]\displaystyle{ \frac{b - a}{5} }[/math] [math]\displaystyle{ \frac{5}{24} h(11f_0 + f_1 + f_2 + 11f_3) }[/math] [math]\displaystyle{ \frac{95}{144} h^5f^{(4)}(\xi) }[/math]

Composite rules

For the Newton–Cotes rules to be accurate, the step size h needs to be small, which means that the interval of integration [math]\displaystyle{ [a, b] }[/math] must be small itself, which is not true most of the time. For this reason, one usually performs numerical integration by splitting [math]\displaystyle{ [a, b] }[/math] into smaller subintervals, applying a Newton–Cotes rule on each subinterval, and adding up the results. This is called a composite rule. See Numerical integration.

See also

References

  1. Quarteroni, Alfio; Sacco, Riccardo; Saleri, Fausto (2006). Numerical Mathematics (Second ed.). Springer. pp. 386–387. ISBN 978-3-540-34658-6. 
  2. Quarteroni, Alfio; Sacco, Riccardo; Saleri, Fausto (2006). Numerical Mathematics (Second ed.). Springer. pp. 390–391. ISBN 978-3-540-34658-6. 
  3. Pavel Holoborodko (2011-03-24). "Stable Newton-Cotes Formulas". http://www.holoborodko.com/pavel/numerical-methods/numerical-integration/stable-newton-cotes-formulas/. 
  4. Pavel Holoborodko (2012-05-20). "Stable Newton-Cotes Formulas (Open Type)". http://www.holoborodko.com/pavel/numerical-methods/numerical-integration/stable-newton-cotes-formulas-open-type/. 
  5. Booles Rule at Wolfram Mathworld, with typo in year "1960" (instead of "1860")

External links