5.5 numerical integration mt. shasta, california greg kelly, hanford high school, richland,...

14
5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, Washington Photo by Vickie Kelly, 1998

Upload: ferdinand-booker

Post on 26-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

5.5 Numerical Integration

Mt. Shasta, CaliforniaGreg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Page 2: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Using integrals to find area works extremely well as long as we can find the antiderivative of the function.

Sometimes, the function is too complicated to find the antiderivative.

At other times, we don’t even have a function, but only measurements taken from real life.

What we need is an efficient method to estimate area when we can not find the antiderivative.

Page 3: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

211

8y x

43

0

1

24A x x

4 2

0

11

8A x dx

0 4x

Actual area under curve:

20

3A 6.6

Page 4: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

211

8y x 0 4x

Left-hand rectangular approximation:

Approximate area: 1 1 1 31 1 1 2 5 5.75

8 2 8 4

(too low)

Page 5: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Approximate area: 1 1 1 31 1 2 3 7 7.75

8 2 8 4

211

8y x 0 4x

Right-hand rectangular approximation:

(too high)

Page 6: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Averaging the two:

7.75 5.756.75

2

1.25% error (too high)

Page 7: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Averaging right and left rectangles gives us trapezoids:

1 9 1 9 3 1 3 17 1 171 3

2 8 2 8 2 2 2 8 2 8T

Page 8: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

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 (still too high)

Page 9: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Trapezoidal Rule:

0 1 2 12 2 ... 22 n n

hT y y y y y

( h = width of subinterval )

This gives us a better approximation than either left or right rectangles.

Page 10: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

1.031251.28125

1.781252.53125

211

8y x 0 4x

Compare this with the Midpoint Rule:

Approximate area: 6.625 (too low)0.625% error

The midpoint rule gives a closer approximation than the trapezoidal rule, but in the opposite direction.

Page 11: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Midpoint Rule: 6.625 (too low)0.625% error

Trapezoidal Rule: 6.750 1.25% error (too high)

Notice that the trapezoidal rule gives us an answer that has twice as much error as the midpoint rule, but in the opposite direction.

If we use a weighted average:

2 6.625 6.7506.6

3

This is the exact answer!

Oooh!

Ahhh!

Wow!

Page 12: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

1x 2x 3x 4xh h h h

This weighted approximation gives us a closer approximation than the midpoint or trapezoidal rules.

Midpoint:

1 3 1 32 2 2M h y h y h y y

Trapezoidal:

0 2 2 4

1 12 2

2 2T y y h y y h

0 2 2 4T h y y h y y

0 2 42T h y y y

1 3 0 2 4

14 2

3h y y h y y y

twice midpoint trapezoidal

1 3 0 2 44 4 23

hy y y y y

0 1 2 3 44 2 43

hy y y y y

2

3

M T

Page 13: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Simpson’s Rule:

0 1 2 3 2 14 2 4 ... 2 43 n n n

hS y y y y y y y

( h = width of subinterval, n must be even )

Example: 211

8y x 1 9 3 17

1 4 2 4 33 8 2 8

S

1 9 171 3 3

3 2 2

120

3 6.6

Page 14: 5.5 Numerical Integration Mt. Shasta, California Greg Kelly, Hanford High School, Richland, WashingtonPhoto by Vickie Kelly, 1998

Simpson’s rule can also be interpreted as fitting parabolas to sections of the curve, which is why this example came out exactly.

Simpson’s rule will usually give a very good approximation with relatively few subintervals.

It is especially useful when we have no equation and the data points are determined experimentally.