THE HANKEL MATRIX METHOD FOR GAUSSIAN QUADRATURE IN 1 AND 2 DIMENSIONS CARLOS SUERO, MAURICIO ALMANZAR CONTENTS 1 Introduction 1 2 Proof of Gussin Qudrture 6 3 Iterted 2-Dimensionl Gussin Qudrture 20 4 References 22 5 Experiments using Gussin Qudrture Rule on [, b] ppendix-1 6 Experiments using Gussin Qudrture Rule with non-stndrd Mesures ppendix-2 7 Experiments compring Gussin Qudrture, the Trpezoid Rule, And Simpson s Rule ppendix-3 8 Experiments using Gussin Qudrture Rule On Disjoint Intervls ppendix-4 9 Experiments using Iterted Gussin Qudrture Over A Rectngle [, b] [c, d] ppendix-5 1 Introduction The Fundmentl Theorem of Clculus llows one to compute the definite integrl of function over n intervl [, b] by using nti-derivtives Once the ntiderivtive of the function is found, then it is evluted t the end points of the intervl For exmple, suppose we hve continuous function f(x) on[, b] If F (x) isnntiderivtive of f(x), ie F (x) =f(x) for ll x in [, b], then f(x)dx = F (b) F () 0 This project ws crried out during the Spring, 2008 nd Summer I, 2008 semesters with Professor Lwrence A Filkow s the mentor During Spring, 2008 the project ws sponsored by SUNY/NSF Allince for Minority Prticiption t SUNY New Pltz The New Pltz AMP Director is Professor Stcie Nunes from the Deprtment of Physics During Summer I, 2008 the project ws sponsored under Ntionl Science Foundtion Grnt (number) The uthors thnk the sponsors for their support 1
For mny functions f(x) we re not ble to compute n nti-derivtive in closed form, so we cn t use the Fundmentl Theorem of Clculus For exmple f(x) =e x2 does not hve n nti-derivtive in closed form Insted, we will use numericl methods to estimte f(x)dx Gussin Qudrture is one such method The purpose of our reserch is to find wy of estimting complicted definite integrls using the Gussin Qudrture rule There re other numericl integrtion methods s well, like Simpson s rule nd the Trpezoid rule In some of the experiments, we will compre the efficiency of Gussin Qudrture to the efficiencies of Simpson s Rule nd the Trpezoid Rule The ide behind Gussin Qudrture is tht given n integer M =2n +1 > 0, we cn find points x 1 x n in [, b], nd positive weights w 1 w n,sotht (11) p(x)dx = p w i p(x i ) i=1 for every polynomil p(x) with deg p M Then, for ny continuous function f(x) on the intervl [, b], we cn pproximte the integrl f(x)dx by the Gussin Qudrture rule Q(f) := n i=1 w if(x i ), ie, (12) f(x)dx Q(f) = w i f(x i ) i=1 To explin why this pproch is effective, we hve to consider the Weierstrss Approximtion Theorem (WAT) This theorem sys tht given continuous function 2
f(x) on the intervl [, b] ndsmllɛ>0, we cn find polynomil p(x) sotht f(x) p(x) <ɛfor ll x in [, b] Butwelsohvetotkeintoccountthtto get the best results from (11) nd (12), the degree of the polynomil p(x) inwat must be less thn the chosen M for the Gussin Qudrture Rule If deg p > M, the pproximtion in (12) my not be stisfctory Our definition of Gussin Qudrture sys tht Q(f) = p i=1 w if(x i ) Wht the Weierstrss Approximtion Theorem suggests is tht Q(f) f(x)dx To see this, consider the error, (13) E := Q(f) f(x)dx For every polynomil p, we hve E = Q(f) Q(p)+Q(p) Q(f) Q(p) + Q(p) Now suppose tht deg p M Tht mens tht f(x)dx f(x)dx Q(p) = p(x)dx So, (14) Q(p) f(x)dx 3
= = p(x)dx f(x)dx (p(x) f(x))dx (15) p(x) f(x) dx If p(x) f(x) <ɛthroughout [, b], then the expression in (15) is t most = ɛdx, which is equl to ɛ(b ) So we hve (16) Q(p) f(x)dx ɛ(b ) Now let s consider Q(f) Q(p) Thisisequlto w i f(x i ) w i p(x i ) = w i (f(x i ) p(x i )) w i (f(x i ) p(x i ) w i ɛ = ɛ w i So we hve: = ɛ(b ) (since w i = Q(1) = 1dx = b ) (17) Q(f) Q(p) ɛ(b ) 4
Now we cn show tht the error (13) cn be mde smll, s follows Suppose we re given n intervl [, b], continuous function f(x) on[, b], ɛ>0,ndletp(x) be given by the Weierstrss Approximtion Theorem, ie p(x) f(x) <ɛ( x b) If we choose M deg p nd pply the Gussin Qudrture Rule using this M, then from (17) nd (14) we hve E = Q(f) f(x)dx is Q(f) Q(p) + Q(p) f(x)dx ɛ(b )+ɛ(b ) =2ɛ(b ), nd since ɛ is smll, E is lso smll Unfortuntely, for smll ɛ, deg p is often very lrge, so it is not prcticl to use Gussin Qudrture with M deg p Wht the experiments will show is tht strting with M = 1,sM increses we cn chieve 6 plce ccurcy in estimting f(x)dx by using firly smll vlues of M, though the smllest M tht gives 6 plce ccurcy depends on severl fctors, such s the intervl length b nd the complexity of f(x) 5
2 Proof of Gussin Qudrture We will derive n implementtion of Gussin Qudrture bsed on mtrix positivity nd Lgrnge interpoltion, s described in [HK, pge 115] Recll the following fcts bout integrls (21) (f(x)+g(x))dx = f(x)dx + g(x)dx (22) αf(x)dx = α f(x)dx The sme rules pply to Gussin Qudrture: (23) Q(f(x)+g(x)) = Q(f(x)) + Q(g(x)) (24) Q(αf(x)) = αq(f(x)) To prove (23), we hve Q(f(x)+g(x)) = = w i (f(x i )+g(x i )) (w i f(x i )+w i g(x i )) 6
= w i (f(x i )) + w i (g(x i )) = Q(f(x)) + Q(g(x)) The proof of (24) is similr Equtions (21) - (24) show tht it is enough to prove Gussin Qudrture for p(x) =x i (0 i M), ie, we must find points nd weights s in (11) such tht (25) β j := x j dx = Q(x j ):= w i x j i, (0 j M) Exmple 21 We will illustrte this reduction to monomils with p(x) = 0 + 1 x Applying (21) nd (22) we hve, ( o + 1 x)dx = 0 1dx+1 xdx If (25) holds, then the lst expression equls 0 Q(1) + 1 Q(x), nd by (23)-(24), this equls Q( 0 1+ 1 x), ie, ( 0 + 1 x)dx = Q( 0 + 1 x) Exmple 22 Throughout this section we shll illustrte the method of Gussin Qudrture in detil for the cse when m =3,n =1,ndtheintervlis[0, 1] We need to find points x 0,x 1 in [0, 1] nd positive weights w 0,w 1 such tht: 7
(26) β 0 := 1 = w 0 x 0 + w 1 x 1 (27) β 1 := 1/2 =w 0 x 0 + w 1 x 1 (28) β 2 := 1/3 =w 0 x 2 0 + w 1 x 2 1 (29) β 3 := 1/4 =w 0 x 3 0 + w 1 x 3 1 defined s In the sequel we will show how to solve (26)-(29) To estblish Gussin Qudrture we need to look t the Hnkel mtrix H H = β 0 β 1 β n β 1 β 2 β n+1 β 2 β 3 β n+2 β n β n+1 β 2n We will denote the columns of H by 1,t,, t n We lso will consider the vector v :=t n+1 =(β n+1,,β 2n+1 ) t 8
It is known tht H is positive nd invertible Tht mens H, > 0 whenever 0 Another wy to know tht the mtrix H is positive nd invertible is to show tht the nested determinnts of the corners re ll positive If H i is the i i upper left hnd corner of H, we must show tht det H i > 0(1 i n +1) Exmple 23 In our exmple, we hve H = 1 1/2 1/2 1/3 Then det(h 1 )= 1 nd det(h 2 )= 1/3 1/4 =1/12 > 0SoH>0 Since H is invertible, there is n unique vector =( 0,, n ) such tht (210) H = v, ie, = H 1 v, 9
or equivlently, (211) 0 β 0 + + n β n = β n+1 0 β 1 + + n β n+1 = β n+2 0 β n + + n β 2n = β 2n+1 So t n+1 = 0 1+ 1 t+ + n t n Nowletp(t) =t n+1 ( 0 1+ 1 t + + n t n ) Exmple 24 In our exmple, we hve 1 1/2 1/2 1/3 0 1 = 1/3 1/4 so 0 = 1/3 H 1 1 1/4 1/3 1/2 1/3 =12 1/2 1 1/4 nd we find 0 = 1/6, 1 =1 10
So we hve p(t) =t 2 ( 1/6+t) =t 2 t +1/6 It is known tht p(t) hs exctly n + 1 distinct rel roots in [, b] (see the proof of Proposition 33 nd Theorem 41 (iv) => (iii) in [CF] Denote these roots by x 0 x n Exmple 25 In our exmple, the roots of t 2 t +1/6 =0re t =1± 1 4(1)(1/6)/2 =1± (5/3)/2, so x 0 07886751346 nd x 1 002113248654 Note tht both x 0 nd x 1 re in [0, 1] Now let s look t the Vndermonde mtrix V defined s V = x 0 0 x 0 n x 1 0 x 1 n x n 0 x n n It is known tht becuse x 0,,x n re distinct, then V is invertible, ie, det(v ) 0[HK, pge 115] 11
Exmple 26 In our exmple, V = 1 1 x 0 x 1 So det(v )=x 1 x 0 0 Since V is invertible, there is n unique vector, ω := (ω 0 ω n ), such tht (212) Vω= β 0 β 1 β n, ie, (213) 1 1 x 0 x n x 0 2 x 2 n x n 0 x n n ω 0 ω n = β 0 β 1 β n 12
(213) is equivlent to the following system: (214) β 0 = ω 0 + + ω n (= Q(1)) β 1 = ω 0 x 0 + + ω n x n (= Q(x)) β n = ω 0 x n 0 + + ω n x n n (= Q(x n )) We clim tht x 0,,x n nd ω 0,,ω n solve the Gussin Qudrture system (25) Exmple 27 In the exmple we hve, 1 1 x 0 x 1 ω 0 ω 1 = β 0 β 1, or equivlently w 0 + w 1 = β 0, nd w 0 x 0 + w 1 x 1 = β 1, where w 0 0623893 nd w 1 0376107 The Gussin Qudrture system (25) is equivlent to the system of equtions in (214) together with the following system: 13
(215) β n+1 = ω 0 x n+1 0 + + ω n x n+1 n (= Q(x n+1 )) β n+2 = ω 0 x n+2 0 + + ω n x n+2 n (= Q(x n+2 )) = β 2n+1 = ω 0 x 2n+1 0 + + ω n x 2n+1 n (= Q(x 2n+1 )) Since (214) is stisfied from (213), we re going to focus on (215) Consider the first eqution of (215), β n+1 = ω 0 x n+1 0 + + ω n x n+1 n We hve β n+1 = x n+1 dx nd Q(x n+1 ) w i x n+1 i Since ech x i is root of t n+1 = 0 + 1 t + + n t n,wehve Q(x n+1 )= w i x n+1 i 14
= w i ( 0 1+ 1 x i + + n x n i ) = 0 wi + 1 wi x i + + n wi x n i = 0 β 0 + 1 β 1 + + n β n (by (214)) By the first eqution of (211), the lst expression is equl to β n+1, so we conclude tht (216) Q(x n+1 )=β n+1 For the second eqution of (215), we hve Q(x n+2 ) w i x n+2 i Since ech x i is root of t n+1 = 0 + 1 t + + n t n, x i is lso root of t n+2 = 0 t + + n t n+1 Sowehve Q(x n+2 )= w i x n+2 i = w i ( 0 x i + + n x n+1 i ) 15
= 0 wi x i + + n wi x n+1 i = 0 β 1 + + n β n+1 (by (214) nd (216)) By the second eqution of (211) the lst expression is equl to β n+2,sowe conclude tht (217) Q(x n+2 )=β n+2 Following the sme procedure, we re ble to prove the rest of the equtions in the set (215) This completes the proof tht the points x i,,x n nd the weights w i,,w n stisfy the Gussin Qudrture system (11) From the bove discussion, we hve distinct points x 0,,x n in [, b] nd weights w 0,,w n such tht (218) Q(p) := w i p(x i )= p(x)dx (deg p 2n +1) To complete the proof of Gussin Qudrture s in (11) we must still show tht ech w i > 0 In wht follows we will use Lgrnge polynomils to prove tht ech w i > 0 Lgrnge Interpoltion sys tht given distinct points x 0,,x n nd given numbers y 0,,y n there is unique polynomil p(x) withdeg p = n, such tht p(x i )=y i (0 i n) 16
Exmple 28 Consider Lgrnge Interpoltion with n=1 The Lgrnge polynomil of degree 1 such tht p(x 0 )=y 0 nd p(x 1 )=y 1 is (219) p 1 (x) := y 0(x x 1 ) (x 0 x 1 ) + y 1(x x 0 ) (x 1 x 0 ) The curve y = p(x) is the line connecting (x 0,y 0 )nd(x 1,y 1 ) The Lgrnge polynomil p 1 (x) in (219) is the bsis for the Trpezoidl Rule In this rule, we subdivide [, b] inton equl subintervls [x i,x i+1 ](0 i n + 1,x 0 =, x n = b) On intervl [x i,x i+1 ], we pproximte f(x) by the line connecting (x i,f(x i )) to (x i+1,f(x i+1 )); this line is the grph of the Lgrnge polynomil p 1 (x) such tht p 1 (x i )=y i := f(x i ) nd p 1 (x i+1 )=y i+1 := f(x i+1 ) We then pproximte x i+1 x i grph of p 1 between x i nd x i+1 : f(x)dx by the re of the trpezoid determined by the xi+1 x i f(x)dx 1 2 (x i+1 x i )(f(x i )+f(x i+1 )) Letting h = x i+1 x i (0 i n 1), we my express the Trpezoidl Rule by 17
(220) n 1 f(x)dx = h f( + ih)+h( f()+f(b) ) 2 i=1 Exmple 29 For n =2,wehvedistinctpointsx 0,x 1,x 2,ndvluesy 0,y 1,y 2 The Lgrnge polynomil p(x) looks like the following: (221) p 2 (x) := y 0(x x 1 )(x x 2 ) (x 0 x 1 )(x 0 x 2 ) + y 1(x x 0 )(x x 2 ) (x 1 x 0 )(x 1 x 2 ) + y 2(x x 0 )(x x 1 ) (x 2 x 0 )(x 2 x 1 ) The curve y = p 2 (x) is the unique prbol pssing through (x 0,y 0 ), (x 1,y 1 ), (x 2,y 2 ) The Lgrnge polynomil p 2 (x) in (221) is the bsis for Simpson s Rule In this rule, we pproximte y = f(x) by piecewise-prbolic curve y = g(x) on[, b], using p 2 (x) for ech piece of g(x) We cn then pproximte f(x)dx by g(x)dx Ifwe let the function f be tbulted t points x 0,x 1 nd x 2, eqully spced by distnce h, nd we let y i = f i := f(x i )(0 i 2), then Simpson s rule sys tht x2 x0 +2h x 0 f(x)dx = x0 +2h x 0 f(x)dx x 0 p 2 (x)dx = 1 3 h(f 0 +4f 1 + f 2 ) 18
If we use n double-intervls with eqully spced points x 0,x 1,,x 2n, then by using the bove method on ech double-intervl nd dding up, we get (222) f(x)dx h n 1 3 ( (2f( +2ih)+4f( +(2i +1)h)) + f(b) f()) The generl formul for the Lgrnge polynomil p(x) such tht p(x i )=y i (p i n) is cler from (219) nd (221) If q(x) is nother polynomil of deg n such tht q(x i )=y i (0 i n), then (p q)(x i )=0 Since deg p q n nd p q hs n +1 distinct roots, it follows tht p q = 0, ie p = q So there is unique Lgrnge polynomil of deg n Now we return to Gussin Qudrture, nd the clim tht ω i > 0(0 i n) We fix j nd we let p(x) p j (x) be the Lgrnge polynomil of degree n such tht p(x i )=0fori j nd p(x j )=1 Now consider q(x) =p(x) 2 Since deg q =2n (< 2n + 1), then from (218), (223) q(x)dx = w i q(x i ) Note tht q(x) 0nd q(x j )=1, so q(x)dx > 0 19
Therefore, 0 < q(x)dx = w i q(x i )=w j, so we conclude tht w j > 0(0 j n) This completes the proof of the Gussin Qudrture rule (11) 3 Iterted 2-Dimensionl Gussin Qudrture In 1-dimensionl Gussin Qudrture we showed tht given n>0nd n intervl [, b], there exist points x 0,,x n in [,b] nd positive weights ω 0,,ω n, such tht p(x)dx = n w ip(x i )(deg p 2n +1) Now we re going to use 1-dimensionl Gussin Qudrture to find rule tht works in two dimensions We re given rectngle in the plne, R =[, b] [c, d], nd continuous function f(x, y) onr We wnt to pproximte f(x, y)dxdy R Given n, letx 0,,x n, ω 0,,ω n be the Gussin Qudrture points nd weights for [, b], so (11) holds Let y 0,,y n, s 0,,s n be the Gussin Qudrture points nd weights for [c, d], so tht d c q(y)dy = s j q(y j )(deg q 2n +1) j=0 Now for function f(x, y), defined on rectngle R, let Q(f) := s j w i f(x i,y j ) j=0 20
For polynomil p(x, y), let p y (x) =p(x, y)( polynomil in x with y fixed), nd let p x (y) =p(x, y)( polynomil in y with x fixed) We re clming tht if p(x, y) is polynomil, with deg p y (x) 2n +1nd deg p x (y) 2n +1, then Q(p) = d p(x, y)dxdy( c R p(x, y)dxdy) If we fix x nd consider g(y) :=p x (y) =p(x, y), then deg g 2n +1, so which is the sme s d c g(y)dy = s j g(y j ), j=0 H(x) := d c p(x, y)dy = s j p(x, y j )( x b) j=0 So we hve d c p(x, y)dydx = = ( d j=0 p x (y)dydx = c s j p(x, y j ))dx H(x)dx = s j p(x, y j )dx (deg p(x, y j ) 2n +1) j=0 21
= j=0 s j w i p(x i,y j )= s j w i p(x i,y j ) j=0 = Q(p(x, y)) So Q(p) = R p(x, y)dxdy whenever deg p x(y) 2n +1 nd deg p y (x) 2n +1 For generl function f(x, y), tht is defined nd continuous on R, we my pproximte f(x, y)dxdy by Q(f) R In ppendix-5 we will illustrte this pproximtion with numericl exmples References [CF] RE Curto, LA Filkow, Recursiveness, positivity, nd truncted moment problems, Houston Journl of Mthemtics 17(1991), 603-635 [HK] Hoffmn, RKunze, Liner Algebr, Prentice-Hill, 1961 Deprtment of Computer Science, Stte University of New York, New Pltz, NY 12561, USA 22