Lecture 14: Quadrature

Similar documents
Numerical Integration

Numerical Analysis: Trapezoidal and Simpson s Rule

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

Review of Calculus, cont d

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

Math& 152 Section Integration by Parts

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

Lecture 19: Continuous Least Squares Approximation

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

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

NUMERICAL INTEGRATION

COT4501 Spring Homework VII

Numerical quadrature based on interpolating functions: A MATLAB implementation

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

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

APPROXIMATE INTEGRATION

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

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

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

Lecture 20: Numerical Integration III

Matrices, Moments and Quadrature, cont d

Theoretical foundations of Gaussian quadrature

Chapter 3 Polynomials

The Regulated and Riemann Integrals

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

Numerical Integration

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

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

6.5 Numerical Approximations of Definite Integrals

1 The Riemann Integral

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

Numerical integration

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

3.4 Numerical integration

Improper Integrals. Type I Improper Integrals How do we evaluate an integral such as

Section 6.1 Definite Integral

Lecture 12: Numerical Quadrature

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

Math 8 Winter 2015 Applications of Integration

f(x) dx, If one of these two conditions is not met, we call the integral improper. Our usual definition for the value for the definite integral

Review of basic calculus

Construction of Gauss Quadrature Rules

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

Discrete Least-squares Approximations

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

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

Abstract inner product spaces

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

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

Orthogonal Polynomials and Least-Squares Approximations to Functions

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

7.2 The Definite Integral

Definite integral. Mathematics FRDIS MENDELU

We know that if f is a continuous nonnegative function on the interval [a, b], then b

1 The Lagrange interpolation formula

8 Laplace s Method and Local Limit Theorems

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

Lecture 23: Interpolatory Quadrature

The Riemann Integral

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

New Expansion and Infinite Series

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)

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

c n φ n (x), 0 < x < L, (1) n=1

Calculus II: Integrations and Series

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

LECTURE. INTEGRATION AND ANTIDERIVATIVE.

AN INTEGRAL INEQUALITY FOR CONVEX FUNCTIONS AND APPLICATIONS IN NUMERICAL INTEGRATION

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

Section 7.1 Integration by Substitution

Best Approximation. Chapter The General Case

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

Math 131. Numerical Integration Larson Section 4.6

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

QUADRATURE is an old-fashioned word that refers to

ODE: Existence and Uniqueness of a Solution

Tangent Line and Tangent Plane Approximations of Definite Integral

Chapter 5. Numerical Integration

Best Approximation in the 2-norm

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

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

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

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

1 Part II: Numerical Integration

Lecture 14 Numerical integration: advanced topics

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

Anti-derivatives/Indefinite Integrals of Basic Functions

Lab 11 Approximate 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?

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

Lecture 4: Piecewise Cubic Interpolation

1 Error Analysis of Simple Rules for Numerical Integration

MAA 4212 Improper Integrals

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

MAT 772: Numerical Analysis. James V. Lambers

Calculus I-II Review Sheet

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

Reversing the Chain Rule. As we have seen from the Second Fundamental Theorem ( 4.3), the easiest way to evaluate an integral b

1 The fundamental theorems of calculus.

Transcription:

Lecture 14: Qudrture This lecture is concerned with the evlution of integrls fx)dx 1) over finite intervl [, b] The integrnd fx) is ssumed to be rel-vlues nd smooth The pproximtion of n integrl by numericl method is commonly referred to s qudrture In Clculus one discusses mny techniques for determining n ntiderivtive of fx) The integrl is then computed by evluting the ntiderivtive t the endpoints of the intervl However, mny integrnds of interest in science nd engineering do not hve known ntiderivtive Moreover, in some pplictions the integrnd is only known t few points in the intervl We would like to be ble to determine ccurte pproximtions of integrls lso in these situtions We will pproximte integrls 1) by sums fx j )w j ) These sums re referred to s qudrture rules The x j re the nodes nd the w j the weights of the qudrture rule We re interested in determining weights so tht the qudrture rules gives ccurte pproximtions of the integrl 1 for lrge clsses of integrnds fx) The nodes often cnnot be chosen freely, becuse the integrnd my only be known t certin points For instnce, the function fx) might not be explicitly known, only mesured vlues fx j ) t the nodes x j my be vilble We remrk tht you lredy encountered the pproximtion of integrls by sums in Clculus There, however, one ws less concerned with how smll the error E N f) = fx)dx fx j )w j 3) is for smll vlues of N; it ws sufficient tht the error E N f) converged to zero s N incresed to infinity In this lecture, we would like the error E N f) to be smll lredy for smll to modest number of terms N in the qudrture rule ) Method of undetermined coefficients Let the nodes x j, 1 j N, be given Throughout this lecture the nodes will be ordered so tht x 1 < x < < x N b 4) We would like to determine the weights w j so tht qudrture rule is exct for polynomils of s high degree s possible, ie, we would like the weights be such tht px)dx = for ll polynomils px) of s high degree s possible px j )w j 5) 1

