Numerical Analysis. 10th ed. R L Burden, J D Faires, and A M Burden

Similar documents
Numerical Integration

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

Lecture 14: Quadrature

Lecture 6: Singular Integrals, Open Quadrature rules, and Gauss Quadrature

Lecture 12: Numerical Quadrature

Lecture Note 4: Numerical differentiation and integration. Xiaoqun Zhang Shanghai Jiao Tong University

Math& 152 Section Integration by Parts

Review of Calculus, cont d

APPROXIMATE INTEGRATION

Numerical Analysis: Trapezoidal and Simpson s Rule

Lecture 20: Numerical Integration III

Orthogonal Polynomials

Lecture 17. Integration: Gauss Quadrature. David Semeraro. University of Illinois at Urbana-Champaign. March 20, 2014

INTRODUCTION TO INTEGRATION

Math 1B, lecture 4: Error bounds for numerical methods

COT4501 Spring Homework VII

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Trapezoidal Rule, n = 1, x 0 = a, x 1 = b, h = b a. f (x)dx = h 2 (f (x 0) + f (x 1 )) h3

Chapters 4 & 5 Integrals & Applications

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

COSC 3361 Numerical Analysis I Numerical Integration and Differentiation (III) - Gauss Quadrature and Adaptive Quadrature

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

Numerical integration

Definite integral. Mathematics FRDIS MENDELU

III. Lecture on Numerical Integration. File faclib/dattab/lecture-notes/numerical-inter03.tex /by EC, 3/14/2008 at 15:11, version 9

Numerical quadrature based on interpolating functions: A MATLAB implementation

Definite integral. Mathematics FRDIS MENDELU. Simona Fišnarová (Mendel University) Definite integral MENDELU 1 / 30

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Chapter 7 Notes, Stewart 8e. 7.1 Integration by Parts Trigonometric Integrals Evaluating sin m x cos n (x) dx...

The Regulated and Riemann Integrals

Chapter 3 Solving Nonlinear Equations

Advanced Computational Fluid Dynamics AA215A Lecture 3 Polynomial Interpolation: Numerical Differentiation and Integration.

1 The Riemann Integral

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

1. Gauss-Jacobi quadrature and Legendre polynomials. p(t)w(t)dt, p {p(x 0 ),...p(x n )} p(t)w(t)dt = w k p(x k ),

Construction of Gauss Quadrature Rules

Numerical Integration. 1 Introduction. 2 Midpoint Rule, Trapezoid Rule, Simpson Rule. AMSC/CMSC 460/466 T. von Petersdorff 1

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

4.4 Areas, Integrals and Antiderivatives

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

NUMERICAL INTEGRATION

MA 124 January 18, Derivatives are. Integrals are.

Numerical integration. Quentin Louveaux (ULiège - Institut Montefiore) Numerical analysis / 10

Overview of Calculus I

63. Representation of functions as power series Consider a power series. ( 1) n x 2n for all 1 < x < 1

Anti-derivatives/Indefinite Integrals of Basic Functions

1 The Lagrange interpolation formula

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1

The Riemann Integral

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

Math 131. Numerical Integration Larson Section 4.6

3.4 Numerical integration

The Fundamental Theorem of Calculus

Chapter 5. Numerical Integration

14.4. Lengths of curves and surfaces of revolution. Introduction. Prerequisites. Learning Outcomes

LECTURE 19. Numerical Integration. Z b. is generally thought of as representing the area under the graph of fèxè between the points x = a and

Numerical Integration

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

P 3 (x) = f(0) + f (0)x + f (0) 2. x 2 + f (0) . In the problem set, you are asked to show, in general, the n th order term is a n = f (n) (0)

Integrals - Motivation

Sections 5.2: The Definite Integral

7.2 The Definite Integral

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve.

Chapter 2. Numerical Integration also called quadrature. 2.2 Trapezoidal Rule. 2.1 A basic principle Extending the Trapezoidal Rule DRAWINGS

Euler, Ioachimescu and the trapezium rule. G.J.O. Jameson (Math. Gazette 96 (2012), )

1.9 C 2 inner variations

Math 113 Fall Final Exam Review. 2. Applications of Integration Chapter 6 including sections and section 6.8

Big idea in Calculus: approximation

