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

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

Lecture 14: Quadrature

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

Orthogonal Polynomials

Interpolation. Gaussian Quadrature. September 25, 2011

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

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

Numerical Integration

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

COT4501 Spring Homework VII

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

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

1 The Lagrange interpolation formula

Construction of Gauss Quadrature Rules

Lecture 12: Numerical Quadrature

Orthogonal Polynomials and Least-Squares Approximations to Functions

B.Sc. in Mathematics (Ordinary)

Theoretical foundations of Gaussian quadrature

Numerical quadrature based on interpolating functions: A MATLAB implementation

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

Lecture 14 Numerical integration: advanced topics

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

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

Discrete Least-squares Approximations

Midpoint Approximation

Numerical Integration

Numerical Analysis: Trapezoidal and Simpson s Rule

The Riemann Integral

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

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 ),

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

Math& 152 Section Integration by Parts

Numerical integration

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

Best Approximation. Chapter The General Case

Section 4.8. D v(t j 1 ) t. (4.8.1) j=1

Section 7.1 Integration by Substitution

3.4 Numerical integration

Chapter 3 Polynomials

Lecture 19: Continuous Least Squares Approximation

Lecture 23: Interpolatory Quadrature

Math 100 Review Sheet

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

Abstract inner product spaces

7. Numerical evaluation of definite integrals

Lecture 20: Numerical Integration III

Arithmetic Mean Derivative Based Midpoint Rule

Harmonic Mean Derivative - Based Closed Newton Cotes Quadrature

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

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

CAAM 453 NUMERICAL ANALYSIS I Examination There are four questions, plus a bonus. Do not look at them until you begin the exam.

Module 11.4: nag quad util Numerical Integration Utilities. Contents

Lab 11 Approximate Integration

NUMERICAL INTEGRATION

Improper Integrals, and Differential Equations

APPROXIMATE INTEGRATION

Space Curves. Recall the parametric equations of a curve in xy-plane and compare them with parametric equations of a curve in space.

THE HANKEL MATRIX METHOD FOR GAUSSIAN QUADRATURE IN 1 AND 2 DIMENSIONS

Sections 5.2: The Definite Integral

Review of Gaussian Quadrature method

6.5 Numerical Approximations of Definite Integrals

Matrices, Moments and Quadrature, cont d

Chapter 3 Solving Nonlinear Equations

Numerical Methods I Orthogonal Polynomials

On Second Derivative-Free Zero Finding Methods

A NONLINEAR OPTIMIZATION PROCEDURE FOR GENERALIZED GAUSSIAN QUADRATURES

1 The Riemann Integral

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

INTRODUCTION TO INTEGRATION

Problem Set 3 Solutions

CS514 Fall '00 Numerical Analysis (Sketched) Solution of Homework 3 1. Questions from text in Chapter 3 Problem 1: 0 f 0 1 f 8 1 8(f 1 f 0 ) 1 f 4 2 8

Lecture 3 Gaussian Probability Distribution

Undergraduate Research

Numerical Integration

Best Approximation in the 2-norm

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

Integral equations, eigenvalue, function interpolation

JDEP 384H: Numerical Methods in Business

Math 131. Numerical Integration Larson Section 4.6

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

Overview of Calculus I

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?

QUADRATURE is an old-fashioned word that refers to

2

QUANTUM CHEMISTRY. Hückel Molecular orbital Theory Application PART I PAPER:2, PHYSICAL CHEMISTRY-I

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 Methods in Economics

The Regulated and Riemann Integrals

Lecture Notes: Orthogonal Polynomials, Gaussian Quadrature, and Integral Equations

OPEN NEWTON - COTES QUADRATURE WITH MIDPOINT DERIVATIVE FOR INTEGRATION OF ALGEBRAIC FUNCTIONS

AN INTEGRAL INEQUALITY FOR CONVEX FUNCTIONS AND APPLICATIONS IN NUMERICAL INTEGRATION

1 Part II: Numerical Integration

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

5: The Definite Integral

4.4 Areas, Integrals and Antiderivatives

The Fundamental Theorem of Calculus, Particle Motion, and Average Value

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

Tangent Line and Tangent Plane Approximations of Definite Integral

Part IB Numerical Analysis

Section 17.2 Line Integrals

Transcription:

