1 chapter 5 numerical integration. 2 a review of the definite integral

57
1 Chapter 5 Numerical Integration

Upload: reina-bowhay

Post on 16-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

1

Chapter 5Numerical Integration

Page 2: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

2

A Review of the Definite Integral

Page 3: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

3

Riemann Sum A summation of the

form

is called a Riemann

sum.

Page 4: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

4

5.2 Improving the Trapezoid Rule The trapezoid rule for computing integrals:

The error:

Page 5: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

5

5.2 Improving the Trapezoid Rule

So that

Therefore,

Error estimation:

Improvement of the approximation:

the corrected trapezoid rule

Page 6: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

6

Example 5.1

Page 7: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

7

Example 5.2

Page 8: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

8

h4

Page 9: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

9

Approximate Corrected Trapezoid Rule

Page 10: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

10

Page 11: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

11

5.3 Simpson’s Rule and Degree of Precision

Page 12: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

12

let

Page 13: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

13

Page 14: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

14

Example 5.3

Page 15: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

15

Page 16: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

16

The Composite RuleAssume

Example 5.4

Page 17: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

17

Page 18: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

18

Example 5.5

h4

It’s OK!!

Page 19: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

19

Discussion From our experiments:

From the definition of Simpson’s rule:

Why? Why Simpson’s rule is “more accurate than it ought to be”?

Page 20: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

20

Page 21: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

21

Page 22: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

22

Page 23: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

23

Page 24: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

24

Example 5.6

Page 25: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

25

5.4 The Midpoint Rule Consider the integral:

And the Taylor approximation:

The midpoint rule:

Its composite rule:

because

Page 26: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

26

Page 27: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

27

Page 28: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

28

Example 5.7

Page 29: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

29

Page 30: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

30

Page 31: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

31

5.5 Application: Stirling’s Formula Stirling’s formula is an interest

ing and useful way to approximate the factorial function, n!, for large values of n.

Use Stirling’s formula to show that

for all x.

0!

lim

n

xn

n

Example

Page 32: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

32

5.6 Gaussian Quadrature Gaussian quadrature is a very powerful tool for approximati

ng integrals. The quadrature rules are all base on special values of weigh

ts and abscissas (called Gauss points) The quadrature rule is written in the form

n

i

ni

nin dxxfxfwfG

1

1

1

)()( )()()(

weights Gauss points

Page 33: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

33

Page 34: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

34

Example 5.8

Page 35: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

35

Question

k

×

Page 36: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

36

Discussion The high accuracy of Gaussian quadrature then comes from the f

act that it integrates very-high-degree polynomials exactly.

We should choose N=2n-1, because a polynomial of degree 2n-1 has 2n coefficients, and thus the number of unknowns (n weights plus n abscissas) equals the number of equations.

Taking N=2n will yield a contradiction.

Page 37: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

37

Only to find an example

Page 38: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

38

Page 39: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

39

Finding Gauss Points

Page 40: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

40

Theorem 5.3

Page 41: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

41

Theorem 5.4

Page 42: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

42

Page 43: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

43

Other Intervals, Other Rules

)1)((2

1 zabax

Page 44: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

44

Example 5.9

Table 5.5

Page 45: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

45

Error estimation!! See exercise!!

Page 46: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

46

Example 5.10

Page 47: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

47

Page 48: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

48

5.7 Extrapolation Methods One of the most important ideas in

computational mathematics is— We can take the information from a few

approximations and Use that to both estimate the error in the

approximation and generate a significantly improved approximation

In this section we will embark on a more detailed study of some of these ideas.

Page 49: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

49

Approximation

Page 50: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

50

Estimating p

Page 51: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

51

Example 5.11

Page 52: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

52

Page 53: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

53

Example 5.12

)(",)(',0 when4

1)(",

2

1)(' ,)( 2/32/12/1

xfxfx

xxfxxfxxf

Page 54: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

54

Page 55: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

55

Error Estimation and an Improved Approximation

I2n-In

Page 56: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

56

Example 5.13

Page 57: 1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral

57

Example 5.14

O(h2): Error of trapezoid ruleO(h4): Error of Richardson extrapolation