Lecture 14 Numerical integration: advanced topics

Numerical Integration

1 Error Analysis of Simple Rules for Numerical Integration

Indefinite Integral. Chapter Integration - reverse of differentiation

Section 6.1 Definite Integral

1 Probability Density Functions

MTH 122 Fall 2008 Essex County College Division of Mathematics Handout Version 10 1 October 14, 2008

different methods (left endpoint, right endpoint, midpoint, trapezoid, Simpson s).

Riemann is the Mann! (But Lebesgue may besgue to differ.)

Section 6.1 INTRO to LAPLACE TRANSFORMS

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

MATH , Calculus 2, Fall 2018

Theoretical foundations of Gaussian quadrature

Suppose we want to find the area under the parabola and above the x axis, between the lines x = 2 and x = -2.

5.7 Improper Integrals

Calculus II: Integrations and Series

Math 8 Winter 2015 Applications of Integration

MAT 168: Calculus II with Analytic Geometry. James V. Lambers

x = b a n x 2 e x dx. cdx = c(b a), where c is any constant. a b

7.2 Riemann Integrable Functions

Riemann Sums and Riemann Integrals

SYDE 112, LECTURES 3 & 4: The Fundamental Theorem of Calculus

Math Calculus with Analytic Geometry II

Numerical Integration. Newton Cotes Formulas. Quadrature. Newton Cotes Formulas. To approximate the integral b

1 The fundamental theorems of calculus.

f(x)dx . Show that there 1, 0 < x 1 does not exist a differentiable function g : [ 1, 1] R such that g (x) = f(x) for all

Riemann Sums and Riemann Integrals

Chapter 6 Notes, Larson/Hostetler 3e

Taylor Polynomial Inequalities

QUADRATURE is an old-fashioned word that refers to

Final Exam - Review MATH Spring 2017

Review of basic calculus

Transcription:

Numericl Anlysis 10th ed R L Burden, J D Fires, nd A M Burden Bemer Presenttion Slides Prepred by Dr. Annette M. Burden Youngstown Stte University July 9, 2015

Chpter 4.1: Numericl Differentition 1 Three-Point Formuls THREE-POINT ENDPOINT FORMULA f (x 0 ) = 1 2h [ 3f (x 0) + 4f (x 0 + h) f (x 0 + 2h)] + h2 3 f (3) (ξ 0 ), where ξ 0 lies between x 0 nd x 0 + 2h. THREE-POINT MIDPOINT FORMULA f (x 0 ) = 1 2h [f (x 0 + h) f (x 0 h)] h2 6 f (3) (ξ 1 ), where ξ 1 lies between x 0 h nd x 0 + h.

Chpter 4.1: Numericl Differentition 2 Five-Point Formuls FIVE-POINT MIDPOINT FORMULA f (x 0 ) = 1 12h [f (x 0 2h) 8f (x 0 h) + 8f (x 0 + h) f (x 0 + 2h)] + h4 30 f (5) (ξ), where ξ lies between x 0 2h nd x 0 + 2h. FIVE-POINT ENDPOINT FORMULA f (x 0 ) = where ξ lies between x 0 nd x 0 + 4h. 1 12h [ 25f (x 0) + 48f (x 0 + h) 36f (x 0 + 2h) + 16f (x 0 + 3h) 3f (x 0 + 4h)] + h4 5 f (5) (ξ),

Chpter 4.1: Numericl Differentition 3 SECOND DERIVATIVE MIDPOINT FORMULA f (x 0 ) = 1 h 2 [f (x 0 h) 2f (x 0 ) + f (x 0 + h)] h2 12 f (4) (ξ), for some ξ, where x 0 h < ξ < x 0 + h. If f (4) is continuous on [x 0 h, x 0 + h] it is lso bounded, nd the pproximtion is O(h 2 ). NOTE: It is prticulrly importnt to py ttention to round-off error when pproximting derivtives.