Trpezoidl Rule, n = 1, x 0 =, x 1 = b, h = b f (x)dx = h 2 (f (x 0) + f (x 1 )) h3 12 f (ξ).

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. Qudrture Rule, double node t x 1 P 3 (x)dx = f (x 0 ) +f (x 1 ) (x x 1 ) 2 (x x 2 ) (x 0 x 1 ) 2 (x 0 x 2 ) dx + f (x 2) (x x 0 )(x x 2 ) (x 1 x 0 )(x 1 x 2 ) +f (x x 0 )(x x 1 )(x x 2 ) (x 1 ) dx (x 1 x 0 )(x 1 x 2 ) (x x 1 ) 2 (x x 0 ) (x 2 x 1 ) 2 (x 2 x 0 ) dx ( 1 (x x ) 1)(2x 1 x 0 x 2 ) dx (x 1 x 0 )(x 1 x 2 )

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. Qudrture Rule, double node t x 1 P 3 (x)dx = f (x 0 ) +f (x 1 ) (x x 1 ) 2 (x x 2 ) (x 0 x 1 ) 2 (x 0 x 2 ) dx + f (x 2) (x x 0 )(x x 2 ) (x 1 x 0 )(x 1 x 2 ) +f (x x 0 )(x x 1 )(x x 2 ) (x 1 ) dx (x 1 x 0 )(x 1 x 2 ) = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )). (x x 1 ) 2 (x x 0 ) (x 2 x 1 ) 2 (x 2 x 0 ) dx ( 1 (x x ) 1)(2x 1 x 0 x 2 ) dx (x 1 x 0 )(x 1 x 2 ) Stroke of luck: f (x 1 ) does not pper in qudrture

Simpson s Rule: f (x) = P 3 (x) + 1 4! f (4) (ξ(x))(x x 0 )(x x 1 ) 2 (x x 2 ). Qudrture Rule: f (x) dx = P 3 (x) dx + 1 4! = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )) + 1 4! f (4) (ξ(x))(x x 0 )(x x 1 ) 2 (x x 2 ) dx f (4) (ξ(x))(x x 0 )(x x 1 ) 2 (x x 2 ) dx h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )). Qudrture Error: 1 4! = f (4) (ξ) 24 f (4) (ξ(x))(x x 0 )(x x 1 ) 2 (x x 2 ) dx (x x 0 )(x x 1 ) 2 (x x 2 ) dx = f (4) (ξ) 90 h 5.

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. f (x)dx = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )) f (4) (ξ) 90 h 5.

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. f (x)dx = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )) f (4) (ξ) 90 h 5.

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. f (x)dx = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )) f (4) (ξ) 90 h 5. Wrong plot: slopes should mtch t midpoint.

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. f (x)dx = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )) f (4) (ξ) 90 h 5. Right: slopes mtch t midpoint.

Exmple: pproximte 2 0 f (x)dx: Simpson wins

Degree of precision Degree of precision: the lrgest positive integer n such tht qudrture formul is exct for x k, for ech k = 0, 1,, n.

Degree of precision Degree of precision: the lrgest positive integer n such tht qudrture formul is exct for x k, for ech k = 0, 1,, n. Impliction: qudrture formul is exct for ll polynomils of degree t most n.

Degree of precision Degree of precision: the lrgest positive integer n such tht qudrture formul is exct for x k, for ech k = 0, 1,, n. Impliction: qudrture formul is exct for ll polynomils of degree t most n. Simplifiction: only need to verify exctness on intervl [0, 1].

Degree of precision Degree of precision: the lrgest positive integer n such tht qudrture formul is exct for x k, for ech k = 0, 1,, n. Impliction: qudrture formul is exct for ll polynomils of degree t most n. Simplifiction: only need to verify exctness on intervl [0, 1]. DoP = 1 for Trpezoidl Rule, DoP = 3 for Simpson.

Simpson s Rule: n = 3, x 0 =, x 1 = +b 2, x 2 = b, h = b 2. f (x)dx = h 3 (f (x 0) + 4f (x 1 ) + f (x 2 )) f (4) (ξ) 90 h 5. Degree of precision = 3

Composite Simpson s Rule (n = 2m, x j = + j h, h = b n, 0 j n) f (x)dx = = m x2j f (x)dx x 2(j 1) ( m h ( f (x2(j 1) ) + 4f (x 2j 1 ) + f (x 2j ) ) ) f (4) (ξ j ) h 5. 3 90