The powers {1, x, x, x 3, } form bsis for polynomils Our objective therefore cn be expressed s follows: We would like the equlity 5) to hold for s mny powers px) = x j, j =, 1,,, s possible This requirement gives rise to the liner system of equtions for the weights, px) = 1 : w 1 + w + + w N = px) = x : x 1 w 1 + x w + + x N w N = px) = x : x 1w 1 + x w + + x N w N = px) = x N 1 : x N 1 1 w 1 + x N 1 w + + w N x N 1 N This system conveniently cn be expressed in the form 1 1 1 x 1 x x N x N 1 1 x N 1 x N 1 N w 1 w w N = dx = b, xdx = 1 b ), x 1 dx = 3 b3 3 ), = xn 1 dx = 1 N bn N ) b 1 b ) 1 N bn N ) 6) 7) We recognize the mtrix s the trnspose of Vndermonde mtrix Vndermonde mtrices were encountered in the fll semester in connection with polynomil interpoltion, when we showed tht Vndermonde mtrices determined by distinct nodes re nonsingulr Determinnts re invrint under trnsposition This follows from the fct tht determinnts cn be expnded either by rows or by columns We conclude tht the mtrix in 7) is nonsingulr when the nodes x j re distinct Hence the bove liner system of equtions hs unique solution Thus, given n distinct nodes, we cn determine n unique weights w j, such tht the qudrture rule ) integrtes ll polynomils of degree strictly less thn n exctly Exmple 1 Consider the midpoint qudrture rule fx)dx fx 1 )w 1, x 1 = 1 + b) We only hve one weight to determine The liner system of equtions 6) reduces to px) = 1 : w 1 = dx = b This determines the weight w 1 Exmple Apply the midpoint rule to integrte the function fx) = exp 1 x/) ) 8) on the intervl [, 1] The midpoint rule pproximtes the integrnd by the constnt function f1/) = exp 7/8) on the intervl [, b] nd integrtes the ltter function exctly The blue grph of Figure 1 shows fx) nd the vlue of the integrl is the re below this grph The dshed red line displyes the constnt function tht is integrted exctly by the midpoint rule The vlue determined by the midpoint rule is the re below the dshed red line Sometimes N-node qudrture rules determined by solving the liner system of equtions 7) lso integrte powers x k for k N exctly The following exmple illustrtes this

75 7 65 6 55 5 45 4 35 1 3 4 5 6 7 8 9 1 Figure 1: Integrnd of Exmple nd pproximtion used by the midpoint rule Exmple 3 Consider the midpoint qudrture rule of Exmple 1 Appliction of this rule to fx) = x yields x 1 w 1 = 1 + b)b ) = 1 b ) The right-hnd side equls xdx, ie, the midpoint rule integrtes not only constnts but lso liner polynomils exctly Exercise 1 Determine the weights of the -node qudrture rule fx)dx fx 1 )w 1 + fx )w, x 1 =, x = b This rule is known s the trpezoidl rule By construction, it integrtes liner polynomils exctly Does it integrte polynomils of higher degree exctly? Justify your nswer Exercise Determine the weights of the 3-node qudrture rule 1 fx)dx fx 1 )w 1 + fx )w + fx 3 )w 3, x 1 =, x = 1/, x 3 = 1 This rule is known s Simpson s rule It integrtes qudrtic polynomils exctly by construction Does it integrte polynomils of higher degree exctly? Justify your nswer Wht is the nlogous qudrture rule for the intervl [1, ]? Hint: Do not recompute the qudrture rule, just mke chnge of vribles Integrting Lgrnge polynomils When discussing polynomil interpoltion lst fll, we considered different polynomil bses, such s monomils, Lgrnge polynomils, nd Newton polynomils We cn lso in the present context use bses different 3