Chpter 4.1: Numericl Differentition 4 ERROR - INSTABILITY The totl error in the pproximtion, f (x 0 ) f (x 0 + h) f (x 0 h) 2h = e(x 0 + h) e(x 0 h) 2h h2 6 f (3) (ξ 1 ), is due both to round-off error, the first prt, nd to trunction error. If we ssume tht the round-off errors e(x 0 ± h) re bounded by some number ε > 0 nd tht the third derivtive of f is bounded by number M > 0, then f (x 0 ) f (x 0 + h) f (x 0 h) 2h ε h + h2 6 M. To reduce the trunction error, h 2 M/6, we need to reduce h. But s h is reduced, the round-off error ε/h grows. In prctice, then, it is seldom dvntgeous to let h be too smll, becuse in tht cse the round-off error will dominte the clcultions.

Chpter 4.2: Richrdson s Extrpoltion 5 Richrdson s extrpoltion is used to generte high-ccurcy results while using low-order formuls. Extrpoltion cn be pplied whenever it is known tht n pproximtion technique hs n error term with predictble form, one tht depends on prmeter, usully the step size h. Richrdson s Extrpoltion The YouTube video developed by Dougls Hrder cn serve s good illustrtion of the Richrdson s Extrpoltion for students. Richrdson s Extrpoltion Video

Chpter 4.3: Elements of Numericl Integrtion 6 The need often rises for evluting the definite integrl of function tht hs no explicit ntiderivtive or whose ntiderivtive is not esy to obtin. The bsic method involved in pproximting b f (x) dx is clled numericl qudrture. It uses sum n i=0 if (x i ) to pproximte b f (x) dx.

Chpter 4.3: Elements of Numericl Integrtion 7 Trpezoidl Rule b f (x) dx = h 2 [f (x 0) + f (x 1 )] h3 12 f (ξ). This is clled the Trpezoidl rule becuse when f is function with positive vlues, b f (x) dx is pproximted by the re in trpezoid, s shown in the figure below. y y 5 f (x) y 5 P 1 (x) 5 x 0 x 1 5 b x

Chpter 4.3: Elements of Numericl Integrtion 8 Trpezoidl Rule The YouTube video developed by Mthispower4u cn serve s good illustrtion of the Trpezoidl Rule for students. Trpezoidl Rule Video

Chpter 4.3: Elements of Numericl Integrtion 9 Simpson s Rule Simpson s rule results from integrting over [, b] the second Lgrnge polynomil with eqully-spced nodes x 0 =, x 2 = b, nd x 1 = + h, where h = (b )/2. x2 x 0 f (x) dx = h 3 [f (x 0) + 4f (x 1 ) + f (x 2 )] h5 90 f (4) (ξ). y y 5 f (x) y 5 P 2 (x) 5 x 0 x 1 x 2 5 b x

Chpter 4.3: Elements of Numericl Integrtion 10 Simpson s Rule The error term in Simpson s rule involves the fourth derivtive of f, so it gives exct results when pplied to ny polynomil of degree three or less. The YouTube video developed by Exm Solutions cn serve s good illustrtion of the Simpson s Rule for students. Simpson s Rule Video

Chpter 4.3: Elements of Numericl Integrtion 11 Definition 4.1 The degree of ccurcy, or precision, of qudrture formul is the lrgest positive integer n such tht the formul is exct for x k, for ech k = 0, 1,..., n. Definition 4.1 implies tht the Trpezoidl nd Simpson s rules hve degrees of precision one nd three, respectively. The degree of precision of qudrture formul is n if nd only if the error is zero for ll polynomils of degree k = 0, 1,..., n, but is not zero for some polynomil of degree n + 1. The Trpezoidl nd Simpson s rules re exmples of clss of methods known s Newton-Cotes formuls. There re two types of Newton-Cotes formuls, open nd closed.

Chpter 4.3: Elements of Numericl Integrtion 12 Closed Newton-Cotes Formuls The (n + 1)-point closed Newton-Cotes formul uses nodes x i = x 0 + ih, for i = 0, 1,..., n, where x 0 =, x n = b nd h = (b )/n. (See Figure) It is clled closed becuse the endpoints of the closed intervl [, b] re included s nodes. y y = f (x) y = P n (x) 5 x 0 x 1 x 2 x n21 x n 5 b x

