The <math>w_i</math>:s are called weights and are derived from computing the corresponding Lagrange polynomials thusly:
Here the <math>w_i</math>:s are fix constants depending only on the chosen <math>x_i</math>:s. Computing this integral for different numbers of points <math>n</math> will yield some famous quadrature formulas:
<math>n</math>  Common name  Short form  Exact for 
0  Midpoint rule  <math>M(x)</math>  <math>f \in \pi_1</math> 
1  Trapezoid rule  <math>T(x)</math>  <math>f \in \pi_1</math> 
2  Simpson's rule  <math>S(x)</math>  <math>f \in \pi_3</math> 
3  ?  ?  <math>f \in \pi_3</math> 
4  Bode's rule[?]  ?  <math>f \in \pi_5</math> 
...  ...  ...  ... 
These are the actual NewtonCotes formulas. The <math>\pi</math>:s on the left signify on which monomial[?] bases the solution is exact, e.g. a solution that is exact for <math>\pi_2</math> will be exact on the monomials in the set <math>\{1, x, x^2\}</math>. Note that the formulas' exactness increase in odd steps, so using the trapezoid rule for integrating is actually no better than using the midpoint rule, and just a waste of time. In the same manner, Simpson's rule will be exact for monomials in <math>\{1, x, x^2, x^3\}</math> which will suffice for most functions found in practice.
If you also let the distance <math>h</math> between each sample point vary, you obtain another group of quadrature formulas, the best of which is know as Gaussian quadrature.
Search Encyclopedia

Featured Article
