The integral of a function f from a to b is called its quadrature. Quadrature can be approximated by a weighted sum of the values of the function on a uniform grid from a to b. Use of the weights (1 4 1)%3 on a grid of three points is equivalent to integrating the parabola (polynomial of order 2) fitted to the function at the points. Use of these weights is referred to as an application of Simpson's Rule. The foregoing phrases (based on the development in Calculus [7]) provide the weights for Simpson's Rule and for higher-order polynomial approximations as illustrated below: |
,.(W 1x);(W 2x);(W 3x) +---------------------------------------------+ ¦1r3 4r3 1r3 ¦ +---------------------------------------------¦ ¦14r45 64r45 8r15 64r45 14r45 ¦ +---------------------------------------------¦ ¦41r140 54r35 27r140 68r35 27r140 54r35 41r140¦ +---------------------------------------------+ ,.(3*W 1x);(45*W 2x);(140*W 3x) +-----------------------+ ¦1 4 1 ¦ +-----------------------¦ ¦14 64 24 64 14 ¦ +-----------------------¦ ¦41 216 27 272 27 216 41¦ +-----------------------+
If weights for n points are applied by dividing the grid into groups of n points, the weights are applied as illustrated below for four groups of Simpson's Rule: |
(-3 5 7 9) {."0 1 w=: 1 4 1 1 4 1 0 0 0 0 0 0 0 0 1 4 1 0 0 0 0 0 0 0 0 1 4 1 0 0 0 0 0 0 0 0 1 4 1 +/(-3 5 7 9) {."0 1 w 1 4 2 4 2 4 2 4 1
The function EW provides such extended weights as illustrated below: |
3 * 5 EW W 1 1 4 2 4 2 4 2 4 2 4 1 45 * 4 EW W 2 14 64 24 64 28 64 24 64 28 64 24 64 28 64 24 64 14