The problem is to integrate f(x), which has been "sampled" at the values xk and also at the midpoints (xk + xk+1)/2.
Simpson's idea was to fit a curve by the parabola which passes through each set of three consecutive data, i.e.,
x1 | y1 := f(x1) |
---|---|
(x1+x2)/2 | y1.5 := f ((x1+x2)/2) |
x2 | y2 := f(x2) |
x2 | y2 := f(x2) |
---|---|
(x2+x3)/2 | y2.5 := f ((x2+x3)/2) |
x3 | y3 := f(x3) |
etc. The point being that it is easy to integrate a quadratic, and it gives a better fit than the straight-line trapezoid rule. As we have seen in class, Simpson's rule is equivalent to taking (1/3) of the trapezoid rule and adding (2/3) of the midpoint rule.
The simplest situation would be where the values of x are -1, 0, and +1, and the quadratic is
Now, the integral of y from -1 to +1 is easily calculated:
If you have Excel or a compatible spreadsheet, you can test out the
different methods with the
spreadsheet shown in class.
(Here are some alternative formats, in case you have
trouble with the one above:
1, 2,
3, 4,
THIS PAGE IS NOT A PUBLICATION OF THE GEORGIA INSTITUTE OF TECHNOLOGY AND THE GEORGIA INSTITUTE OF TECHNOLOGY HAS NOT EDITED OR EXAMINED THE CONTENT. THE AUTHOR(S) OF THE PAGE ARE SOLELY RESPONSIBLE FOR THE CONTENT.