- Formula
- Demonstration
- Coefficients of the interpolation polynomial
- Calculation of the approximate integral in
- Approximate calculation of the integral in
- Approximation error
- Worked Examples
- - Example 1
- Solution
- References
The Simpson 's rule is a method for calculating, approximately, definite integrals. It is based on dividing the integration interval into an even number of equally spaced sub-intervals.
The extreme values of two consecutive sub-intervals define three points, by which a parabola, whose equation is a second degree polynomial, fits.
Figure 1. In Simpson's method, the integration interval is subdivided into an even number of intervals of equal width. The function is approximated by a parabola in every 2 sub-intervals and the integral is approximated by the sum of the area under the parabolas. Source: upv.es.
Then the area under the curve of the function in the two consecutive intervals is approximated by the area of the interpolation polynomial. Adding the contribution to the area under the parabola of all the successive sub-intervals, we have the approximate value of the integral.
On the other hand, since the integral of a parabola can be calculated algebraically exactly, then it is possible to find an analytic formula for the approximate value of the definite integral. It is known as the Simpson formula.
The error of the approximate result thus obtained decreases as the number of subdivisions n is greater (where n is an even number).
An expression will be given below that allows estimating the upper bound of the error of the approximation to the integral I, when a partition of n regular subintervals of the total interval has been made.
Formula
The integration interval is subdivided into n subintervals with n being an even integer. The width of each subdivision will be:
h = (b - a) / n
In this way, the partition is made over the interval:
{X0, X1, X2,…, Xn-1, Xn}
Where X0 = a, X1 = X0 + h, X2 = X0 + 2h,…, Xn-1 = X0 + (n-1) h, Xn = X0 + nh = b.
The formula that allows to approximate the definite integral I of the continuous, and preferably smooth, function in the interval is:
Demonstration
To obtain the Simpson formula, in each subinterval the function f (X) is approximated by a second degree polynomial p (X) (parabola) that passes through the three points:; and.
Then the integral of the polynomial p (x) is calculated in which it approximates the integral of the function f (X) in that interval.
Figure 2. Graph to demonstrate Simpson's formula. Source: F. Zapata.
Coefficients of the interpolation polynomial
The equation of the parabola p (X) has the general form: p (X) = AX 2 + BX + C. As the parabola passes through the points Q indicated in red (see figure), then the coefficients A, B, C are determined from the following system of equations:
A (-h) 2 - B h + C = f (Xi)
C = f (Xi + 1)
A (h) 2 + B h + C = f (Xi + 2)
It can be seen that the coefficient C is determined. To determine the coefficient A we add the first and third equations obtaining:
2 A h 2 + 2 C = f (Xi) + f (Xi + 2).
Then the value of C is substituted and A is cleared, leaving:
A = / (2 h 2)
To determine the coefficient B, the third equation is subtracted from the first and B is solved, obtaining:
B = = 2 h.
In summary, the second degree polynomial p (X) that passes through the points Qi, Qi + 1 and Qi + 2 has coefficients:
A = / (2 h 2)
B = = 2 h
C = f (Xi + 1)
Calculation of the approximate integral in
Approximate calculation of the integral in
As already mentioned, a partition {X0, X1, X2,…, Xn-1, Xn} is made over the total integration interval with step h = Xi + 1 - Xi = (b - a) / n, where n is an even number.
Approximation error
Note that the error decreases with the fourth power of the number of subdivisions in the interval. For example, if you go from n subdivisions to 2n, then the error decreases by a factor 1/16.
The upper bound of the error obtained by means of the Simpson approximation can be obtained from this same formula, substituting the fourth derivative for the maximum absolute value of the fourth derivative in the interval.
Worked Examples
- Example 1
Consider the function f (X) = 1 / (1 + X 2).
Find the definite integral of the function f (X) on the interval using Simpson's method with two subdivisions (n = 2).
Solution
We take n = 2. The limits of integration are a = -1 and b = -2, so the partition looks like this:
X0 = -1; X1 = 0 and X2 = +1.
Therefore, Simpson's formula takes the following form:
Figure 3. Example of numerical integration by Simpson's rule using software. Source: F. Zapata.
References
- Casteleiro, JM 2002. Comprehensive Calculus (Illustrated Edition). Madrid: ESIC Editorial.
- UPV. Simpson's method. Polytechnic university of Valencia. Recovered from: youtube.com
- Purcell, E. 2007. Calculus Ninth Edition. Prentice Hall.
- Wikipedia. Simpson's rule. Recovered from: es.wikipedia.com
- Wikipedia. Lagrange polynomial interpolation. Recovered from: es.wikipedia.com