CHAPTER 4 SECTION 46 NUMERICAL INTEGRATION:4章46节的数值积分
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION
Theorem 4.16 The Trapezoidal Rule
Trapezoidal Rule
• Instead of calculating approximation rectangles we will use trapezoids
sin
xdx
sin
0 2 sin
2 sin
2 sin
3
sin
0
8
4
2
4
0 2 2 2 0 1 2 1 .896
8
4
When n 8, x 8 , and you obtain
sin
xdx
sin
0 2 sin
2 sin
2 sin
3
2 sin
0
WHY DID THEY USE THE TRAPAZOID RULE???!!!!
Theorem 4.17 Integral of p(x) =Ax2 + Bx + C
Theorem 4.18 Simpson's Rule (n is even)
Approximate using Simpson's Rule.
Use Simpson's Rule to approximate. Compare the results for
f(xi-1)
f(xi)
dx
b
a
f(x)dxd2xf(x0)2f(x1)2f(x2)...2f(xn1)f(xn)
where dxba n
Approximate using the trapezoidal rule and n = 4.
2
1 x3 dx
0
Approximate using the trapezoidal rule and n = 4.
– More accuracy
a
x
x
•
i
b
• Area of a trapezoid
b2
A 12b1 b2h
h
• Which dimension is the h? • Which is the b1 and the b2
b1
Averaging the areas of the two rectangles is the same as taking the area of the trapezoid above the subinterval.
– This approximates the original curve for finding definite integral – formula shown below
b af(x)dx3 dn x[f(x0)4f(x1)2f(x2)4f(x3)2f(x4)
...2f(xn2)4f(xn1)f(xn)]
THE FORMULA FOR THE AREA OF A TRAPAZOID!!!!!!
• John is stressed out. He's got all kinds of projects going on, and they're all falling due around the same time. He's trying to stay calm, but despite all of his yoga techniques, relaxation methods, and sudden switch to decaffeinated coffee, his nerves are still on edge. Forget the 50-page paper due in two weeks and the 90-minute oral presentation next Monday morning; he still hasn't done laundry in weeks, and his stink is beginning to turn heads. Because of all the stress (and possibly due to his lack of bathing), John's started to lose his hair.
T 1 2 1 9 8 1 2 9 8 3 2 1 2 3 2 1 8 7 1 2 1 8 7 3
T1 2 18 98 92 32 31 8 71 8 73
T
1 2
27 2
27 4
6.75
Trapezoidal Rule
• Trapezoidal rule approximates the integral
16
8
4
8
2
2 sin 5 2 sin 3 2sin 7 sin
8
4
8
y = sin x 1
Four subintervals y = sin x
1
2 2 2 4 sin 4 sin 3 1 .974
16
8
8
Eight subintervals
Simpson's Rule
n = 4 and n = 8.
0 sin xdx
Solution : When n 4, you have
sin
xdx
sin
0 4 sin
2 sin
4 sin
3
sin
0
12
4
2
4
4 2 2 2.005 12
When n 8, you have
sin
xdx
sin 0 4 sin
And at x = 0, f '' = 1 The error is thus
Thus were one to pick n ≥ 3, one would have an error less than 0.01.
NOTE: THEY SIMPLY USED
½ (SUM OF BASES) X height
• As before, we divide the interval into n parts
Snidly Fizbane Simpson
– n must be even
• Instead of straight lines we draw parabolas through
a
x•i
b
each group of three consecutive points
2
1 x3 dx
x 20 1 42
0
A 2 1 2 1 f0 2 f 2 1 2 f1 2 f 3 2 f2
4112
92 8
22
3853
113.1330
4
3.283 un2
Actual area:
2
1 x 3 d x 3.241un2
0
Approximating with the Trapezoidal Rule
2 sin
4 sin
3
2 sin
0
24
8
4
8
2
4 sin 5 2 sin 3 4 sin 7 sin
8
4
8
2 2 2 8 sin 8 sin 3 2.003
24
8
8
Theorem 4.19 Errors in the Trapezoidal Rule and Simpson's Rule
You may be tempted to use the Trapezoid Rule, but you can't use that handy formula, because not all of the trapezoids have the same width. Between day 1 and 4, for example, the width of the approximating trapezoid will be 3, but the next trapezoid will be 6 – 4 = 2 units wide. Therefore, you need to calculate each trapezoid's area separately, knowing that the area of a trapezoid is equal to one-half of the product of the width of the trapezoid and the sum of the bases:
• Below is a chart representing John's rate of hair loss (in follicles per day) on various days throughout a two-week period. Use 6 trapezoids to approximate John's total hair loss over that traumatic 14-day period.
The Approximate Error in the Trapezoidal Rule:
Determine a value n such that the Trapezoidal Rule will
approximate the value of
Hale Waihona Puke with an error less
than 0.01.
First find the second derivative of
The maximum of occurs at x = 0 (see the graph below)
(Note: the 1st derivative test of
gives
, which would be at x = 0.
Use the Trapezoidal Rule to approximate sin xdx 0
Compare the results for n 4 and n 8, as shown in the figures.
Solution : When n 4, x 4 , and you obtain
Theorem 4.16 The Trapezoidal Rule
Trapezoidal Rule
• Instead of calculating approximation rectangles we will use trapezoids
sin
xdx
sin
0 2 sin
2 sin
2 sin
3
sin
0
8
4
2
4
0 2 2 2 0 1 2 1 .896
8
4
When n 8, x 8 , and you obtain
sin
xdx
sin
0 2 sin
2 sin
2 sin
3
2 sin
0
WHY DID THEY USE THE TRAPAZOID RULE???!!!!
Theorem 4.17 Integral of p(x) =Ax2 + Bx + C
Theorem 4.18 Simpson's Rule (n is even)
Approximate using Simpson's Rule.
Use Simpson's Rule to approximate. Compare the results for
f(xi-1)
f(xi)
dx
b
a
f(x)dxd2xf(x0)2f(x1)2f(x2)...2f(xn1)f(xn)
where dxba n
Approximate using the trapezoidal rule and n = 4.
2
1 x3 dx
0
Approximate using the trapezoidal rule and n = 4.
– More accuracy
a
x
x
•
i
b
• Area of a trapezoid
b2
A 12b1 b2h
h
• Which dimension is the h? • Which is the b1 and the b2
b1
Averaging the areas of the two rectangles is the same as taking the area of the trapezoid above the subinterval.
– This approximates the original curve for finding definite integral – formula shown below
b af(x)dx3 dn x[f(x0)4f(x1)2f(x2)4f(x3)2f(x4)
...2f(xn2)4f(xn1)f(xn)]
THE FORMULA FOR THE AREA OF A TRAPAZOID!!!!!!
• John is stressed out. He's got all kinds of projects going on, and they're all falling due around the same time. He's trying to stay calm, but despite all of his yoga techniques, relaxation methods, and sudden switch to decaffeinated coffee, his nerves are still on edge. Forget the 50-page paper due in two weeks and the 90-minute oral presentation next Monday morning; he still hasn't done laundry in weeks, and his stink is beginning to turn heads. Because of all the stress (and possibly due to his lack of bathing), John's started to lose his hair.
T 1 2 1 9 8 1 2 9 8 3 2 1 2 3 2 1 8 7 1 2 1 8 7 3
T1 2 18 98 92 32 31 8 71 8 73
T
1 2
27 2
27 4
6.75
Trapezoidal Rule
• Trapezoidal rule approximates the integral
16
8
4
8
2
2 sin 5 2 sin 3 2sin 7 sin
8
4
8
y = sin x 1
Four subintervals y = sin x
1
2 2 2 4 sin 4 sin 3 1 .974
16
8
8
Eight subintervals
Simpson's Rule
n = 4 and n = 8.
0 sin xdx
Solution : When n 4, you have
sin
xdx
sin
0 4 sin
2 sin
4 sin
3
sin
0
12
4
2
4
4 2 2 2.005 12
When n 8, you have
sin
xdx
sin 0 4 sin
And at x = 0, f '' = 1 The error is thus
Thus were one to pick n ≥ 3, one would have an error less than 0.01.
NOTE: THEY SIMPLY USED
½ (SUM OF BASES) X height
• As before, we divide the interval into n parts
Snidly Fizbane Simpson
– n must be even
• Instead of straight lines we draw parabolas through
a
x•i
b
each group of three consecutive points
2
1 x3 dx
x 20 1 42
0
A 2 1 2 1 f0 2 f 2 1 2 f1 2 f 3 2 f2
4112
92 8
22
3853
113.1330
4
3.283 un2
Actual area:
2
1 x 3 d x 3.241un2
0
Approximating with the Trapezoidal Rule
2 sin
4 sin
3
2 sin
0
24
8
4
8
2
4 sin 5 2 sin 3 4 sin 7 sin
8
4
8
2 2 2 8 sin 8 sin 3 2.003
24
8
8
Theorem 4.19 Errors in the Trapezoidal Rule and Simpson's Rule
You may be tempted to use the Trapezoid Rule, but you can't use that handy formula, because not all of the trapezoids have the same width. Between day 1 and 4, for example, the width of the approximating trapezoid will be 3, but the next trapezoid will be 6 – 4 = 2 units wide. Therefore, you need to calculate each trapezoid's area separately, knowing that the area of a trapezoid is equal to one-half of the product of the width of the trapezoid and the sum of the bases:
• Below is a chart representing John's rate of hair loss (in follicles per day) on various days throughout a two-week period. Use 6 trapezoids to approximate John's total hair loss over that traumatic 14-day period.
The Approximate Error in the Trapezoidal Rule:
Determine a value n such that the Trapezoidal Rule will
approximate the value of
Hale Waihona Puke with an error less
than 0.01.
First find the second derivative of
The maximum of occurs at x = 0 (see the graph below)
(Note: the 1st derivative test of
gives
, which would be at x = 0.
Use the Trapezoidal Rule to approximate sin xdx 0
Compare the results for n 4 and n 8, as shown in the figures.
Solution : When n 4, x 4 , and you obtain