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

Similar documents
Review of Calculus, cont d

APPROXIMATE INTEGRATION

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

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

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

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

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

Lecture 14: Quadrature

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

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)

INTRODUCTION TO INTEGRATION

Riemann Sums and Riemann Integrals

Riemann Sums and Riemann Integrals

MORE FUNCTION GRAPHING; OPTIMIZATION. (Last edited October 28, 2013 at 11:09pm.)

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

The Regulated and Riemann Integrals

Numerical Integration

1 The fundamental theorems of calculus.

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

7.2 The Definite Integral

Math 8 Winter 2015 Applications of Integration

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

1 The Riemann Integral

Lecture 19: Continuous Least Squares Approximation

Sections 5.2: The Definite Integral

Chapter 6 Notes, Larson/Hostetler 3e

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

Best Approximation. Chapter The General Case

Chapters 4 & 5 Integrals & Applications

Abstract inner product spaces

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

Numerical Analysis: Trapezoidal and Simpson s Rule

x = b a N. (13-1) The set of points used to subdivide the range [a, b] (see Fig. 13.1) is

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

Lecture 20: Numerical Integration III

Numerical Integration

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

6.5 Numerical Approximations of Definite Integrals

Lecture 1. Functional series. Pointwise and uniform convergence.

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

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

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

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

Math 131. Numerical Integration Larson Section 4.6

1 The Lagrange interpolation formula

1 The fundamental theorems of calculus.

Quadratic Forms. Quadratic Forms

Math& 152 Section Integration by Parts

Review of basic calculus

The final exam will take place on Friday May 11th from 8am 11am in Evans room 60.

Polynomials and Division Theory

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

Main topics for the First Midterm

Overview of Calculus I

MATH 144: Business Calculus Final Review

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

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

Section 6.1 Definite Integral

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019

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

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

Chapter 5. Numerical Integration

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

NUMERICAL INTEGRATION

38 Riemann sums and existence of the definite integral.

Recitation 3: More Applications of the Derivative

An Overview of Integration

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

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

4.4 Areas, Integrals and Antiderivatives

Theoretical foundations of Gaussian quadrature

Math 113 Exam 2 Practice

Numerical integration

1.9 C 2 inner variations

Polynomial Approximations for the Natural Logarithm and Arctangent Functions. Math 230

AP Calculus Multiple Choice: BC Edition Solutions

Lecture 23: Interpolatory Quadrature

Midpoint Approximation

Improper Integrals, and Differential Equations

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?

Math 360: A primitive integral and elementary functions

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

Discrete Least-squares Approximations

The practical version

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

MATH , Calculus 2, Fall 2018

Interpreting Integrals and the Fundamental Theorem