from the monomil one For instnce, the nodes x 1, x,,x N determine the Lgrnge polynomils l k x) = N j k x x j x k x j, k = 1,,, N, 9) which form bsis for ll polynomils of degree t most N 1 We therefore my require tht n N-node qudrture rule integrtes the Lgrnge polynomils 9) exctly Substituting px) = l k x) into 5) yields l k x)dx = l k x j )w j = l k x k )w k = w k, k = 1,,,N, where the simplifictions of the right-hnd side follow from the fct tht { 1, k = j, l k x j ) =, k j Thus, the weights cn be obtined by integrting the Lgrnge polynomils However, the evlution of these integrls is tedious unless N is smll Composite qudrture rules nd Tylor expnsion Assume tht the midpoint rule of Exmple does not yield sufficiently ccurte pproximtion of the integrl We my then subdivide the intervl [, 1] into subintervls nd pply the midpoint rule on ech subintervl This defines the composite midpoint rule 75 7 65 6 55 5 45 4 35 1 3 4 5 6 7 8 9 1 Figure : Integrnd of Exmple 4 nd pproximtion used by the composite midpoint rule obtined by dividing the intervl [, 1] into two subintervls of equl length 4

Exmple 4 Divide the intervl [, 1] into the subintervls [, 1/] nd [1/, 1] nd pply the midpoint rule on ech subintervl to the integrnd fx) defined by 8) This yields the composite midpoint rule 1 fx)dx fx 1 )w 1 + fx )w with x 1 = 1/4, x = 3/4, nd w 1 = w = 1/ The integrl is pproximted by the re below the dshed curve of Figure Compring the grphs of Figures 1 nd suggests tht subdivision of the intervl should increse the ccurcy of the computed pproximtion While the computtion of the weights by solving the liner system of equtions 7) is esily done in MATLAB or Octve, this pproch does not shed ny light on how the error behves when we increse the number of nodes Further insight on the behvior of qudrture rules cn be gined by expnding the integrnd into Tylor series Consider the pproximtion of the integrl fx)dx by the midpoint rule nd use the Tylor expnsion of fx) t x = h/ Here x h/ should be thought of s firly smll, nd we ssume tht fx) is continuously differentible s mny times s required Then ) ) h h fx) = f + f x h ) + f ) h! x h ) + f ) h x h 3! Integrting the left-hnd nd right-hnd sides from to h yields ) h ) h fx)dx = f dx + f x h + f ) h x h ) 3 dx + f ) h 3! 4! ) dx + f h! ) 3 + f ) h x h 4 + 4! ) ) x h ) 4 dx + x h ) dx The integrl over odd powers of x h/ vnishes due to symmetry The right-hnd side therefore simplifies to ) h fx)dx = f h + f ) h x h ) dx + f ) h x h 4 dx +! 4! ) ) h = f h + f ) h h 3 + f ) h h 5 + 1 8 The midpoint rule pplied to the integrl on the left-hnd side gives the first term in the right-hnd side The remining terms express the qudrture error Hence, this error is given by ) h fx)dx f h = f ) h h 3 + f ) h h 5 + 1) 1 8 Since ll derivtives of order nd higher of liner function vnish, the right-hnd side vnishes for such functions It follows tht the midpoint rule is exct for liner functions We know this lredy, nd here it is consequence of the expnsion of the integrl in powers of h Exercise 3 Use Tylor expnsions round x = nd x = h to determine how the pproximtion of the integrl fx)dx determined by the trpezoidl rule depends on h Thus, express the qudrture error fx)dx h f) + fh)) 5

s function of h in similrly mnner s 1) Consider the pproximtion of the integrl 1) by the N-point composite midpoint rule with the nodes nd weights x j = + j 1 ) h, h = b N 1, w j = h, j = 1,,,N 11) Thus, the qudrture rule is given by M h f) = h fx j ) Anlogously to 1), we obtin for ech subintervl [x j h/, x j + h/] of length h the expression xj+h/ x j h/ nd summing over j = 1,,,N yields fx) M h f) = fx)dx fx j )h = f x j ) h 3 +, 1) 1 f x j ) h 3 + = 1 1 N f x j ) Nh3 1 + 13) The verge of the second derivtive vlues 1 N N f x j ) is not smller thn the smllest of the vlues f x j ) Similrly, the verge is not lrger thn lrgest of the vlues f x j ) This is expressed by the inequlities min 1 j N f x j ) 1 N f x j ) mx 1 j N f x j ) We ssumed f x) to be continuous Therefore there is vlue ξ in [, b], such tht f ξ) = 1 N f x j ) Substituting this expression into the right-hnd side of 13) yields Multiplying the expression for h in 11) by the denomintor gives fx) M h f) = f ξ) Nh3 1 + 14) which when substituted into 14) yields Nh = b + h, fx) M h f) = f ξ) b 1 h + 15) The right-hnd side indictes tht we cn expect the error to decrese by fctor 4 when h is hlved nd the number of nodes x j is doubled) 6

