Function for approximating the definite integral of a function using an r-degree polynomial

191 Views Asked by At

We have the Midpoint Rule which approximates the definite integral of a function $f(x)$ over $[a, b]$ using $n$ sub-intervals with width $\Delta x$ using a degree-0 polynomial $A$:

$$\int_{a}^{b}{f(x)dx}\ \approx \Delta x \Big[ f(\frac{x_0 + x_1}{2}\ ) + f(\frac{x_1 + x_2}{2}\ ) + ... + f(\frac{x_{n-1} + x_n}{2}\ )\Big]$$

We also have the Trapezoid Rule, which does the same, but with a degree-1 polynomial $Ax + B$:

$$\int_{a}^{b}{f(x)dx}\ \approx \frac{\Delta x}{2}\ \Big[ f(x_0) + 2f(x_1) + ... + 2f(x_{n-1}) + f(x_n)\Big]$$

Finally we have Simpson's Rule, which uses a degree-2 polynomial $A{x^2} + Bx + C$:

$$\int_{a}^{b}{f(x)dx}\ \approx \frac{\Delta x}{3}\ \Big[ f(x_0) + 4f(x_1) + 2f(x_2) + ... + 2f(x_{n-2}) + 4f(x_{n-1}) + f(x_n)\Big]$$

This begs the question, is there a function $g(r)$ that approximates the definite integral of a function $f(x)$ over $[a, b]$ using $n$ sub-intervals of width $\Delta x$ using an $r$-degree polynomial?

Ex.

$$g(1) = \frac{\Delta x}{2}\ \Big[ f(x_0) + 2f(x_1) + ... + 2f(x_{n-1}) + f(x_n)\Big]$$ $$g(2) = \frac{\Delta x}{3}\ \Big[ f(x_0) + 4f(x_1) + 2f(x_2) + ... + 2f(x_{n-2}) + 4f(x_{n-1}) + f(x_n)\Big]$$ $$g(r) = ?$$

1

There are 1 best solutions below

1
On BEST ANSWER

Yes: these are called Newton–Cotes formulae. However, they are rather unstable at higher degrees and hence not much used. You get the weights by integrating the Lagrange interpolation polynomials.