第4.6节 数值积分法

标签:
it |
4.6
In numerical integration, one computes an approximate value for the definite integral rather than finding an exact value. In this section we shall present two methods of numerical integration, called the Trapezoidal Rule and Simpson’s Rule.
The Fundamental Theorem of Calculus gives us a method of computing the definite integral of a given continuous function ffrom a to b. The method is to find, by trial and error, an antiderivative Fof f and then to use the equation
When the method works, it provides an exact value for the integral. However, the method succeeds only if the antiderivative happens to be a function that can be described in a simple way. For many integrals one cannot find a formula for the antiderivative, and the method fails. Such integrals can still be computed approximately using numerical integration.
The Trapezoidal Rule and Simpson’s Rule can always be applied and do not use the antiderivative. They are easy to carry out on a computer or hand calculator. We already discussed one method of approximating the definite integral in Section 4.1, the Riemann sum. The Trapezoidal Rule is a modified form of the Riemann sum, which gives a much closer approximation for a given amount of effort. Simpson’s Rule is a further modification that gives still better approximations.
Let f be a continuous function on an interval I, and let a I. By definition, for each positive infinitesimal dxthe definite integral
is the standard part of the infinite Riemann sum
In Section 4.1, examples were worked out to show that the finite Riemann sums become very close to the definite integral when Δxis small; that is, the finite Riemann sums approximate the definite integral. In Section 4.2, we saw that the definite integral is the limit of the finite Riemann sums as Δx→ 0+:
The Riemann sum, which is a sum of areas of rectangles, is a rather inefficient approximation of the definite integral. We can usually get a much closer approximation with the same amount of work by adding up areas of trapezoids instead of rectangles, forming the Trapezoidal Rule suggested by Figure 4.6.1. The Trapezoidal Rule also provides a formula, called an error estimate, which tells us how close the approximation is to the exact value of the definite integral.
Figure 4.6.1
Choose a positive integer nand divide the interval [a, b] into nsubintervals of equal length Δ x = (b - a)/ n. The partition points are a=x0, x1, x2…, xn = b.
The trapezoidal approximation is the area of the region under the broken line connecting the points
Since all of these points lie on the curve y= f(x), the broken line closely follows the curve. So one would expect the area of the region under the broken line to closely approximate the area under the curve.
Consider a single subinterval [ xm , xm+1] of width Δ x. The region under the line segment connecting the two points
is a trapezoid and its area is
The sum of the areas of the trapezoids is a modified Riemann sum
|
We thus make the definition:
DEFINITION
|
The Trapezoidal Approximation of an integral __f(x)dx can be computed very efficiently on most hand calculators. First compute the sum
|
By cumulative addition. Then multiply this sum by Δx to obtain the Trapezoidal Approximation.
THEOREM 1
For a continuous function f on [a, b], the trapezoidal approximation approaches the definite integral as Δx → 0+, that is,
|
PROOF
|
For dx positive infinitesimal, the extra term
|
is infinitely small. It follows that
|
From a practical standpoint, it is desirable to have a good estimate of error. We shall first work an example and then state a theorem which gives an error estimate for the trapezoidal approximation.
EXAMPLE 1
|
Use the trapezoidal approximation with Δx = ___. We first make a table of
values of ______. The graph is drawn in Figure 4.6.2.
Figure 4.6.2
Thus, __f(x0) + f(x1) + f(x2) + f(x3) + f(x4) + ___f(x5) = 5.7507.
Since Δ x= __ , the trapezoidal approximation is
The trapezoidal approximation can be made as close to the definite integral as we want by taking Δx small. From a practical standpoint, however, it is helpful to know how small we should take Δ xin order to be sure of a given degree of accuracy. For instance, suppose we need to know the definite integral to three decimal places. How small must we take Δ xin our trapezoidal approximation? The answer is given by the Trapezoidal Rule, which gives an error estimate for the trapezoidal approximation.
The error in the trapezoidal approximation is the absolute value of the difference between the trapezoidal sum and the definite integral,
|
An error estimate for the trapezoidal approximation is a function E(Δx). Which is known to be greater than or equal to the error.
Thus if E(Δ x) is an error estimate, the trapezoidal sum is within E(Δx) of the definite integral. If we want to be sure that the trapezoidal approximation is accurate to three decimal places -i.e., the error is less than 0.0005 - we choose Δx so that E(Δ x) ≤ 0.0005. We are now ready to state the Trapezoidal Rule.
TRAPEZOIDAL
Let f be a function whose second derivative f '' exists and has absolute value at most M on a closed interval [ a, b],
If Δx evenly divides b-a, then the trapezoidal approximation of the definite integral of fhas the error estimate
|
That is,
|
The proof is omitted.
EXAMPLE 1 (Concluded)
|
|
Therefore |
estimate given by the Trapezoidal Rule,
|
Thus our approximation is within an accuracy of 1/300,
|
This shows that the integral is, at least, between 1.146 and 1.154.
In this particular example we can even conclude that the integral is between 1.146 and 1.150 (rounded off to three places). That is, the integral is less than its trapezoidal approximation. This is because the second derivative f '' (x) = (1 +x²) -3/2is always greater than 0, whence the curve is concave upwards and therefore y = f(x)is always less than or equal to the broken line used in the trapezoidal approximation. Actually, the value to three places is 1.148. This can be found by taking Δx =____.
EXAMPLE 2
|
Let
By Theorem 1, we have
|
However, the Trapezoidal Rule fails to give an error estimate in this case
Because f '(x) is discontinuous at x = __1.
We now turn to Simpson’s Rule, for which the number of subintervals nmust be even. As before, we divide the interval [a, b] into nsubintervals of equal length Δx with the n+ 1 partition points
We shall use subintervals of length 2 Δx rather than Δ x. On each of the n/2 subintervals
of length 2 Δxwe approximate the curve y = f(x) by a parabolic arc that meets the curve at both endpoints and the midpoint of the subinterval, as shown in Figures 4.6.3. We then add up the areas under each of the parabolic arcs to obtain an approximation to the area under the curve, which is the definite integral. We begin with a lemma that gives a formula for the area of the region under one parabolic arc.
Figure 4.6.3
LEMMA
The area of the region under the parabola through three points (u, r), ( u+ h, s),
and (u+2h, t) (shown in Figure 4.6.4)
is
Figure 4.6.4
The lemma is proved at the end of this section. Using the lemma, we find that the area of the region under one parabolic arc from xkto xk+2 is
It follows that the sum of the n/2 regions under the parabolic arcs is a modified Riemann sum,
|
This modified Riemann sum is Simpson’s approximation to the definite integral. Note the sequence of coefficients,
Like the trapezoidal approximation, it is easily computed on a computer or hand calculator.
THEOREM 2
For a continuous function f on [ a, b] , Simpson’s approximation approaches the definite integral as Δx→ 0+,
|
Simpson’s approximation is almost as easy to calculate as the trapezoidal approximation, but is much more accurate. Simpson’s Rule is an error estimate that involves the forth derivative of the function and the fourth power of Δx.
SIMPSON’S
Suppose the function fhas a fourth derivative on the interval [a, b] that has absolute value at most M,
If [a, b] is divided into an even number of subintervals of length Δx, then
Simpson’s approximation to the definite integral has the error estimate
|
EXAMPLE 3
|
and find the error estimate.
The curve is the normal (bell- shaped ) curve used in statistics, shown in Figure 4.6.5.
We are to divide the interval [ 0,1] into four subintervals of equal length Δ x = 0.25. The following table shows the values of xand y and the coefficient to be used in Simpson’s approximation for each partition point.
Figure 4.6.5
The sum used in the Simpson approximation is then
[ 1.000000 + 4·(0.969233) +2·(0.882496) + 4·(0.754840) + 0.606531]
= 10.267816
To get the Simpson approximation, we multiply this sum by Δx/3:
To find the error estimate we need the fourth derivative of
The fourth derivative can be computed as usual and turns out to be
On the interval [ 0,
1],
The maximum value of the absolute value |y(4)|is thus M = 3. The error estimate in Simpson’s Rule is then
|
This shows that the integral is within 0.000065 of the approximation; that is,
Or using inequalities,
For comparison, a more accurate computation with a smaller Δ x shows that the actual value to six places is
The Trapezoidal Rule for this integral and the same value of Δ x = 0.25 give an approximate value of 0.85246 for the integral and an error estimate of 0.00521.
PROOF OF THE LEMMA
Suppose the parabola has the equation y = ax² + bx + c. Then the area under the parabola is
When we substitute the coordinates of the three points ( -h, r), (0, s), ( h, t)
into the equation for the parabola, we obtain the three equations
Add the first and third equations and solve for a:
Finally, substitute the above expression for aand s for c in the equation for the area:
PROBLEMS FOR SECTION
Approximate the integrals in Problems 1-20 using (a) the Trapezoidal Rule and (b) Simpson’s Rule. When possible, find error estimates. If a hand calculator is available, do the problems again with Δx = 0.1.
1___xdx,
5______dx,
7___________dx,
9___________dx,
11__________dx,
13__________dx,
15 ___
_________
17____exdx,
19_____1n x dx,
Δx=_____
□21 let f be continuous on the interval [a,b] and let Δx=(b-a)/nwhere n is a positive integer. Prove that the trapezoidal sum is equal to the Riemann sum plus __ (f(b) - f(a)) Δx, that is ,
|
Show that if f(a) = f(b)then the trapezoidal sum and Riemann sum are equal.
□22 Prove that for a linear function f(x) = kx+c, the trapezoidal sum is exactly equal to the integral.
□23 Show
that if f(x)is concave
downward,
□24 Show that for a quadratic function f(x)=ax2 + bx +c, Simpson’s approximation is equal to the definite integral.
□25 show that for a cubic function f(x)=ax3 + bx2+cx +d, Simpson’s approximation is still equal to the definite integral.
EXTRA
1 Evaluate _______Δx,
2 Evaluate _______Δx,
3 Evaluate _______Δx,
4Evaluate _______Δx,
5 If F '(x) = 1/(2x-1)²for all x ≠1/2, find F(2) - F(1).
6 If G '(t) = ___________ for all t >-1/4, find G(2) - G(0).
7 A particle moves with velocity v=(3+2___)². How far does it move from times t0=1 to t1=5?
8A particle moves with velocity v=__________.How far does it move from times t0=1 to t1=4?
9 A particle moves with velocity v=(t+1)(2t+3). If it has position y0=0 at time t=0, find its position at time t=10.
10A particle moves with acceleration a = 1/t4. If it has velocity v0=4 and position y0=2 at time t=1, find its position at time t=3 .
11 Find the area of the region under the curve y= 1/___, 1 ≤ x≤ 4.
12 Find the area of the region under the curve y=____, 0 ≤ x≤ 1.
13∫ (1- x)(2+3x)
dx
15
17
19
21
23
25
27
29
31
33
35
36
37
38
□39
|
and F(0) =1.
□40
□41
|
□42
|
□43
□44
□45
□46
□47
|
□48
□49
□50