Composite Simpson s Rule (n = 2m, x j = + j h, h = b n, 0 j n) (x)dx = f h f () + 2 3 = h f () + 2 3 = h f () + 2 3 m 1 m 1 m 1 m m f (x 2j ) + 4 f (x 2j 1 ) + f (b) h5 f (4) (ξ j ) 90 m f (x 2j ) + 4 f (x 2j 1 ) + f (b) h5 m 90 f (4) (µ) m f (x 2j ) + 4 f (x 2j 1 ) + f (b) (b )h4 180 f (4) (µ)

Trpezoidl Rule: n = 1, x 0 =, x 1 = b, h = b. f (x)dx = h 2 (f (x 0) + f (x 1 )) f (ξ) 12 h3. Degree of precision = 1

Composite Trpezoidl Rule (x j = + j h, h = b n, 0 j n) f (x)dx = = n xj f (x)dx x j 1 n ( h 2 (f (x j 1) + f (x j )) f ) (ξ j ) h 3. 12

Composite Trpezoidl Rule (x j = + j h, h = b n, 0 j n) (x)dx = f h n 1 n f () + 2 f (x j ) + f (b) h3 f (ξ j ) 2 12 = h n 1 f () + 2 f (x j ) + f (b) h3 n 2 12 f (µ) = h n 1 f () + 2 f (x j ) + f (b) (b )h2 f (µ) 2 12 For the sme work, Composite Simpson yields twice s mny correct digits.

Composite Simpson s Rule, exmple Determine vlues of h for n pproximtion error ɛ = 10 5 when pproximting π 0 sin(x) dx with Composite Simpson.

Composite Simpson s Rule, exmple Determine vlues of h for n pproximtion error ɛ = 10 5 when pproximting π 0 sin(x) dx with Composite Simpson. Solution: f (4) (µ) = sin(µ) 1, Error = π h 4 180 f (4) (µ) π5 180n 4. Choosing or h = π 2m π 5 ( π 180n 4 ɛ, leding to n π 180ɛ with m 11. ) 1 4 20.3.

Composite Simpson s Rule, exmple 2 = Determine vlues of h for n pproximtion error ɛ = 10 5 when pproximting π 0 sin(x) dx with Composite Simpson. Solution: f (4) (µ) = sin(µ) 1, Error = π h 4 180 f (4) (µ) π5 180n 4. Choosing or h = π 2m π 0 π 5 2.0000046. π 0 ( π 180n 4 ɛ, leding to n π 180ɛ with m 11. For n = 2m = 22, sin(x) dx π 10 ( ) jπ 2 sin + 4 3 22 11 sin(x) dx π 2 2 22 21 sin ) 1 4 11 20.3. ( ) (2j 1)π sin 22 ( ) jπ 1.9966. (Trpezoidl) 22

Composite Simpson s Rule: Round-Off Error Stbility (n = 2m, x j = + j h, h = b n, 0 j n) (x)dx f h f () + 2 3 def = I(f ). m 1 f (x 2j ) + 4 m f (x 2j 1 ) + f (b)

Composite Simpson s Rule: Round-Off Error Stbility (n = 2m, x j = + j h, h = b n, 0 j n) (x)dx f h f () + 2 3 def = I(f ). m 1 Assume round-off error model: f (x 2j ) + 4 m f (x 2j 1 ) + f (b) f (x i ) = f (x i ) + e i, e i ɛ, i = 0, 1,, n.

Composite Simpson s Rule: Round-Off Error Stbility (n = 2m, x j = + j h, h = b n, 0 j n) (x)dx f h f () + 2 3 def = I(f ). m 1 Assume round-off error model: f (x 2j ) + 4 m f (x 2j 1 ) + f (b) f (x i ) = f (x i ) + e i, e i ɛ, i = 0, 1,, n. I(f ) = I( f ) + h m 1 m e 0 + 2 e 2j + 4 e 2j 1 + e n. 3 I(f ) I( f ) h m 1 m e 0 + 2 e 2j + 4 e 2j 1 + e n 3 hnɛ = (b )ɛ (numericlly stble!!!)

Composite Trpezoidl Rule: Round-Off Error Stbility (x j = + j h, h = b n, 0 j n) (x)dx f h n 1 f () + 2 f (x j ) + f (b) 2 def = I(f ).

