0
$\begingroup$

How to derive the quadrature weights for the trapezoid and the Simpsons rule?

Trapeziod rule:$\int\limits_a^b f(x)$$\approx$$\frac{b-a}{2}$[f(a)+f(b)]

Simpson's rule:$\int\limits_a^b f(x)$$\approx$$\frac{b-a}{6}$[f(a)+4f((a+b)/2)+f(b)]

I know the definition of the quadrature weights is $\omega_i$=$\int\limits_a^b$ $l_i$(x) dx, but still have no idea to do this question.

$\endgroup$
2
$\begingroup$

The Trapezoid and Simpson's rules are Newton-Cotes formulae. Derivation of the weights come from integrating Lagrange basis polynomials. Let $L(x)$ be a lagrange polynomial which interpolates $f(x)$ at $n+1$ points, $x_0, x_1, ... x_n$. Then

$$ \int_a^b f(x) dx \approx \int_a^b L(x) dx = \int_a^b \sum_{i=0}^n f(x_i) l_i (x) dx = \sum_{i = 0}^n f(x_i)\int_a^b l_i (x) dx,$$ and here $\int_{a}^b l_i (x) dx$ is the weight for the $i$-th interpolation point.

You can read more here:

https://en.wikipedia.org/wiki/Newton%E2%80%93Cotes_formulas

https://en.wikipedia.org/wiki/Lagrange_polynomial

The trapezoid rule comes from interpolating $f(x)$ using 2 points. Simpson's rule comes from interpolating $f(x)$ using 3 points.

$\endgroup$
  • $\begingroup$ I know the definition of the quadrature weights, but still have no idea to do this question. What 2 points of Trapezoid rule for f(x)? $\endgroup$ – esther1996 Mar 21 '17 at 14:42
  • $\begingroup$ The points $x_j$, must be equally spaced. To get equally spaced points, use the formula $x_j = h*j + a$, where $h$ is the step size with the formula $h = (b - a)/n$. Try doing this with $j = 0, j = 1, n =1$ to get the interpolation points for the trapezoidal rule. You should just get $x_0 = a$ and $x_1 = b$, which are just the endpoints. This is why the Trapezoid-rule formula has $\sum_{i = 0}^{n} f(x_i) = f(a) + f(b)$. $\endgroup$ – amarney Mar 21 '17 at 15:00
  • $\begingroup$ What about the 3 points in Simpson's rule? $\endgroup$ – esther1996 Mar 21 '17 at 15:10
  • $\begingroup$ Just change $n = 2$ and do a similar calculation to get the $x_j$. Since you have the formula for Simpson's rule already, you can just look to see what the equally spaced points are. Also, way you have written Simpson's rule is incorrect. you should have $f(\frac{a+b}{2})$, not $ \frac{f(a+b)}{2}$. $\endgroup$ – amarney Mar 21 '17 at 15:15
  • 1
    $\begingroup$ @user5555, what you describe in your answer is the case for any quadrature of interpolatory type, not only for Newton-Cotes formulae. I recall that the $n$-point quadrature rule is interpolatory if it is exact on polynomials of degree $\le n-1$. The nice book for this topic is Brass, Petras, "Quadretyre theory". $\endgroup$ – szw1710 Mar 21 '17 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.