Generlly, one does not know in dvnce how mny nodes to use in order to chieve desired ccurcy We therefore my be interested in hlving h until consecutive pproximtions M h f), M h/ f), M h/4 f),, of the integrl do not vry much when h is further reduced Exercise 4 In pplictions with complicted functions, the evlution of the function vlues my dominte the rithmetic work required to evlute qudrture rules The computtion of M h f) requires the evlution of N function vlues How mny of these function vlues cn be used gin when evluting M h/ f)? Exercise 5 Consider the N-point composite trpezoidl rule for the pproximtion of 1), 1 T h f) = h fx 1) + fx ) + fx 3 ) + + fx N 1 ) + 1 ) fx N) with ) Use the representtion x j = + j 1)h, T h f) = N 1 h = b, j = 1,,, N N 1 h fx j) + fx j+1 )) nd the result of Exercise 3 to determine n expnsion of the qudrture error similr to 13) b) Wht is the nlog of formul 15)? How much is the error reduced when h is hlved? c) Assume tht T h f) hs been evluted, nd we would like to compute T h/ f) How mny dditionl function evlutions re required? Singulr integrnds, infinite intervls, nd dptive qudrture rules The composite midpoint nd trpezoidl rules cn be used lso for functions tht re not twice continuously differentible However, the error then my converge to zero slower when h is reduced nd mny nodes might be required to give smll qudrture error We discuss n pproch to remedy this sitution Consider the evlution of the integrl 1 fx) lnx)dx 16) where fx) is ssumed to be smooth function We note tht the trpezoidl rule cnnot be used since the integrnd is infinite t x = Nevertheless, the integrl exists for mny smooth functions fx) We therefore my consider using composite midpoint rule; see Exercise 6 Alterntively, the method of undetermined coefficients cn be pplied to the function fx) only Thus, we would like to determine qudrture rule of the form fx j )w j with given nodes, nd we seek to determine weights w j so tht the reltion px) lnx)dx = px j )w j 17) 7

holds for ll polynomils of s high degree s possible This yields the liner system of equtions, which is nlogous to 6), px) = 1 : w 1 + w + + w N = px) = x : x 1 w 1 + x w + + x N w N = px) = x : x 1w 1 + x w + + x N w N = px) = x N 1 : x N 1 1 w 1 + x N 1 w + + w N x N 1 N lnx)dx, b xlnx)dx, b x lnx)dx, = xn 1 lnx)dx The right-hnd side expressions cn be evluted by integrtion by prts Note tht the lloction of nodes x j is quite rbitrry; in prticulr, we my put node t the origin Exercise 6 Compute n pproximtion of 16) with fx) = expx ) by the -node composite midpoint rule Use the MATLAB function qud to determine the exct vlue Note tht the MATLAB function for the integrnd hs to written to llow vector rguments, eg, f=expx^)*logx); How lrge is the error? The MATLAB function qud pplies composite Simpson rule The MATLAB function qud is n exmple of n dptive qudrture rule Adptive rules re composite rules tht estimte the qudrture error by compring the result obtined with different mesh sizes h New nodes re llocted in subintervls [x j, x j+1 ] in which the qudrture error is deemed to be lrger thn prescribed tolernce Exercise 7 Determine -point qudrture rule with the sme nodes s in Exercise 6 by solving liner system of equtions of the form 18) Apply it to the function fx) of Exercise 6 Is this rule more ccurte thn the one in Exmple 6? Exercise 8 Evlute the integrl exp x 3 )dx with t lest 5 correct deciml digits using the MATLAB function qud This function requires the intervl of integrtion to be finite Therefore the integrl hs to be split, exp x 3 )dx = c exp x 3 )dx + c exp x 3 )dx, where the constnt c > is chosen lrge enough so tht the second integrl cn be neglected nd the first integrl is evluted with the function qud For instnce, we my choose c lrge enough so tht c exp x 3 )dx 5 1 6 Determine such vlue of c nd justify your choice The error bound for the integrl evluted with qud then should not be lrger thn 5 1 6 In this lecture, we hve fixed the nodes nd then determined the weights so tht we integrte polynomils of s high degree s possible A clever choice of nodes s well s weights in n N-point qudrture rule mkes it possible to integrte polynomils of degree up to N 1 exctly The midpoint rule is n exmple These rules re known s Gussin qudrture rules The nodes nd weights generlly re not known in closed form, but they cn be computed quite efficiently by solving n eigenvlue problem symmetric N N tridigonl mtrix This is often done with the QR-lgorithm or modifiction thereof 18) 8