Composite Trpezoidl Rule: Round-Off Error Stbility (x j = + j h, h = b n, 0 j n) (x)dx f h n 1 f () + 2 f (x j ) + f (b) 2 def = I(f ). Assume round-off error model: f (x i ) = f (x i ) + e i, e i ɛ, i = 0, 1,, n.

Composite Trpezoidl Rule: Round-Off Error Stbility (x j = + j h, h = b n, 0 j n) (x)dx f h n 1 f () + 2 f (x j ) + f (b) 2 def = I(f ). Assume round-off error model: f (x i ) = f (x i ) + e i, e i ɛ, i = 0, 1,, n. I(f ) = I( f ) + h n 1 e 0 + 2 e j + e n. 2 I(f ) I( f ) h n 1 e 0 + 2 e j + e n 2 hnɛ = (b )ɛ (numericlly stble!!!)

Recursive Composite Trpezoidl: with h k = (b )/2 k 1. f (x)dx h 2 n 1 f () + 2 f (x j ) + f (b) (b )h2 f (µ) 12

Recursive Composite Trpezoidl: with h k = (b )/2 k 1. f (x)dx h 2 book ==== h 2 def === R k,1 + n 1 f () + 2 f (x j ) + f (b) (b )h2 f (µ) 12 n 1 f () + 2 f (x j ) + f (b) + K j h 2j. K j h 2j, for n = 2 k.

Recursive Composite Trpezoidl: with h k = (b )/2 k 1. f (x)dx R 1,1 = h 1 2 h 2 book ==== h 2 def === R k,1 + n 1 f () + 2 f (x j ) + f (b) (b )h2 f (µ) 12 n 1 f () + 2 f (x j ) + f (b) + K j h 2j. K j h 2j, for n = 2 k. (f () + f (b)) = b 2 (f () + f (b)),

Recursive Composite Trpezoidl: with h k = (b )/2 k 1. f (x)dx R 1,1 = h 1 2 h 2 book ==== h 2 def === R k,1 + n 1 f () + 2 f (x j ) + f (b) (b )h2 f (µ) 12 n 1 f () + 2 f (x j ) + f (b) + K j h 2j. K j h 2j, for n = 2 k. (f () + f (b)) = b 2 (f () + f (b)), R 2,1 = h 2 2 (f () + f (b) + 2f ( + h 2)) = 1 2 (R 1,1 + h 1 f ( + h 2 )),

Recursive Composite Trpezoidl: with h k = (b )/2 k 1. f (x)dx R 1,1 = h 1 2 h 2 book ==== h 2 def === R k,1 + n 1 f () + 2 f (x j ) + f (b) (b )h2 f (µ) 12 n 1 f () + 2 f (x j ) + f (b) + K j h 2j. K j h 2j, for n = 2 k. (f () + f (b)) = b 2 (f () + f (b)), R 2,1 = h 2 2 (f () + f (b) + 2f ( + h 2)) = 1 2 (R 1,1 + h 1 f ( + h 2 )),.. R k,1 = 1 2 k 2 R k 1,1 + h k 1 f ( + (2j 1)h k ), k = 2,, log 2 2 n.

Romberg Extrpoltion Tble O(h 2 k ) O(h4 k ) O(h6 k ) O(h8 k ) R 1,1 R 2,1 R2,2 R 3,1 R3,2 R3,3 R 4,1 R 4,2 R 4,3 R 4,4