MA123, Chapter 10: Formulas for integrals: integrals, antiderivatives, and the Fundamental Theorem of Calculus (pp.

31.2. Numerical Integration. Introduction. Prerequisites. Learning Outcomes

Section 6.1 INTRO to LAPLACE TRANSFORMS

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

Distance And Velocity

!0 f(x)dx + lim!0 f(x)dx. The latter is sometimes also referred to as improper integrals of the. k=1 k p converges for p>1 and diverges otherwise.

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

Best Approximation in the 2-norm

Math 426: Probability Final Exam Practice

The Fundamental Theorem of Calculus

Orthogonal Polynomials

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

New Expansion and Infinite Series

Transcription:

Mth B, lecture 4: Error bounds for numericl methods Nthn Pflueger 4 September 0 Introduction The five numericl methods descried in the previous lecture ll operte by the sme principle: they pproximte the integrl f(x)dx by dividing the intervl [, b] into n slices of equl width, nd pproximte the re under the curve in ech slice by ssuming tht the curve hs certin shpe (flt, liner, or qudrtic), nd pproximting the re by wht the re would be in this cse. Using ny of these numericl methods, it is necessry to understnd the error tht my result from these ssumptions. This lecture presents method for computing bounds on the error of ech numericl method. The objective of this topic is not tht you should remember these error bounds fter the course; in prctice, ny time you need to the vlue of n integrl, you will use mchine tht implements these methods (or even more sophisticted methods which we do not discuss). Rther, the objective is to fmilirize you with how these methods work, so tht you will be wre of the bsic qulittive spects of the methods tht mchines use. Furthermore, we wish to emphsize tht n pproximtion is useless without knowledge of its possible error, so tht you will lwys remember to demnd error bounds whenever you use pproximte methods. As secondry objective, we wish to use these methods nd their error bounds to illustrte how polynomils re, in some sense, the fundmentl functions in clculus; ech of these numericl methods hs the feture tht it is exct for polynomils of certin degree, nd its error cn be found by considering polynomils of higher degree. The bsic philosophy tht function cn be understood by mens of the polynomils it resembles is centrl feture of clculus, which will be mde especilly vivid by the development of Tylor series in couple weeks. The reding for tody is Gottlieb 6.. The homework is to do problems, 3, 4, 5 from 6., s well s Topic Outline. Summry of results We first recll the definitions of the five numericl methods discussed lst time. integrl: We re evluting the f(x)dx. In order to do this, divide the intervl [, b] on which the integrl is being computed into n pieces (where n cn be chosen to be nything), thus dividing the vlue of the integrl into n slices, with endpoints x 0, x,..., x n, s shown.

f(x)dx = = ( re under the curve in the k th slice ) k= xk k= x k f(x)dx Here we mke the following definitions. x 0 = x n = b x = (b )/n x k = + k x Thus [x 0, x ] is the intervl corresponding to the first slice, [x, x ] corresponds to the seconds slice, nd in generl [x k, x k ] corresponds to the k th slice. Using this nottion, the five numericl methods tht we consider cn be summrized s follows. Left pproximtion L n = Right pproximtion R n = Midpoint pproximtion M n = f(x k ) x k= f(x k ) x k= ( ) xk + x k f x k= Trpezoid pproximtion T n = (L n + R n ) = k= k= [f(x k ) + f(x k )] x Simpson s rule S n = 3 M n + 3 T n [ = f(x k + 4f 6 ( xk + x k ) ] + f(x k ) x Note tht both the trpezoid pproximtion nd Simpson s rule cn be defined either in terms of erlier pproximtions or directly in terms of vlues of the function f. Note lso tht ech pproximtion is sum of estimtes for individul slices, ech of which consists of the width of the slice times n estimte for the verge vlue of f on tht slice. The estimte for this verge vlue depends on the ssumed shpe of the function on the slice. The error bounds which we present will include constnt fctor determined by the size of some derivtive of f(x). We shll use the following nottion. The symbol M is clled Gothic M, or Germn M. It is frequently used by mthemticins in situtions where the ordinry letter M would be mbiguous, s it certinly would be here.

M = mx { f (x) : x in [, b]} M = mx { f (x) : x in [, b]} { } M 4 = mx f (4) (x) : x in [, b] Using this nottion, the error bounds tht we shll use re expressed by the following theorem (which will not be proved in clss). Theorem.. If the integrl f(x)dx is pproximted using the methods bove, then the following bounds hold. L n f(x)dx ( M (b ) /n = ) M ( x) n R n f(x)dx ( M (b ) /n = ) M ( x) n M n f(x)dx 4 M (b ) 3 /n (= ) 4 M ( x) 3 n T n f(x)dx M (b ) 3 /n (= ) M ( x) 3 n ( S n f(x)dx 80 M 4(b ) 5 /(n) 4 = ) 80 M 4( x/) 5 n The expressions in prentheses re included simply to show how much ech of the n slices contributes to the totl error of the pproximtion. The proof of the first two bounds is not difficult; we will sketch the rgument in section 4. The ltter three bounds re somewht more technicl, nd require the use of integrtion by prts. The prticulr forms of these bounds re not importnt (nd you will lmost certinly forget them fter the exm). However, the following fetures re importnt. The error terms hve constnt fctors coming from the mximum vlue of some derivtive of f(x). The better the pproximtion, the higher the derivtive which governs the error. The error bound shrinks s n grows. The better the pproximtion, the fster the error bound will shrink. Theorem., together with the qulittive descriptions discusses in the lst lecture, re summrized in the following tble. Remember tht the conditions under the columns overestimtes nd underestimtes must hold t ll points in the intervl [, b] in order to conclude whether the method gives n overestimte or underestimte. Method Overestimtes Underestimtes Error bound Left L n f (x) < 0 f (x) > 0 M (b ) /n Right R n f (x) > 0 f (x) < 0 M (b ) /n Midpoint M n f (x) < 0 f (x) > 0 4 M (b ) 3 /n Trpezoid T n f (x) > 0 f (x) < 0 M (b ) 3 /n Simpson S n f (4) (x) > 0 f (4) (x) < 0 80 M 4(b ) 5 /(n) 4 3

3 Exmples Exmple 3.. How ccurte will Simpson s rule be for n slices be in computing 0 x3 dx? The error bound is 80 M 4(b ) 5 /(n) 4. For this prticulr function, the fourth derivtive is 0, nd therefore M 4 = 0. Therefore the error bound is 0, no mtter which n is used. So Simpson s rule should be exctly correct for this integrl. This my seem too good to be true, so here is computtion, for n = (i.e. computtion of S ). By definition of Simpson s rule, S 4 = 6 (03 + 4 3 + 3 ) = (0 + 4 + 8) 6 = 4. Indeed, the stndrd clcultion shows tht 0 x3 dx = 4. Exmple 3.. Consider the integrl 0 e x dx. Determine sufficient number of slices for the midpoint pproximtion to be ccurte within 0.00. The error bound for M n is 4 M (b ) 3 /n. Since the length of the intervl is (b ) =, this is equl to 3 M /n in this cse. We need to select n n lrge enough tht this bound is no more tht 0.00, i.e. 000 3 M. So we simply need to find M. such tht 3 M /n 0.00. Equivlently, n 000 3 M, or n In fct, it is not necessry to find M exctly; n upper bound on M will do. To find such n upper bound, begin by computing derivtives of the function (detils of the computtion re omitted). f(x) = e x f (x) = ( x)e x f (x) = (4x )e x It would be hssle to ctully explicitly find the mximum of this second derivtive, so simply get n upper bound. For this purpose, observe tht for ll x, x 0, hence e x e 0 =. Therefore f (x) = (4x )e x 4x. Now, the function 4x is n incresing function on [0, ], with vlues rnging from to 4. Thus n upper bound on its size is 4. Tken together, this implies tht f (x) 4 on [0, ], nd thus M 4. Now, since this is n upper bound on M, if we cn ensure tht n 000 000 hve tht n 3 M, nd in turn tht the error of M n is less thn 0.00. Now 69 slices will be sufficient to ensure error of less thn 0.00 for the midpoint pproximtion. 3 4, then we will certinly 000 3 4 68.3. Thus Exmple 3.3. Consider the integrl dx x, whose exct vlue is equl to ln. Numericl methods give one wy to clculte this vlue to rbitrry ccurcy (better methods will come from the notion of Tylor series). How mny slices re needed in order to compute this integrl with error t most one millionth (tht is, 0 6 ), using the five numericl methods discussed? To begin, we need the mximum vlues M, M nd M 4, for which we need the derivtives of the function. 4

f(x) = /x f (x) = /x f (x) = /x 3 f (x) = 6/x 4 f (4) (x) = 4/x 5 Ech of these functions decrese in mgnitude s x increses, so ll of them hve mximum bsolute vlue t x =. From this we obtin the following vlues. M = M = M 4 = 4 From this, s well s the fct tht the length of the intervl is (b ) =, the following bounds for the error of ech pproximtion cn be found. L n ln M (b ) /n = n R n ln M (b ) /n = n M n ln 4 M (b ) 3 /n = n T n ln M (b ) 3 /n = 6n S n ln 80 M 4(b ) 5 /(n) 4 = 0n 4 Now, observe tht n 0 6 n 500, 000, thus 500, 000 slices will ensure tht L n nd R n re both within 0 6 of the true vlue. For the midpoint pproximtion, n 0 6 n 0 6 / n 0 6 / 88.7. So 89 slices will ensure tht M n is within 0 6 of the true vlue. For the trpezoid pproximtion, 6n 0 6 n 0 6 /6 n 0 6 /6 408.. So 409 slices will ensure tht T n is within 0 6 of the true vlue. For Simpson s rule, 0n 0 6 n 4 0 6 /0 n 4 0 6 /0 9.6. So 0 slices will ensure tht 4 S n is within 0 6 of the true vlue. As this result indictes, the error bounds gurntee much fster convergence for Simpson s rule thn the less sophisticted pproximtions. In fct, explicit computtion revels tht, in order to chieve error of less thn one millionth, only 7 slices re needed for Simpson (the bounds ensure tht 0 will work), 77 slices re needed for midpoint pproximtion (the bounds ensure tht 89 will work), nd 50 slices re needed for trpezoid pproximtion (the bounds ensure tht 409 will work). This illustrtes the fct tht the error bounds, while obviously not exct, give good rough ide for how mny slices re needed to chieve desired ccurcy of computtion. 5

4 Error of L n nd R n In order to understnd the error bound for left nd right pproximtion, we begin by considering the error of these pproximtions in the specil cse where f(x) is liner function, with slope m. Tht is, f (x) = m for ll x, where m is constnt. Then we cn see the error of the left pproximtion L n in the following picture. The left pproximtions L n undershoots the re of ech slice by precisely the re of one of the shdes tringles. Observe tht the bse of ech tringle is equl to the width of the slice, nmely x, nd the height must be equl to m x (where m is the slope of the function, i.e. the constnt vlue of its first derivtive). Therefore the re of ech shded tringle is ( x)(m x) = m( x). Since there re n such tringles, the totl error is precisely n m( x) = mn ( b n ) = m (b ) n. Becuse m is the vlue of f (x) t every point, m is equl to the vlue M, nd so in fct the error is precisely equl to the bound M (b ) n. Now suppose tht f(x) is ny function, not necessrily liner. Then lthough we cn no longer view the error s the res of right tringles, essentilly the sme technique will pply: since the function never grows t rte fster thn M, the error of pproximtion in ech slice is still bounded by the re of tringle with bse x nd height M x. A complete proof of the error bound cn be given by using the men vlue theorem; we omit the detils. The result is, s stted in section, b f(x)dx L n M (b ) /n. 5 Error of M n nd T n In this section, we give only rough sketch of the principles behind the error bounds for M n nd T n. To give complete detils would require somewht more technicl nottion thn seems pproprite t the moment. Consider the following imge, depicting the error of both the midpoint pproximtion nd trpezoid pproximtion on single slice. 6

Wht cn mke these errors s lrge s possible? First of ll, if f is liner in this slice, then both errors will be 0. So the error is governed by the second derivtive. The lrgest possible error will result when the function begins, t the lest end of the slice, by incresing (respectively, decresing) very quickly, turns round in the middle, nd then decreses (respectively, increses) rpidly to the other endpoint. Such behvior involves drmtic chnge in the first derivtive, i.e. lrge second derivtive. Upon formlizing this rough ide nd doing some (not entirely trivil) computtion, the following result cn be obtined. error in single slice for M n 4 M ( x) 3 error in single slice for T n M ( x) 3 Replcing x by (b )/n s usul, nd multiplying by n (since there re n slices, ech contributing some error) gives the error bounds from section. The get n ide for where the constnts 4 nd come from, you my evlute the error in the cse of qudrtic function, where these error bounds re exct. From this it follows (mong other things), the clssicl fct (known to the Greeks by much more elementry methods) tht the re of prbolic segment is equl to 3 of the bse times the height. 7