Chapter 3. Quadrature Formulas

Similar documents
Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

CHAPTER 11 Numerical Differentiation and Integration

Factoring Polynomials

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

Integration by Substitution

Lecture 3 Gaussian Probability Distribution

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

How To Understand The Theory Of Inequlities

QUADRATURE METHODS. July 19, Kenneth L. Judd. Hoover Institution

Reasoning to Solve Equations and Inequalities

SPECIAL PRODUCTS AND FACTORIZATION

g(y(a), y(b)) = o, B a y(a)+b b y(b)=c, Boundary Value Problems Lecture Notes to Accompany

Integration. 148 Chapter 7 Integration

Graphs on Logarithmic and Semilogarithmic Paper

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

Math 135 Circles and Completing the Square Examples

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity

9 CONTINUOUS DISTRIBUTIONS

Binary Representation of Numbers Autar Kaw

MATH 150 HOMEWORK 4 SOLUTIONS

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

4 Approximations. 4.1 Background. D. Levy

6.2 Volumes of Revolution: The Disk Method

Experiment 6: Friction

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

Review guide for the final exam in Math 233

Or more simply put, when adding or subtracting quantities, their uncertainties add.

Module Summary Sheets. C3, Methods for Advanced Mathematics (Version B reference to new book) Topic 2: Natural Logarithms and Exponentials

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

19. The Fermat-Euler Prime Number Theorem

MODULE 3. 0, y = 0 for all y

The Definite Integral

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

Regular Sets and Expressions

15.6. The mean value and the root-mean-square value of a function. Introduction. Prerequisites. Learning Outcomes. Learning Style

Review Problems for the Final of Math 121, Fall 2014

Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration

Algebra Review. How well do you remember your algebra?

1. Find the zeros Find roots. Set function = 0, factor or use quadratic equation if quadratic, graph to find zeros on calculator

Euler Euler Everywhere Using the Euler-Lagrange Equation to Solve Calculus of Variation Problems

AREA OF A SURFACE OF REVOLUTION

EQUATIONS OF LINES AND PLANES

Section 5-4 Trigonometric Functions

Helicopter Theme and Variations

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

Operations with Polynomials

Distributions. (corresponding to the cumulative distribution function for the discrete case).

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

The Velocity Factor of an Insulated Two-Wire Transmission Line

4.11 Inner Product Spaces

Lecture 5. Inner Product

DIFFERENTIATING UNDER THE INTEGRAL SIGN

The Riemann Integral. Chapter 1

Exam 1 Study Guide. Differentiation and Anti-differentiation Rules from Calculus I

Exponential and Logarithmic Functions

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

2 DIODE CLIPPING and CLAMPING CIRCUITS

Physics 43 Homework Set 9 Chapter 40 Key

e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

AA1H Calculus Notes Math1115, Honours John Hutchinson

Numerical Methods of Approximating Definite Integrals

M5A42 APPLIED STOCHASTIC PROCESSES PROBLEM SHEET 1 SOLUTIONS Term

ORBITAL MANEUVERS USING LOW-THRUST

Vectors Recap of vectors

Derivatives and Rates of Change

SUBSTITUTION I.. f(ax + b)

6 Energy Methods And The Energy of Waves MATH 22C

Introduction to Integration Part 2: The Definite Integral

Econ 4721 Money and Banking Problem Set 2 Answer Key

Real Analysis and Multivariable Calculus: Graduate Level Problems and Solutions. Igor Yanovsky

Basic Analysis of Autarky and Free Trade Models

Homework 3 Solutions

All pay auctions with certain and uncertain prizes a comment

4. DC MOTORS. Understand the basic principles of operation of a DC motor. Understand the operation and basic characteristics of simple DC motors.

Decision Rule Extraction from Trained Neural Networks Using Rough Sets

Small Business Networking

Section 7-4 Translation of Axes

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

The Fundamental Theorem of Calculus

Basically, logarithmic transformations ask, a number, to what power equals another number?

Small Business Networking

DIFFERENTIAL FORMS AND INTEGRATION

Small Business Networking

Redistributing the Gains from Trade through Non-linear. Lump-sum Transfers

piecewise Liner SLAs and Performance Timetagment

Applications to Physics and Engineering

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply?

