If , is a function on , and , then the Riemann sum associated to these data is
By definition, the integral, is the limit (if it exists) of these Riemann sums as maximum of tends to zero.
(Applet illustrating Riemann sums)
For the sake of convenience, we often assume that the interval has been decompose into pieces of equal length, for some positive integer . The length of each piece is then .
So, and and for such a uniform decomposition, the Riemann sum is
Let , , and be given. Then the lefthand Riemann sum approximating with subdivisions is given by setting where .
The righthand Riemann sum is given by setting .
Compute the left and the right approximations to with subdivisions.
In this case . So,
The midpoint approximation (to the integral with subdivisions) is given by taking to be the midpoint of the interval where and . Thus, and
Approximate using the midpoint rule and subdivisions.
Rather than approximating the area bounded by a function by rectangles, one may use other shapes. For example, one may use trapezoids. The area of the trapezoid with corners at , , , and is .
The trapezoidal approximation to with subdivisions is
where and .
Compute the trapezoidal approximation to with subdivisions.
Simpson's rule for approximating integrals is based on approximating by the area bounded by the parabola passing through , , and .
Rather than deriving Simpson's rule from its geometric description, we write the Simpson's rule approximation in terms of the midpoint and trapezoidal approximations.
Directly,
Compute the Simpson's rule approximation to with subdivisions.
The exact value of .
Approximations for .
Left | |
Midpoint rule | |
Simpson's rule | |
Exact value | |
Trapezoidal rule | |
Right |
The error of an approximation is the absolute value of the difference between and the exact value of the itegral.
How many subdivisions do we need to guarantee that a midpoint approximation to approximates to two decimal points.
We need to have an error of less than . So, we want
We compute and . This function is decreasing between and . So, . So, we want . Thus, suffices.
We compute