Romberg Extrpoltion for π 0 sin(x) dx, n = 1, 2, 22, 2 3, 2 4, 2 5. R 1,1 = π (sin(0) + sin(π)) = 0, 2 R 2,1 = 1 (R 1,1 + π sin( π ) 2 2 ) = 1.57079633, R 3,1 = 1 R 2,1 + π 2 (2j 1)π sin( = 1.89611890, 2 2 4 R 4,1 = 1 R 3,1 + π 4 (2j 1)π sin( = 1.97423160, 2 4 8 R 5,1 = 1 R 4,1 + π 8 (2j 1)π sin( = 1.99357034, 2 8 16 R 6,1 = 1 R 5,1 + π 2 4 (2j 1)π sin( = 1.99839336. 2 16 32

Romberg Extrpoltion, π 0 sin(x) dx = 2 0 1.57079633 2.09439511 1.89611890 2.00455976 1.99857073 1.97423160 2.00026917 1.99998313 2.00000555 1.99357034 2.00001659 1.99999975 2.00000001 1.9999999 1.99839336 2.00000103 2.00000000 2.00000000 2.0000000 2.0000000 33 function evlutions used in the tble.

Recursive Composite Simpson: f (x)dx m 1 h f () + 2 f (x 2j ) + 4 3 (b )h4 f (4) (µ) 12 m f (x 2j 1 ) + f (b)

Recursive Composite Simpson: f (x)dx exists ==== h 3 m 1 h f () + 2 f (x 2j ) + 4 3 (b )h4 f (4) (µ) 12 + f () + 2 K j h 2j. j=2 def === R k,1 + m 1 f (x 2j ) + 4 m f (x 2j 1 ) + f (b) m f (x 2j 1 ) + f (b) K j h 2j, for n = 2 k. j=2

Recursive Composite Simpson: with h k = (b )/2 k 1. f (x)dx R k,1 + K j h 2j, for n = 2 k. j=2

Recursive Composite Simpson: with h k = (b )/2 k 1. R 1,1 = b 6 f (x)dx R k,1 + K j h 2j, for n = 2 k. j=2 (f () + 4S 1 + f (b)), S 1 = f (( + b)/2),

Recursive Composite Simpson: with h k = (b )/2 k 1. R 1,1 = b 6. T k = f (x)dx R k,1 +. 2 k 1 K j h 2j, for n = 2 k. j=2 (f () + 4S 1 + f (b)), S 1 = f (( + b)/2), f ( + (2j 1)h k ), R k,1 = h k 3 (f () + 2S k 1 + 4T k + f (b)), S k = S k 1 + T k, k = 2,, log 2 n.

Romberg Extrpoltion Tble, Simpson Rule O(h 4 k ) O(h6 k ) O(h8 k ) O(h10 k ) R 1,1 R 2,1 R2,2 R 3,1 R3,2 R3,3 R 4,1 R 4,2 R 4,3 R 4,4

Tricks of the Trde, f (x)dx Composite Simpson/Trpezoidl rules: Adding more equi-spced points. Romberg extrpoltion: Obtin higher order rules from lower order rules. Adptive qudrtures: Adding more points only when necessry. qud function of mtlb: combintion of ll three.

Adptive Qudrture Methods: step-size mtters y(x) = e 3x sin 4x. Oscilltion for smll x; nerly 0 for lrger x. Mechnicl engineering (spring nd shock bsorber systems) Electricl engineering (circuit simultions) y(x) behves different for smll x nd for lrge x.

Adptive Qudrture (I) where S(, b) = h 3 f (x)dx = S(, b) h5 90 f (4) (ξ), ξ (, b), Simpson on [, b] (f () + 4f ( + h) + f (b)), h = b 2. Composite Simpson

Adptive Qudrture (II) f (x)dx = S(, b) h5 90 f (4) (ξ), ξ (, b), where f (x)dx = +b 2 f (x)dx + f (x)dx +b 2 = S(, + b 2 ) + S( + b 2, b) (h/2)5 90 f (4) (ξ 1 ) (h/2)5 90 f (4) (ξ 2 ) = S(, + b 2 ) + S( + b 2, b) 1 16 ( h 5 90 ξ 1 (, + b 2 ), ξ 2 ( + b 2, b), ξ (, b). ) f (4) ( ξ),

Adptive Qudrture (III) f (x)dx = S(, + b 2 ) + S( + b 2, b) 1 16 = S(, b) h5 90 f (4) (ξ) ( h 5 90 ) f (4) ( ξ)

Adptive Qudrture (III) f (x)dx = S(, + b 2 ) + S( + b 2, b) 1 16 ( h 5 90 ) f (4) ( ξ) = S(, b) h5 90 f (4) (ξ) S(, b) h5 90 f (4) ( ξ).

Adptive Qudrture (III) ( h 5 f (x)dx = S(, + b 2 ) + S( + b 2, b) 1 16 90 ( h 5 90 ) f (4) ( ξ) = S(, b) h5 90 f (4) (ξ) S(, b) h5 90 f (4) ( ξ). ) f (4) ( ξ) 16 ( S(, b) S(, + b 15 2 ) S( + b ) 2, b),

Adptive Qudrture (III) ( h 5 f (x)dx = S(, + b 2 ) + S( + b 2, b) 1 16 90 1 15 ( h 5 90 ) f (4) ( ξ) = S(, b) h5 90 f (4) (ξ) S(, b) h5 90 f (4) ( ξ). ) f (4) ( ξ) 16 ( S(, b) S(, + b 15 2 ) S( + b ) 2, b), f (x)dx S(, + b 2 ) S( + b ( ) 2, b) = 1 h 5 f (4) ( ξ) 16 90 + b S(, b) S(, 2 ) S( + b 2, b).

Adptive Qudrture (IV) For given tolernce τ, if 1 15 then S(, +b 2 + b S(, b) S(, 2 ) S( + b 2, b) τ, +b ) + S( 2, b) is sufficiently ccurte pproximtion to f (x)dx; otherwise recursively develop qudrtures on (, +b 2 ) nd, b), respectively. ( +b 2

AdptQud(f, [, b], τ) for computing f (x) dx compute S(, b), S(, +b 2 if 1 15 ), S( +b 2, b), + b S(, b) S(, 2 ) S( + b 2, b) τ, return S(, +b +b 2 ) + S( 2, b). else return AdptQud(f, [, + b 2 + b ], τ/2)+adptqud(f, [, b], τ/2). 2

Adptive Simpson (I)

Adptive Simpson (II)

Adptive Simpson, exmple Integrl 3 1 f (x) dx, f (x) = 100 x 2 sin Tolernce τ = 10 4. ( ) 10. x

function qud(f, [, b], τ) of mtlb For given tolernce τ, composite Simpson: S(, b), S(, +b +b 2 ) nd S( 2, b). Romberg extrpoltion: if Q 1 = S(, + b 2 )+S( + b 2, b), Q = Q 1+ 1 15 (Q 1 S(, b)). return Q else return qud(f, [, + b 2 Q Q 1 τ, + b ], τ/2) + qud(f, [, b], τ/2). 2

Gussin Qudrture (I) Trpezoidl nodes x 1 =, x 2 = b unlikely best choices. Likely better node choices.

Gussin Qudrture (II) Given n > 0, choose both distinct nodes x 1,, x n [ 1, 1] nd weights c 1,, c n, so qudrture 1 1 f (x) dx n c j f (x j ), (1) gives the gretest degree of precision (DoP).

Gussin Qudrture (II) Given n > 0, choose both distinct nodes x 1,, x n [ 1, 1] nd weights c 1,, c n, so qudrture 1 1 f (x) dx n c j f (x j ), (1) gives the gretest degree of precision (DoP). 2n totl number of prmeters in qudrture, could choose 2n monomils f (x) = 1, x, x 2,, x 2n 1 in eqution (1).

Gussin Qudrture (II) Given n > 0, choose both distinct nodes x 1,, x n [ 1, 1] nd weights c 1,, c n, so qudrture 1 1 f (x) dx n c j f (x j ), (1) gives the gretest degree of precision (DoP). 2n totl number of prmeters in qudrture, could choose 2n monomils f (x) = 1, x, x 2,, x 2n 1 in eqution (1). directly solving eqution (1) cn be very hrd.

Gussin Qudrture, n = 2 (I) Consider Gussin qudrture 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ).

Gussin Qudrture, n = 2 (I) Consider Gussin qudrture 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ). Choose prmeters c 1, c 2 nd x 1 < x 2 so tht Gussin qudrture is exct for f (x) = 1, x, x 2, x 3 : 1 1 f (x) dx = c 1 f (x 1 ) + c 2 f (x 2 ),

Gussin Qudrture, n = 2 (I) Consider Gussin qudrture 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ). Choose prmeters c 1, c 2 nd x 1 < x 2 so tht Gussin qudrture is exct for f (x) = 1, x, x 2, x 3 : 1 1 f (x) dx = c 1 f (x 1 ) + c 2 f (x 2 ), or 2 = 2 3 = 1 1 1 1 1 dx = c 1 + c 2, 0 = x 2 dx = c 1 x 2 1 + c 2 x 2 2, 0 = 1 1 1 1 x dx = c 1 x 1 + c 2 x 2, x 3 dx = c 1 x 3 1 + c 2 x 3 2.

Gussin Qudrture, n = 2 (II) x 1 < x 2, c 1 x 1 = c 2 x 2, c 1 x 3 1 = c 2 x 3 2, implying x 2 1 = x 2 2. Thus x 1 = x 2 nd c 1 = c 2.

Gussin Qudrture, n = 2 (II) x 1 < x 2, c 1 x 1 = c 2 x 2, c 1 x 3 1 = c 2 x 3 2, implying x 2 1 = x 2 2. Thus x 1 = x 2 nd c 1 = c 2. c 1 + c 2 = 2, c 1 x 2 1 + c 2 x 2 2 = 2 3, which implies c 1 = c 2 = 1, x 2 = 1 3. Gussin qudrture for n = 2 1 1 f (x) dx f ( 1 3 ) + f ( 1 3 ), exct for f (x) = 1, x, x 2, x 3, but not for f (x) = x 4.

Legendre

Legendre Legendre polynomils: P 0 (x) = 1, P 1 (x) = x. Bonnet s recursive formul for n 1: (n + 1)P n+1 (x) = (2n + 1)xP n (x) np n 1 (x).

Legendre Legendre polynomils: P 0 (x) = 1, P 1 (x) = x. Bonnet s recursive formul for n 1: (n + 1)P n+1 (x) = (2n + 1)xP n (x) np n 1 (x).

P n (x) hs degree exctly n. Legendre polynomils re orthogonl polynomils: 1 1 P m (x) P n (x) dx = 0, whenever m < n.

P n (x) hs degree exctly n. Legendre polynomils re orthogonl polynomils: 1 1 P m (x) P n (x) dx = 0, whenever m < n. Let Q(x) be ny polynomil of degree < n. Then Q(x) is liner combintion of P 0 (x), P 1 (x),, P n (x): Q(x) = α 0 P 0 (x) + α 1 P 1 (x) + + α n 1 P n 1 (x).

P n (x) hs degree exctly n. Legendre polynomils re orthogonl polynomils: 1 1 P m (x) P n (x) dx = 0, whenever m < n. Let Q(x) be ny polynomil of degree < n. Then Q(x) is liner combintion of P 0 (x), P 1 (x),, P n (x): Q(x) = α 0 P 0 (x) + α 1 P 1 (x) + + α n 1 P n 1 (x). 1 1 1 1 Q(x)P n (x) dx = α 0 P 0 (x)p n (x) dx + α 1 P 1 (x)p n (x) dx = 0. 1 1 1 + + α n 1 P n 1 (x)p n (x) dx 1

Gussin Qudrture: Definition Theorem: P n (x) hs exctly n distinct roots 1 < x 1 < x 2 < < x n < 1. Define: Gussin qudrture 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ) + + c n f (x n ),