Chpter 4.3: Elements of Numericl Integrtion 13 Theorem (4.2: Closed Newton-Cotes Formuls) Suppose tht n i=0 if (x i ) denotes the (n + 1)-point closed Newton-Cotes formul with x 0 =, x n = b, nd h = (b )/n. There exists ξ (, b) for which b f (x) dx = n i=0 i f (x i ) + hn+3 f (n+2) (ξ) (n + 2)! if n is even nd f C n+2 [, b], nd n 0 t 2 (t 1) (t n) dt, b f (x) dx = n i=0 i f (x i ) + hn+2 f (n+1) (ξ) (n + 1)! n 0 t(t 1) (t n) dt, if n is odd nd f C n+1 [, b].

Chpter 4.3: Elements of Numericl Integrtion 14 Common Closed Newton-Cotes Formuls n = 1: Trpezoidl rule where x 0 < ξ < x 1 x1 n = 2: Simpson s rule where x 0 < ξ < x 2 x2 x 0 x 0 f (x) dx = h 2 [f (x 0) + f (x 1 )] h3 12 f (ξ). f (x) dx = h 3 [f (x 0) + 4f (x 1 ) + f (x 2 )] h5 90 f (4) (ξ). n = 3: Simpson s Three-Eighths where x 0 < ξ < x 3 x3 x 0 n = 4: where x 0 < ξ < x 4 f (x) dx = 3h 8 [f (x 0) + 3f (x 1 ) + 3f (x 2 ) + f (x 3 )] 3h5 80 f (4) (ξ). x4 x 0 f (x) dx = 2h 45 [7f (x 0) + 32f (x 1 ) + 12f (x 2 ) + 32f (x 3 ) + 7f (x 4 )] 8h7 945 f (6) (ξ).

Chpter 4.3: Elements of Numericl Integrtion 15 Open Newton-Cotes Formuls The open Newton-Cotes formuls do not include the endpoints of [, b] s nodes. They use the nodes x i = x 0 + ih, for ech i = 0, 1,..., n, where h = (b )/(n + 2) nd x 0 = + h. This implies tht x n = b h, so we lbel the endpoints by setting x 1 = nd x n+1 = b, s shown in the figure. Open formuls contin ll the nodes used for the pproximtion within the open intervl (, b). y y = f (x) y = P n (x) 5 x 21 x 0 x 1 x 2 x n x n11 5 b x

Chpter 4.3: Elements of Numericl Integrtion 16 Common Open Newton-Cotes Formuls n = 0: Midpoint rule x 1 x 1 f (x) dx = 2hf (x 0 ) + h3 3 f (ξ), x 1 < ξ < x 1. n = 1: x 2 f (x) dx = 3h x 1 2 [f (x 0) + f (x 1 )] + 3h3 4 f (ξ), x 1 < ξ < x 2. n = 2: x3 f (x) dx x 1 = 4h 3 [2f (x 0) f (x 1 ) + 2f (x 2 )] + 14h5 45 f (4) (ξ), n = 3: x4 x 1 < ξ < x 3. x 1 f (x) dx = 5h 24 [11f (x 0) + f (x 1 ) + f (x 2 ) + 11f (x 3 )] + 95 144 h5 f (4) (ξ), x 1 < ξ < x 4.

Chpter 4.3: Elements of Numericl Integrtion 17 Theorem (4.3) Suppose tht n i=0 if (x i ) denotes the (n + 1)-point open Newton-Cotes formul with x 1 =, x n+1 = b, nd h = (b )/(n + 2). There exists ξ (, b) for which b f (x) dx = n i=0 i f (x i ) + hn+3 f (n+2) (ξ) (n + 2)! n+1 1 t 2 (t 1) (t n) dt, if n is even nd f C n+2 [, b], nd b f (x) dx = n i=0 i f (x i ) + hn+2 f (n+1) (ξ) (n + 1)! n+1 1 t(t 1) (t n) dt, if n is odd nd f C n+1 [, b].

Chpter 4.4: Composite Numericl Integrtion 18 Theorem (4.4) Let f C 4 [, b], n be even, h = (b )/n, nd x j = + jh, for ech j = 0, 1,..., n. There exists µ (, b) for which the Composite Simpson s rule for n subintervls cn be written with its error term s b f (x) dx = h f () + 2 3 (n/2) 1 j=1 n/2 f (x 2j ) + 4 f (x 2j 1 ) + f (b) b 180 h4 f (4) (µ). j=1

