Simpson's Method for numerical integration
Numeric integration uses the concept that a definite integral of a function between two limits is simply the “area under the curve”. The only complication is estimating the integrand function. Of course if you knew the function that was the integral of the integrand function you would not have to do a numerical integral; you could do it analytically. Simpson’s Method breaks the interval between the limits into a number of subintervals that you specify and then approximates the function in each subinterval as a quadratic polynomial that passes through the two end points and the mid-point of the subinterval. You know how to integrate a quadratic polynomial, so then you just add up the integrals of all the quadratic polynomials that approximate the integrands in each subinterval to get the total integral. For smooth well behaved integrands, if you choose enough narrow subintervals, then this is a good approximation to the area under the curve. This is shown graphically in the figure below for the function
between the limits and .
If you fit the three points in each subinterval to a quadratic polynomial then integrate each of these and then add them together you get the formula
where you divide the interval into subintervals and is even. You can see the pattern of coefficients 1, 4, 2, 4, 2, 4, 2, …, 2, 4, 1 and and . The subinterval width is . The beauty of this formula is that the approximation error associated with using finite subinterval width varies as Thus if you halve the value of (i.e. choose twice as many subintervals) then the error is reduced by or 16 over the error in the original estimate. Simpson’s Method is called a fourth order accurate numerical algorithm because of this property.
Simpson’s Method is an example of the type of method used for numerically estimating definite integrals by the int(f,x=a..b,numeric) command in Maple and quad function in Matlab. While these do not use Simpson’s Method specifically, they use more sophisticated methods that are similar in principle.