Norwegin University of Science nd Technology Deprtment of Mthemticl Sciences Pge 1 of 5 Contct during the exm: Elen Celledoni, tlf. 73593541, cell phone 48238584 PLESE NOTE: this solution is for the students who hve prticipted to this yer exm nd cn not be divulged to third prties or used by third prties without the permission of the Deprtment of Mthemticl Sciences or the uthor Elen Celledoni Problem 1 ) Find the polynomil p Π 3, such tht p() = 1, p(1) = 1, p () = 1, p () =. Solution: the polynomil is p(x) = 3x 3 + x + 1. Problem 2 ) Let n 2. Show tht polynomil p 2 of degree 2n 1 cn be written p 2 (x) = (x )(b x)q 2n 3 (x) + r(x ) + s(b x), where q 2n 3 is polynomil of degree 2n 3, nd, b, r nd s re constnts. Hint. Observe tht the set of polynomils (x ), (b x), (x ) (b x) x k, k =,..., 2n 3, with nd b not simultneously equl to zero, is bsis for the vector spce of polynomils of degree less thn or equl to 2n 1. Solution: Using the given bsis ny polynomil p 2 (x) cn be written in the form 2n 3 p 2 (x) = b (x ) + b 1 (b x) + b k ((x ) (b x) x k), so the right hnd side of the equlity we hve to show is obtined for r = b, s = b 1 nd q 2n 3 (x) = k= 2n 3 k= b k x k, polynomil of degree less thn or equl to 2n 3.
TMA4215 Numericl Mthemtics Pge 2 of 5 b) Then construct the Lobtto qudrture formul w(x)f(x) dx W f() + W k f(x k ) + W n f(b), which is exct when f is polynomil of degree 2n 1. Here w(x) is positive weight function. Hint. One wy to solve this problem is by using the n 1 Guss qudrture points nd weights with respect to weight function w(x) w(x). Solution. The Lobtto qudrture formule hve the form W f() + W k f(x k ) + W n f(b), nd re exct for ll polynomils p 2 (x) of degree less thn or equl to 2n 1. We use the expression for p 2 obtined in the previous exercise. Observe tht p 2 () = s(b ) nd p 2 (b) = r(b ), then w(x)p 2 (x) dx = w(x)(x )(b x)q 2n 3 (x) dx+r(b )W +s(b )W n where W := (b ) 1 w(x)(x ) dx nd W n := (b ) 1 w(x)(b x) dx. We now choose x 1,..., x nd W 1,..., W to be the n 1 Guss qudrture nodes nd weights with respect to the positive weight function w(x) = (x )(b x)w(x), then the qudrture formul W kf(x k ) is exct for ll f = q 2n 3 polynomils of degree less thn or equl to 2n 3, nd we cn conclude tht w(x)p 2 (x) dx = W p 2 () + W k p 2 (x k ) + W n p 2 (b), is exct for ll polynomils of degree less thn or equl to 2n 1. c) Show tht ll the weights W k, k =, 1,..., n, re positive. Solution. By definition W nd W n re positive s they re obtined integrting positive functions. For W 1,..., W we use the well known result sying tht Guss qudrture weights re positive. Problem 3 ) We wnt to find the locl error σ n+1 of the trpezoidl rule method y n+1 = y n + 1 2 h(f(y n+1) + f(y n )),
TMA4215 Numericl Mthemtics Pge 3 of 5 for the numericl solution of the sclr initil vlue problem y (t) = f(y), with y() = y, nd where h = t n+1 t n. We use the following definition of the locl trunction error with z n+1 defined by σ n+1 = y(t n+1 ) z n+1, z n+1 = y(t n ) + 1 2 h(f(y(t n+1)) + f(y(t n ))), nd it is sufficient to investigte the cse n =. Explin how we obtin the following expression for σ 1 σ 1 := 1 2 (h x) x y (ξ(x)) dx, nd using the men vlue theorem for integrls or otherwise find σ 1 = 1 12 h3 y ( ξ), for some ξ in the intervl (, h), where y is the solution of the initil vlue problem. Solution. For the exct solution we hve nd z 1 cn be interpreted s y(t 1 ) = y + z 1 = y + f(y(x)) dx, g(x) dx where g(x) is the liner polynomil interpolting the vlues (, f(y )) nd (h, f(y(t 1 ))). Recll tht the error for such interpoltion polynomil is f(y(x)) g(x) = 1 2! d 2 f(y(x)) dx 2 x (x h) = 1 x= x 2! y (ξ(x)) x (x h), for x (, h) nd where ξ(x) = x. This yields the first given expression for σ 1. Since (h x) x is nonnegtive, by the men vlue theorem for integrls there exists ξ (, h) such tht σ 1 = 1 2 y ( ξ) (h x) x dx, nd the finl result is obtined by computing the integrl.
TMA4215 Numericl Mthemtics Pge 4 of 5 b) Suppose f stisfies the Lipschitz condition f(t, u) f(t, v) L u v, for ll rel t, u, v where L is positive constnt independent of t, nd tht y (t) M for some positive constnt M independent of t. Show tht the globl error e n = y(t n ) y n stisfies the inequlity e n+1 h3 M 12 + (1 + 1 2 hl) e n + 1 2 hl e n+1. Hint. Use tht e n+1 = y(t n+1 ) z n+1 +z n+1 y n+1 = σ n+1 +z n+1 y n+1. Solution. Using the Lipschitz condition we observe tht which substituted in z n+1 y n+1 e n + 1 2 hl e n+1 + 1 2 hl e n, e n+1 σ n+1 + z n+1 y n+1, nd together with σ n+1 h3 M 12, gives the desired result. c) For constnt step-size h > stisfying hl < 2, deduce tht, if y = y(), then [( e n h2 M 1 + 1 2 hl ) n 12L 1 1 2 hl 1]. Solution. Since 1 1 2hL >, from the result of the previous exercise we obtin ( 1 e n+1 1 1 2 hl (1 + 1 2 hl) e n + 1 ) 12 h3 M. Let us define Y := h3 M nd X := 1+ 1 12(1 1 2 hl 2 hl) 1 1 hl, so 2 e n Y + X e Y + XY + X 2 Y + + X Y, becuse e =, nd using the formul for the prtil sums of the geometric series e n Y Xn 1 X 1. Since (X 1) 1 = 1 1 2 hl hl one esily obtins the desired inequlity.
TMA4215 Numericl Mthemtics Pge 5 of 5 Formule nd useful results Prtil sums of the geometric series: for x, 1 + x + x 2 + + x m = 1 xm+1 1 x. Men vlue theorem for integrls. Let f(x) nd g(x) be continuous on [, b]. Assume tht g(x) is positive, i.e. g(x) for ny x [, b]. Then there exists c (, b) such tht f(t)g(t)dt = f(c) g(t)dt.