Chpter 4.4: Composite Numericl Integrtion 19 Choose n even integer n. Subdivide the intervl [, b] into n subintervls, nd pply Simpson s rule on ech consecutive pir of subintervls. (See Figure 4.7) y y 5 f (x) 5 x 0 x 2 x 2j22 x 2j21 x 2j b 5 x n x Figure: Figure 4.7

Chpter 4.4: Composite Numericl Integrtion 20 The error term for the Composite Simpson s rule is O(h 4 ), wheres it ws O(h 5 ) for the stndrd Simpson s rule. However, these rtes re not comprble becuse for stndrd Simpson s rule we hve h fixed t h = (b )/2, but for Composite Simpson s rule we hve h = (b )/n, for n n even integer. This permits us to considerbly reduce the vlue of h.

Chpter 4.4: Composite Numericl Integrtion 21 Algorithm 4.1: COMPOSITE SIMPSON S RULE To pproximte the integrl I = b f (x) dx: INPUT endpoints, b; even positive integer n. OUTPUT pproximtion XI to I. Step 1 Set h = (b )/n. Step 2 Set XI0 = f () + f (b); XI1 = 0; (Summtion of f (x 2i 1 ).) XI2 = 0. (Summtion of f (x 2i ).) Step 3 For i = 1,..., n 1 do Steps 4 nd 5. Step 4 Set X = + ih. Step 5 If i is even then set XI2 = XI2 + f (X) else set XI1 = XI1 + f (X). Step 6 Set XI = h(xi0 + 2 XI2 + 4 XI1)/3. Step 7 OUTPUT (XI); STOP.

Chpter 4.4: Composite Numericl Integrtion 22 Theorem (4.5) Let f C 2 [, b], h = (b )/n, nd x j = + jh, for ech j = 0, 1,..., n. There exists µ (, b) for which the Composite Trpezoidl rule for n subintervls cn be written with its error term s b f (x) dx = h n 1 f () + 2 f (x j ) + f (b) b 2 12 h2 f (µ). j=1 y y 5 f (x) 5 x 0 x 1 x j21 x j x n21 b 5 x n x Figure: Figure 4.8

Chpter 4.4: Composite Numericl Integrtion 23 Theorem (4.6) Let f C 2 [, b], n be even, h = (b )/(n + 2), nd x j = + (j + 1)h for ech j = 1, 0,..., n + 1. There exists µ (, b) for which the Composite Midpoint rule(see lso composite midpoint rule) for n + 2 subintervls cn be written with its error term s b n/2 f (x) dx = 2h f (x 2j ) + b 6 h2 f (µ). j=0 y y 5 f (x) 5 x 21 x 0 x 1 x 2j21 x 2j x 2j11 x n21 x n b 5 x n11 x

Chpter 4.5: Romberg Integrtion 24 Recll from Section 4.2 tht Richrdson extrpoltion cn be performed on ny pproximtion procedure whose trunction error is of the form m 1 K j h α j + O(h αm ), j=1 for collection of constnts K j nd when α 1 < α 2 < α 3 < < α m. In tht section we gve demonstrtions to illustrte how effective this techniques is when the pproximtion procedure hs trunction error with only even powers of h, tht is, when the trunction error hs the form. m 1 K j h 2j + O(h 2m ). j=1 Becuse the Composite Trpezoidl rule hs this form, it is n obvious cndidte for extrpoltion. This results in technique known s Romberg integrtion.

Chpter 4.5: Romberg Integrtion 25 To pproximte the integrl b f (x) dx we use the results of the Composite Trpezoidl Rule with n = 1, 2, 4, 8, 16,..., nd denote the resulting pproximtions, respectively, by R 1,1, R 2,1, R 3,1, etc. We then pply extrpoltion in the mnner given in Section 4.2, tht is, we obtin O(h 4 ) pproximtions R 2,2, R 3,2, R 4,2, etc, by R k,2 = R k,1 + 1 3 (R k,1 R k 1,1 ), for k = 2, 3,... Then O(h 6 ) pproximtions R 3,3, R 4,3, R 5,3, etc, by R k,3 = R k,2 + 1 15 (R k,2 R k 1,2 ), for k = 3, 4,.... In generl, fter the pproprite R k,j 1 pproximtions hve been obtined, we determine the O(h 2j ) pproximtions from 1 R k,j = R k,j 1 + 4 j 1 1 (R k,j 1 R k 1,j 1 ), for k = j, j + 1,...

