|
Numerical integrationWe have seen that some functions cannot be integrated in terms of elementary functions. This is not as bad as you may expect, because in practice it often suffices to find an approximate value of the definite integral and there exists good methods of numerical approximation. We shall now discuss the simplest and most obvious methods called quadrature techniques. We wish to direct special attention to the fundamental fact that the meaning of an approximate calculation is not precise unless it is supplemented by an estimate of the errors occurring.
The notations and conventions used here are:
where and are constants and is given as a continuous differentiable function. Then we know that the integral exists. We have seen in Chapter 2 that we may restrict to regular subdivisions, therefore let the interval of integration be divided into equal parts of length . We denote the points of subdivisions by , and the values of the function at the points of division by . Similarly, the values of the function at the midpoints of the intervals by , . It is fairly natural to use the Riemann sum approximation to , as we did it in section 2. The procedure subdiv(a,b,n) -- we shall use it in the next examples -- returns a regular subdivision . EXAMPLE 6.1.
We have a lower approximation for as and an upper one, which is . These differ by so there may be an error greater then 7% if either of these values is taken as an estimate for the integral. ``OK, let us simply choose a finer subdivision and we shall get a better approximation'' would be the next idea. Observe, however, that we have to calculate the minimum (or the maximum) of the function in every subinterval , which is rather costly and error-prone. This method is easy to apply if the integrand is known to be monotonic. And the other cases? The technique mentioned above is not a very good one from practical point of view. We require better techniques to satisfy two important criteria:
This method is called rectangle rule. (Here and hereafter the symbol means ``is approximately equal to''.) EXAMPLE 6.2.
We obtain a closer approximation with no greater trouble if we replace
the rectangle area by a trapezoid area
.
For the whole integral this gives the approximate expression:
This is the trapezoid formula, since, when the areas of the trapezoids are added, each value of the function except the first and the last occurs twice.
The approximation becomes even better if instead of choosing
the trapezoid under a chord we chose the trapezoid under the tangent
to the curve at the point with the abscissa
.
The area of this trapezoid is simply
, and the
approximation for the entire integral is
which is called the tangent formula. Let us see how it is work.
The next method is called mid-point rule. In this case we assume the function values between and are constant and have the value equal to the function value at .
Observe, that the values of the approximating integral in the case of the tangent method and the mid-point method are the same. Is it a coincidence? Explain why not.
The next method depends on estimating the subarea of the integral at
two adjacent subintervals, i.e. between the abscissa
and
by considering the upper boundary to be no longer a straight line
but a parabola. To be more precise, the parabola which passes through
the three points of the curve with abscissa , , . The equation of the parabola is
Exercise 6.1. Prove the latter statement.
After a brief calculation we get the area under the parabola:
If we assume that , i.e. that is even, by the addition of the subareas we obtain the Simpson's rule:
The integral of can also be expressed in closed form.
(If you don't agree, feel free to check!) The approximate value:
It is worth to compare the results getting by the different methods:
Estimations can be easily given for each of our methods, if bounds for the derivatives of the function are known throughout the interval of integration. Let be upper bounds for the absolute values of the first, second, derivatives, i.e. we assume that throughout the interval for all . Then the estimation formulas are as follows:
There are other kinds of very important quadrature methods based on orthogonal polynomials (Gaussian quadratures). There are known (and used) methods if the integrand is not finite or one of its derivatives is infinite at some point in (singular integrals). In many cases miscellaneous techniques are also available (series expansions, Laplace or Fourier transforms). Exercise 6.2.
(a) Take a larger value for , the number of subintervals, redo the
numerical integrations above and check the improvements in the
approximations.
Recompute the numerical integral values of EXAMPLE 5.2
using decimal ``Digits''.
to within .
calculate
(e) Calculate
numerically with an error less than . Exercise 6.3. Using the trapezoid rule with subdivisions -- let us denode the integral approximation by -- calculate the following integrals with .
Exercise 6.4. Repeat the previous exercise using Simpson's rule.
|
|