Gussin Qudrture: Definition Theorem: P n (x) hs exctly n distinct roots 1 < x 1 < x 2 < < x n < 1. Define: Gussin qudrture 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ) + + c n f (x n ), Choose: for i = 1,, n, 1 1 def c i == L i (x) dx = x x j dx. 1 1 x i x j j i

Gussin Qudrture: Definition Theorem: P n (x) hs exctly n distinct roots 1 < x 1 < x 2 < < x n < 1. Define: Gussin qudrture 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ) + + c n f (x n ), Choose: for i = 1,, n, 1 1 def c i == L i (x) dx = x x j dx. 1 1 x i x j j i Qudrture exct for polynomils of degree t most n 1.

Theorem: DoP of Gussin Qudrture = 2n 1 Gussin qudrture, with roots of P n (x) x 1, x 2,, x n : 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ) + + c n f (x n ),

Theorem: DoP of Gussin Qudrture = 2n 1 Gussin qudrture, with roots of P n (x) x 1, x 2,, x n : 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ) + + c n f (x n ), Let P(x) be ny polynomil of degree t most 2n 1. Then P(x) = Q(x)P n (x) + R(x), (Polynomil Division) where Q(x), R(x) polynomils of degree t most n 1.

Theorem: DoP of Gussin Qudrture = 2n 1 Gussin qudrture, with roots of P n (x) x 1, x 2,, x n : 1 1 f (x) dx c 1 f (x 1 ) + c 2 f (x 2 ) + + c n f (x n ), Let P(x) be ny polynomil of degree t most 2n 1. Then P(x) = Q(x)P n (x) + R(x), (Polynomil Division) 1 1 where Q(x), R(x) polynomils of degree t most n 1. P(x) dx = 1 = 0 + Q(x)P n (x) dx + 1 1 1 R(x) dx 1 1 R(x) dx = c 1 R(x 1 ) + c 2 R(x 2 ) + + c n R(x n ) (qud exct for R(x)) = c 1 P(x 1 ) + c 2 P(x 2 ) + + c n P(x n ). (qud exct for P(x))