Chpter 4.5: Romberg Integrtion 26 y y y y 5 f (x) R 1,1 R 2,1 y 5 f (x) R 3,1 y 5 f (x) b x b x b x O ( ) hk 2 Figure: Figure 4.10 nd Tble 4.10 O ( ) hk 4 O ( ) hk 6 O ( ) hk 8 k 1 R 1,1 2 R 2,1 R 2,2 3 R 3,1 R 3,2 R 3,3 4 R 4,1 R 4,2 R 4,3 R 4,4.... n R n,1 R n,2 R n,3 R n,4 R n,n.... O ( ) hk 2n

Chpter 4.5: Romberg Integrtion 27 Algorithm 4.2: ROMBERG INTEGRATION b To pproximte the integrl I = f (x) dx, select n integer n > 0. INPUT endpoints, b; integer n. OUTPUT n rry R. (Compute R by rows; only the lst 2 rows re sved in storge.) Step 1 Set h = b ; R 1,1 = h (f () + f (b)). 2 Step 2 OUTPUT (R 1,1 ). Step 3 For i = 2,..., n do Steps 4 8. Step 4 Set R 2,1 = 1 [R 1,1 + h 2 i 2 k=1 ]. 2 f ( + (k 0.5)h) (Approximtion from Trpezoidl method.) Step 5 For j = 2,..., i set R 2,j = R 2,j 1 + R 2,j 1 R 1,j 1 4 j 1. (Extrpoltion.) 1 Step 6 OUTPUT (R 2,j for j = 1, 2,..., i). Step 7 Set h = h/2. Step 8 For j = 1, 2,..., i set R 1,j = R 2,j. (Updte row 1 of R.) Step 9 STOP.

Chpter 4.6: Adptive Qudrture 28 Composite formuls very effective in most situtions, but suffer occsionlly from requirement of eqully-spced nodes. Inpproprite when integrting function on n intervl contining regions with both lrge nd smll functionl vrition. How cn we determine wht technique should be pplied on vrious portions of the intervl of integrtion How ccurte cn we expect the finl pproximtion to be? An efficient technique for this type of problem should predict the mount of functionl vrition nd dpt the step size s necessry. These methods re clled Adptive qudrture methods.

Chpter 4.6: Adptive Qudrture 29 Algorithm 4.3: ADAPTIVE QUADRATURE b To pproximte the integrl I = f (x) dx to within given tolernce: INPUT endpoints, b; tolernce TOL; limit N to number of levels. OUTPUT pproximtion APP or messge tht N is exceeded. Step 1 Set APP = 0; i = 1; TOL i = 10 TOL; i = ; h i = (b )/2; FA i = f (); FC i = f ( + h i ); FB i = f (b); S i = h i (FA i + 4FC i + FB i )/3; (Approx. from Simpson s for entire intervl) L i = 1. Step 2 While i > 0 do Steps 3 5. Step 3 Set FD = f ( i + h i /2); FE = f ( i + 3h i /2); S1 = h i (FA i + 4FD + FC i )/6; (Approximtions from Simpson s method for hlves of subintervls.) S2 = h i (FC i + 4FE + FB i )/6; v 1 = i ; (Sve dt t this level.) v 2 = FA i ; v 3 = FC i ; v 4 = FB i ; v 5 = h i ; v 6 = TOL i ; v 7 = S i ; v 8 = L i. Step 4 Set i = i 1. (Delete the level.)

Chpter 4.6: Adptive Qudrture 30 Algorithm 4.3: ADAPTIVE QUADRATURE CONTINUED Step 5 If S1 + S2 v 7 < v 6 then set APP = APP + (S1 + S2) else if (v 8 N) then OUTPUT ( LEVEL EXCEEDED ); (Procedure fils.) STOP. else (Add one level.) set i = i + 1; (Dt for right hlf subintervl.) i = v 1 + v 5 ; FA i = v 3 ; FC i = FE; FB i = v 4 ; h i = v 5 /2; TOL i = v 6 /2; S i = S2; L i = v 8 + 1; Step 6 OUTPUT (APP); STOP. set i = i + 1; (Dt for left hlf subintervl.) i = v 1 ; FA i = v 2 ; FC i = FD; FB i = v 3 ; h i = h i 1 ; TOL i = TOL i 1 ; S i = S1; L i = L i 1. (APP pproximtes I to within TOL.)

