31
CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION

CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Embed Size (px)

Citation preview

Page 1: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

CHAPTER 4SECTION 4.6

NUMERICAL INTEGRATION

Page 2: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 3: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Theorem 4.16 The Trapezoidal Rule

Page 4: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Trapezoidal Rule

• Instead of calculatingapproximation rectangleswe will use trapezoids– More accuracy

• Area of a trapezoid

a bx

•ix

b1

b2

h 1 2

1

2A b b h

• Which dimension is the h?

• Which is the b1 and the b2

• Which dimension is the h?

• Which is the b1 and the b2

Page 5: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

1 9 1 9 3 1 3 17 1 171 3

2 8 2 8 2 2 2 8 2 8T

1 9 9 3 3 17 171 3

2 8 8 2 2 8 8T

1 27

2 2T

27

4 6.75

Averaging the areas of the two rectangles is thesame as taking the areaof the trapezoid abovethe subinterval.

Page 6: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Trapezoidal Rule

• Trapezoidal rule approximates the integral

dx

f(xi)f(xi-1)

0 1 2 1( ) ( ) 2 ( ) 2 ( ) ...2 ( ) ( )2

where

b

n n

a

dxf x dx f x f x f x f x f x

b adx

n

Page 7: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Approximate using the trapezoidal rule and n = 4.2

3

0

1 x dx

Page 8: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Approximate using the trapezoidal rule and n = 4.2

3

0

1 x dx2 0 1

4 2x

1 1 1 30 2 2 1 2 2

2 2 2 2A f f f f f

1 9 351 2 2 2 2 3

4 8 8

113.1330

4

23.283 un Actual area:

23

0

1 x dx 23.241 un

Page 9: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Approximating with the Trapezoidal RuleUse the Trapezoidal Rule to approximate

Four subintervals

Eight subintervals

y = sin x

y = sin x

1

1

0sin xdx

974.18

3sin4

8sin4222

16

sin8

7sin2

4

3sin2

8

5sin2

2sin2

8

3sin2

4sin2

8sin20sin

16sin

obtainyou and ,8 ,8When

896.14

2102220

8

sin4

3sin2

2sin2

4sin20sin

8sin

obtainyou and ,4 ,4 When :Solution

figures. in theshown as 8, and 4for results theCompare

0

0

xdx

xn

xdx

xn

nn

Page 10: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Simpson's Rule• As before, we divide

the interval into n parts– n must be even

• Instead of straight lines wedraw parabolas through each group of three consecutive points– This approximates the original curve for finding

definite integral – formula shown below

Snidly Fizbane Simpson

a b•ix

0 1 2 3 4

2 1

( ) [ ( ) 4 ( ) 2 ( ) 4 ( ) 2 ( )3

... 2 ( ) 4 ( ) ( )]

b

a

n n n

dxf x dx f x f x f x f x f x

n

f x f x f x

Page 11: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Theorem 4.17 Integral of p(x) =Ax2 + Bx + C

Page 12: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Theorem 4.18 Simpson's Rule (n is even)

Page 13: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Approximate using Simpson's Rule.

Use Simpson's Rule to approximate. Compare the results forn = 4 and n = 8.

0sin xdx

003.28

3sin8

8sin8222

24

sin8

7sin4

4

3sin2

8

5sin4

2sin2

8

3sin4

4sin2

8sin40sin

24sin

haveyou ,8When

005.222412

sin4

3sin4

2sin2

4sin40sin

12sin

haveyou ,4 When :Solution

0

0

xdx

n

xdx

n

Page 14: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

Theorem 4.19 Errors in the Trapezoidal Rule and Simpson's Rule

Page 15: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

The Approximate Error in the Trapezoidal Rule:Determine a value n such that the Trapezoidal Rule will approximate the value of with an error less than 0.01.

First find the second derivative of

Page 16: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

The maximum of occurs at x = 0 (see the graph below)

(Note: the 1st derivative test of gives , which would be at x = 0.

Page 17: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

And at x = 0, f '' = 1The error is thus

Thus were one to pick n ≥ 3, one would have an error less than 0.01.

Page 18: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 19: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

NOTE: THEY SIMPLY USED

½ (SUM OF BASES) X height

THE FORMULA FOR THE AREA OF A TRAPAZOID!!!!!!

Page 20: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

• 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.

• 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.

Page 21: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal 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:

Page 22: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 23: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 24: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule

WHY DID THEY USE THE TRAPAZOID RULE???!!!!

Page 25: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 26: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 27: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 28: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 29: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 30: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule
Page 31: CHAPTER 4 SECTION 4.6 NUMERICAL INTEGRATION. Theorem 4.16 The Trapezoidal Rule