COMPONENTS: COMBINED LOADING

3 The Utility Maximization Problem

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Linear Equations in Two Variables

CUBIC-FOOT VOLUME OF A LOG

trademark and symbol guidelines FOR CORPORATE STATIONARY APPLICATIONS reviewed

A.7.1 Trigonometric interpretation of dot product A.7.2 Geometric interpretation of dot product

Thinking out of the Box... Problem It s a richer problem than we ever imagined

Universal Regularizers For Robust Sparse Coding and Modeling

Warm-up for Differential Calculus

How To Network A Smll Business

Transcription:

Chpter 3 Qudrture Formuls There re severl different methods for obtining the re under n unknown curve f(x) bsed on just vlues of tht function t given points. During our investigtions in this clss we will look t the following min ctegories for numericl integrtion:. Newton-Cotes formuls In this cse, we obtin methods for numericl integrtion which cn be derived from the Lgrnge interpolting method. Alterntively the formuls cn lso be derived from Tylor expnsion. The ide is similr to the wy we obtin numericl differentition schemes. We cn esily derive not just integrtion formuls but lso their errors using this technique. The schemes which we develop here will be bsed on the ssumption of equidistnt points.. Composite, Newton - Cotes formuls (open nd closed) These methods re composite since they repetedly pply the simple formuls derived previously to cover longer intervls. This ide llows for piecewise estimtes of the integrl thus improving the error of our integrtion. (we will lso ssume equidistnt nodes in our presenttion). 3. Romberg Integrtion This method llows us to improve the error of our integrtion methods by doing miniml extr work. The ide is relly bsed on the Richrdson extrpoltion which we sw erlier in the numericl differentition section. 4. Adptive Integrtion Here we re free to choose the points over which we clculte the numericl integrl of f(x) so s to minimize our error. Adptive integrtion does not therefore require equidistnt nodes. Thus if the function is not very smooth t some intervl the step size h of the numericl integrtion method decreses to mke sure we do not ccumulte too much error in our clcultion. 5. Gussin Integrtion We explore methods which cn chieve optiml error reduction provided we plce the nodes t specific loctions. Computing the best weights for our numericl qudrtures gurntees optiml pproximtion of our integrl. 36

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 37 3. Simple Newton-Cotes methods Following the ides developed erlier on numericl differentition, we use once gin Lgrnge interpolting polynomils s strting point in obtining numericl integrtion methods. In fct in this section we lern how to derive the well-known Trpezoidl, midpoint, nd Simpson formuls mong others, which you hve seen before in clculus clsses. As usul we strt with the Lgrnge interpolting formul including the error term, P n (x) = n i=0 f(x i )L i (x) + f (n+) (ξ) (n + )! n (x x i ) Simply integrting the bove will produce vriety of numericl integrtion methods bsed on the number of nodes used. Let us look t simple exmple of how exctly we cn obtin our first simple formul for integrtion. 3.. Trpezoidl Rule For this rule ll we need is to strt with the Lgrnge interpolting polynomil for just two points, = nd b = x. Thus the corresponding Lgrnge interpolting polynomil with trunction error is, P (x) = f( ) x x + f(x ) x + f () (ξ) (x )(x x ) x x where s usul ξ (, b). Integrting the bove between = nd x = b we obtin, P (x) dx = f( ) x x b dx + f(x ) x i=0 x dx + f () (ξ x! (x )(x x ) dx Note here tht the integrl pplies only on the x-vribles while we bring outside ll known vlues such s f( ), f(x ), f () (ξ) etc... Let us now integrte ech piece on the right hnd side, [f( ) (x x ) ( x ) + f(x ) (x ) (x ) + f ( () (ξ) x 3 3 (x )] x=x + ) + x x (3.) x= We cn in fct write the error term bove in simpler form, ( f () (ξ) x 3 3 (x )] x + ) + x x = f () (ξ) h3 6 ssuming first tht h = x nd lso using weighted version of the men vlue theorem for integrls. Therefore evluting expression (3.) t both end points we obtin our first formul for numericl integrtion for the unknown function f(x), x f(x) dx = x (f( ) + f(x )) h3 6 f () (ξ) = h (f() + f(x )) h3 6 f () (ξ) (3.) This is the well-known Trpezoidl rule for numericl integrtion. Note tht we hve n exct description of the error for this pproximtion. When will there be zero error involved in numericlly obtining the integrl of f(x)? Tht would be possible if the f () would be zero. Tht implies

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 38 Figure 3.: Trpezoidl rule. The integrl is found by estimting the re under the curve f(x) using the trpezoidl rule. Assuming tht h = x then A = h (f(b) + f()). tht we hve no error if we pproximte the integrl of functions which re of degree or smller. Remember tht this is the fmous trpezoidl rule. In other words it clcultes the derivtive bsed on the re of the trpezoid with heights f( nd f(x. It is cler, geometriclly t lest bsed on Figure 3., tht if the function is liner then clerly there would be no error involved in using this rule. 3.. Simpson s Rule Similrly we cn derive higher order integrtion scheme bsed on three points, x nd x of the Lgrnge interpolting polynomil. Tht will be the well-known Simpson rule. However, we will insted present more ccurte method for obtining Simpson s rule bsed on Tylor expnsion round the middle point x written with the error term up to forth order, f(x) = f(x ) + f (x )(x x ) + f (x ) (x x ) + f (3) (x ) (x x ) 3 + f (4) (ξ) (x x 4 ) 4 3! 4! Thus strting with the bove nd integrting from to x we obtin, x =b = f(x) dx = f(x ) x + f (3) (x ) 6 dx + f(x ) x x (x x ) 3 dx + f (4) (ξ) 4 x x dx + f (x ) x x (x x ) 4 dx (x x ) dx where gin using the weighted men vlue theorem for integrls nd h = x x = x = (b )/ we obtin, x f(x) dx = hf(x ) + h3 3 f (x ) + f (4) (ξ) h 5 60 Note however tht we hve n pproximtion for the second derivtive f (x ) = f() f(x ) + f(x ) h h f (4) (ξ ) bsed on the numericl differentition section. Thus putting this together our Simpson rule emerges: x ( ) f(x) dx = hf(x ) + h3 f(x0 ) f(x ) + f(x ) h 3 h f (4) (ξ ) + f (4) (ξ) h 5 60 = h ( 3 [f() + 4f(x ) + f(x )] h5 3 f (4) (ξ ) ) 5 f (4) (ξ)

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 39 In fct it cn be shown (using lternte techniques) tht the bove formul for Simpson s rule cn be improved in terms of writing down more concise error term s follows, x where ξ (, x ) s usul. f(x) dx = h 3 [f() + 4f(x ) + f(x )] h5 90 f (4) (ξ) Figure 3.: Simpson rule. The integrl is found by estimting the re under the curve f(x) using the Simpson rule. To do this we use three different points =, x nd x = b nd define h = x x = x. Then A = h 3 (f() + 4f(x ) + f(x )). Exmple Apply both trpezoidl nd Simpson s rule in order to pproximte the re of the function f(x) = x between x.30. Also obtin estimtes of the error you re committing from using either pproximtion. Solution Strting with the trpezoidl rule, A trp =.3 x dx h (.3 + ) where h =.3. Thus the re using the trpezoidl is, A trp =.3 (.3 + ) =.3063 Using Simpson s rule on the other hnd implies tht we use three points =, x =.5 nd x =.3 nd the following formultion A Simpson =.3 Note tht in fct the true re is, x dx =.5 3 ( 4.5 +.3) =.34847 A =.5 x dx =.349 To obtin the error due to the trpezoidl rule we first need to find n upper bound for the second derivtive of f in the intervl [,.3] s follows, f () (ξ) = 4 ξ 3 4 3 = 4

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 40 Therefore the error due to trpezoidl rule is found by obtining n upper bound, in bsolute vlue, for the following term h 3 6 f () (ξ).33 6 4 =.005. Thus the error in our trpezoidl pproximtions is t most.00 which grees with our findings since the difference from the true re nd the pproximte re is.3063.349 =.000443. Thus the error we relly mde ws.00044 insted of the mximum we could hve mde of.00. Similrly to find the error using Simpson s formul we first need to pproximte the forth derivtive f (4) (ξ) 5 6 ξ = 5 7 6 = 5 7 6 Therefore the error of our pproximtion is h5 90 f (4) (ξ).55 5 90 6 =.00000079 Note tht indeed our true error.34847.349 =.0000 is less thn the possible mximum error we could hve mde of.0000008. 3. Some theoreticl results Let us now look s usul t error formuls for generl integrtion formuls. We will refer from now on to integrtion formuls s qudrtures. The formuls presented thus fr re clled closed Newton-Cotes qudrtures. They re closed becuse the end points of the intervl of integrtion re included in the formul. Otherwise, if the end points re not included in the formul then we hve n open Newton-Cotes qudrture. Before exmining the generl error for our qudrture formuls we give definition which will help in understnding the ccurcy of our methods: Definition 3... The lgebric degree of ccurcy of qudrture formul is given by the power of the polynomil P n (x) for which the qudrture is exct. Tht is hs no error t ll. Note for exmple tht if we integrte the polynomil f(x) = 3 x in the intervl [, ] using the trpezoidl rule we obtin the following pproximtion, Note tht in fct the true integrl is, 3 x dx = [3x x 3 x dx h (f() + f()) = ( + ) = 3 ] = (6 ) (3 /) = 4.5 = 3/ Note tht in fct the trpezoidl rule seems to be exct for the polynomil f(x) = 3 x! This is true in generl for ny liner function nd the trpezoidl rule. It is exct for ll liner functions. If we try to do the sme thing for qudrtic function however we will soon discover tht the trpezoidl rule is not exct in tht cse. Therefore for the trpezoidl rule hs degree of ccurcy. See if you cn find out wht is the degree of ccurcy for Simpson s rule.

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 4 Let us now disply the error formuls for generl Newton-Cotes qudrture without proof. Theorem 3... Suppose the following qudrture formul for n + points xn n f(x) dx i f(x i ) Then the error involved is given by: For n even: i=0 Closed Newton-Cotes : error = h(n+3) f (n+) (ξ) (n + )! Open Newton-Cotes : error = h(n+3) f (n+) (ξ) (n + )! n 0 n+ t (t )... (t n) dt t (t )... (t n) dt For n odd: Closed Newton-Cotes : error = h(n+) f (n+) (ξ) (n + )! Open Newton-Cotes : error = h(n+) f (n+) (ξ) (n + )! n 0 n+ t(t )... (t n) dt t(t )... (t n) dt where ξ (, x n ) s usul. Here for closed qudrtures we use h = (x n )/n while for open we use h = (x n+ x )/(n + ). All in ll we present here few of the most commonly used Newton - Cotes formuls. Note tht some re closed while others re open: Midpoint: Trpezoidl: Simpson s: Simpson s 3/8 rule: x3 Higher order rule: x4 x x x f(x) dx = hf( ) + h3 x 3 f (ξ) f(x) dx h (f() + f(x )) h3 f (ξ) f(x) dx = h 3 (f() + 4f(x ) + f(x )) h5 90 (ξ) f(x) dx = 3h 8 (f() + 3f(x ) + 3f(x ) + f(x 3 )) 3h5 80 (ξ) x f(x) dx = 5h 4 (f() + f(x ) + f(x ) + f(x 3 )) + 95h5 44 f (4) (ξ)

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 4 3.3 Composite Qudrtures The problem of the Newton-Cotes type qudrtures is similr to the problem which we encountered with Lgrnge polynomils over lrge intervls or severl nodes. Lgrnge polynomils tend to disply high vrition under these conditions. Insted we used piecewise method to counter this problem (the piecewise spline interpoltion). Similrly here the Newton-Cotes formuls, which re essentilly derived from Lgrnge polynomils, re not suitble for lrge intervls or severl nodes. Insted we cn try piecewise pproch in order to reduce our errors. In essence we will still pply the sme Newton-Cotes qudrtures but over severl smller intervls insted of lrge one. Since finding the integrl of function is equivlent to dding the res over severl smller intervls then this procedure should work. Composite Trpezoidl Rule Let us strt by pplying the trpezoidl rule in ech of those subintervls. We cn prove the following results, Composite Trpezoidl Rule Theorem 3.3.. Suppose f C [, b]. Then the composite trpezoidl rule for n + points, =, x,..., x n = b is given by, [ ] b f(x) dx = h n (b )h f() + f(x j ) + f(b) f (ξ) j= where h = (b )/n, x j = + jh nd ξ (, b) s usul. Proof: Strting from the integrl we will split it into n subintervls, n f(x) dx = xj+ x j f(x) dx Now using the trpezoidl rule in the subintervl (x j, x j+ ) we cn replce the integrtion, n xj+ n [ (xj+ x j )( f(x) dx = f(xj ) + f(x j+ ) ) (x ] j+ x j ) 3 f (ξ) x j Let us first define h = x j+ x j nd then strt summing up this expression, collecting like terms when pplicble, n [ (xj+ x j )( f(xj ) + f(x j+ ) ) (x ] j+ x j ) 3 f (ξ) [ ] = h n n f( ) + f(x j ) + f(x n ) h 3 f (ξ) [ ] = h n f() + f(x j ) + f(b) h 3 n f (ξ) [ ] = h n f() + f(x j ) + f(b) (b )h f (ξ)

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 43 Using similr methods we cn prove the following two theorems: Composite Midpoint Rule: Theorem 3.3.. Suppose f C [, b]. Then the composite Simpson s rule for n + points, =, x,..., x n = b is given by, n/ f(x) dx = h f(x j ) (b )h f (ξ) 6 where h = (b )/(n + ), x j = + (j + )h for j =, 0,..., n, n + nd ξ (, b) s usul. Composite Simpson s Rule Theorem 3.3.3. Suppose f C 4 [, b]. Then the composite Simpson s rule for n + points, =, x,..., x n = b is given by, f(x) dx = h n/ n/ f() + f(x j ) + 4 f(x j ) + f(b) (b )h4 f (4) (ξ) 3 80 j= j= where h = (b )/n, x j = + jh nd ξ (, b) s usul. A simple exmple is in order here.

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 44 Exmple Find the re under the curve f(x) = cos(x) between 0 nd π/ using the midpoint rule with n error not to exceed.00. Solution Bsed on the midpoint rule, where = 0, x n = π/ nd π/ 0 n/ f(x) dx = h f(x j ) + x n h f (ξ) (3.3) 6 h = x n n + = π/ 0 n + The rel question here is how big should we tke n so tht our error will be less thn.00. Note tht the error using the midpoint rule is ( ) ( ) π/ 0 π/ 0 Error = f (ξ) 6 n + (π/ 0)3 6(n + ) M where M denotes the mximum vlue of, As result we need the error to be less thn.00 Solving the bove for n we obtin, f (ξ) = cos(ξ) M for ξ (0, π/) (π/) 3 6(n + ) = π 3 48(n + ).00 n π 3 48.00 = 3.4 Since n must be n integer we tke it to be n = 4. Let us check whether this is relly correct by evluting the numericl integrl from formul (3.3) with this vlue of n nd compring it with the exct vlue of the integrl. [ π/ cos(x) dx π ] cos(x j ) 0 = π[cos( ) + cos(x ) + cos(x 4 ) + + cos(x 0 ) + cos(x )] =.0006 Note tht the exct vlue of the integrl is π/ 0 cos(x) dx = Thus the ctul error we re committing is.0006.0 =.0006. This is indeed less thn.00 s we wished! Just to emphsize how ccurte this is let us lso clculte the midpoint pproximte

FMN050 Spring 04. Clus Führer nd Alexndros Sopskis pge 45 integrl for n = 3 which is one less thn wht we should use! In tht cse we find using the midpoint formul tht the pproximte integrl is.99868. This gives n error of.99868.0 =.00. Which is not enough to put us in the rnge of.00 mximum error. Thus indeed n = 4 ws just right in order to produce n error less thn.00. Pseudo-code The most common composite integrtion rule used in prctice is ctully Simpson s. We therefore presented below the pseudo-code for composite Simpson s rule on n subintervls: Suppose tht we wish to pproximte the following integrl. Let h = (b )/n. Initilize the following vribles: f(x) dx I 0 = f() + f(b) I = 0 I = 0 3. For i =,..., n do the following Let X = + ih If i is even then I = I + f(x) If i is odd then I = I + f(x) 4. Let I = h 3 (I 0 + I + I ) 5. Qudrture is finished. Result is I.