Chpter 4.7: Gussin Qudrture 31 Consider the Trpezoidl rule pplied to determine the integrls of the functions whose grphs re shown in Figure 4.15. The Trpezoidl rule pproximtes the integrl of the function by integrting the liner function tht joins the endpoints of the grph of the function. y y y y 5 f (x) y 5 f (x) y 5 f (x) 5 x 1 x 2 5 b x 5 x 1 x 2 5 b x 5 x 1 x 2 5 b x Figure: Figure 4.15

Chpter 4.7: Gussin Qudrture 32 But this is not likely the best line for pproximting the integrl. Lines such s those shown in Figure 4.16 would likely give much better pproximtions in most cses. y y y y 5 f (x) y 5 f (x) y 5 f (x) x 1 x 2 b x x 1 x 2 b x x 1 b x x 2 Figure: Figure 4.16

Chpter 4.7: Gussin Qudrture 33 In Gussin qudrture the points for evlution re chosen in n optiml, rther thn eqully-spced, wy. The nodes x 1, x 2,..., x n in the intervl [, b] nd coefficients c 1, c 2,..., c n, re chosen to minimize the expected error obtined in the pproximtion b n f (x) dx c i f (x i ). i=1 The YouTube video developed by Wen Shen cn serve s good illustrtion of the introduction to Gussin Qudrture for students. Illustrtion Introducing Gussin Qudrture

Chpter 4.7: Gussin Qudrture 34 The nodes x 1, x 2,..., x n needed to produce n integrl pproximtion formul tht gives exct results for ny polynomil of degree less thn 2n re the roots of the nth-degree Legendre polynomil. (See Theorem 4.7.) Theorem (4.7) Suppose tht x 1, x 2,..., x n re the roots of the nth Legendre polynomil P n (x) nd tht for ech i = 1, 2,..., n, the numbers c i re defined by 1 n x x j c i = dx. x i x j 1 j=1 j i If P(x) is ny polynomil of degree less thn 2n, then 1 n P(x) dx = c i P(x i ). 1 i=1

Chpter 4.8: Multiple Integrls 35 Algorithm 4.4: SIMPSON S DOUBLE INTEGRAL To pproximte the integrl I = b d(x) f (x, y) dy dx : c(x) INPUT endpoints, b: even positive integers m, n. OUTPUT pproximtion J to I. Step 1 Set h = (b )/n; J 1 = 0; (End terms.) J 2 = 0; (Even terms.) J 3 = 0. (Odd terms.) Step 2 For i = 0, 1,..., n do Steps 3 8. Step 3 Set x = + ih; (Composite Simpson s method for x.) HX = (d(x) c(x))/m; K 1 = f (x, c(x)) + f (x, d(x)); (End terms.) K 2 = 0; (Even terms.) K 3 = 0. (Odd terms.) Step 4 For j = 1, 2,..., m 1 do Step 5 nd 6. Step 5 Set y = c(x) + jhx; Q = f (x, y). Step 6 If j is even then set K 2 = K 2 + Q else set K 3 = K 3 + Q. ( Step 7 Set L = (K 1 + 2K 2 + 4K 3 )HX/3. L ) d(x i ) c(x i ) f (x i, y) dy by the Composite Simpson s method. Step 8 If i = 0 or i = n then set J 1 = J 1 + L else if i is even set J 2 = J 2 + L else set J 3 = J 3 + L. (End Step 2) Step 9 Set J = h(j 1 + 2J 2 + 4J 3 )/3. Step 10 OUTPUT (J); STOP.

Chpter 4.8: Multiple Integrls 36 Algorithm 4.5: GAUSSIAN DOUBLE INTEGRAL INPUT endpoints, b; positive integers m, n. (The roots r i,j nd coefficients c i,j need to be vilble for i = mx{m, n} nd for 1 j i.) OUTPUT pproximtion J to I. Step 1 Set h 1 = (b )/2; h 2 = (b + )/2; J = 0. Step 2 For i = 1, 2,..., m do Steps 3 5. Step 3 Set JX = 0; x = h 1 r m,i + h 2 ; d 1 = d(x); c 1 = c(x); k 1 = (d 1 c 1 )/2; k 2 = (d 1 + c 1 )/2. Step 4 For j = 1, 2,..., n do set y = k 1 r n,j + k 2 ; Q = f (x, y); JX = JX + c n,j Q. Step 5 Set J = J + c m,i k 1 JX. (End Step 2) Step 6 Set J = h 1 J. Step 7 OUTPUT (J); STOP.

Chpter 4.8: Multiple Integrls 37 Algorithm 4.6: GAUSSIAN TRIPLE INTEGRAL To pproximte the integrl b d(x) c(x) β(x,y) f (x, y, z) dz dy dx : α(x,y) INPUT endpoints, b; positive integers m, n, p. (The roots r i,j nd coefficients c i,j need to be vilble for i = mx{n, m, p} nd for 1 j i.) OUTPUT pproximtion J to I. Step 1 Set h 1 = (b )/2; h 2 = (b + )/2; J = 0. Step 2 For i = 1, 2,..., m do Steps 3 8. Step 3 Set JX = 0; x = h 1 r m,i + h 2 ; d 1 = d(x); c 1 = c(x); k 1 = (d 1 c 1 )/2; k 2 = (d 1 + c 1 )/2. Step 4 For j = 1, 2,..., n do Steps 5 7. Step 5 Set JY = 0; y = k 1 r n,j + k 2 ; β 1 = β(x, y); α 1 = α(x, y); l 1 = (β 1 α 1 )/2; l 2 = (β 1 + α 1 )/2. Step 6 For k = 1, 2,..., p do set z = l 1 r p,k + l 2 ; Q = f (x, y, z); JY = JY + c p,k Q. Step 7 Set JX = JX + c n,j l 1 JY. (End Step 4) Step 8 Set J = J + c m,i k 1 JX. (End Step 2) Step 9 Set J = h 1 J. Step 10 OUTPUT (J); STOP.

Chpter 4.9: Improper Integrls 38 Left Endpoint Singulrity Consider the sitution when the integrnd is unbounded t the left endpoint of the intervl of integrtion, s shown in Figure 4.25. In this cse we sy tht f hs singulrity t the endpoint. We will then show how other improper integrls cn be reduced to problems of this form. y y 5 f(x) b x Figure: Figure 4.25

Chpter 4.9: Improper Integrls 39 Left Endpoint Singulrity It is shown in clculus tht the improper integrl with singulrity t the left endpoint, b dx (x ) p, converges if nd only if 0 < p < 1, nd in this cse, we define b 1 dx = lim (x ) p M + (x ) 1 p 1 p x=b x=m = (b )1 p. 1 p

Chpter 4.9: Improper Integrls 40 Right-Endpoint Singulrity To pproximte the improper integrl with singulrity t the right endpoint, we could develop similr technique but expnd in terms of the right endpoint b insted of the left endpoint. Alterntively, we cn mke the substitution z = x, dz = dx to chnge the improper integrl into one of the form b f (x) dx = b f ( z) dz,

Chpter 4.9: Improper Integrls 41 Right-Endpoint Singulrity which hs its singulrity t the left endpoint. Then we cn pply the left endpoint singulrity technique we hve lredy developed. y For z 5 2x y y 5 f (x) y 5 f (2z) b x 2b 2 z Figure: Figure 4.26

Chpter 4.9: Improper Integrls 42 Infinite Singulrity The other type of improper integrl involves infinite limits of integrtion. The bsic integrl of this type hs the form 1 x p dx, for p > 1. This is converted to n integrl with left endpoint singulrity t 0 by mking the integrtion substitution t = x 1, dt = x 2 dx, so dx = x 2 dt = t 2 dt. Then 1 0 1/ x p dx = tp 1/ t 2 dt = 0 1 t 2 p dt.

Chpter 4.9: Improper Integrls 43 Infinite Singulrity In similr mnner, the vrible chnge t = x 1 converts the improper integrl f (x) dx into one tht hs left endpoint singulrity t zero: f (x) dx = 1/ 0 t 2 f ( ) 1 t It cn now be pproximted using qudrture formul of the type described erlier. dt.