You are on page 1of 171
Instructor's Solution Manual for Numerical Methods: Using MATLAB John H. Mathews and Kurtis D. Fink August 2002 Contents 1. Preliminaries 11 Review of Calenlus 1.2. Binary Numbers 13. Error Analysis 2 The Solution of Nonlinear Equations (2) = 0 2.1 Iteration for Solving z= g(x). . 3 2.2. Bracketing Methods for Locating a Root 2.3. Initial Approximation and Convergence Criteria 24 Raphson and Sccant Methocs 25 u's and Muller's Methods 3 The Solution of Linear Systems AX = B 3.1 Introduetion to Vectors and Matrices 3.2 Properties of Vectors and Matrices 3.3 Upper-Triangular Linear Systems 34 Gaussian Elimination and Pivoting 3.5 Triangular Factorization . 3.6 Iterative Methods for Linear Systems 3.7 Iteration for Nonlinear Systems 4 Interpolation and Polynomial Approximation 4.1 Taylor Series and Calculation of Functions 4.2 Introduction to Interpolation 4.3 Lagrange Approximation 4.4 Newton Polynomials : 4.5 Chebyshev Polynomials (Optional) 4.6 Padé Approximations 5 Curve Fitting 5.1 Least-Squares Line 5.2 Curve Fitting : 5.3 Interpolation by Spline Functions 3 13. 3 7 81 54 Fourier Seri Polynomials 5.5 Bézier Curves and Trigonometric 6 Numerical Differentiation 6.1 Approxitnating the Derivative 6.2 Numerical Differentiation Formulas 7 Numerical Integration 7.1 Introduction to Quadratare 72 Composite Trapezoidal and Simpson's Rule 7.3 Recursive Rules and Romberg Integration 7A Adaptive Quadrature 7.5 Gauss-Legendre Integration 8 Numerical Opti 8.1 Minimization of a funetion 82. Nelder-Mead and Powell's Methods - 83. Gradient and Newton’s Methods ization ® Solution of Differential Equations 9.1 Introduction to Differential Equations . . 9.2 Buler’s Method 9.3. Heun's Method 9.4 Taylor Series Method 9.5 Runge-Kutta Methods 6 Predictor-Corrector Metiiods 9.7 Systems of Differential Equations 9.8 Boundary Value Problems 9.9 Finite-Difference Methoc 10 Solution of Partial Differential Equations 10.1 Hyperbolic Equations 10.2 Parabolic Equations 10.3 Elliptic Equations 11 Figenvalues and Eigenvectors 1L1 Homogencous Systems: The Bigenvalue Problem 11.2 Power Method 11.3 Jacobi’s Method 11.4 Eigenvalues for Symmetric Matrices CONTENTS 87 89 93 93 101 101 105 4 18 118 121 121 125 130 135, 135 138 140 M2 M44 uz uz 49 1 155, 155 167 160 163 163 168 169 170 Chapter 1 Preliminaries 1.1 Review of Calculus 1. (@) L= litt soo $44 Unc €n = lity sao(2~ $881) =2= 40 3-0 2 (a) limp se sin(y) in(2) (D) lity tn(22) =In(4) 5 Gas ee wa? 42043 2? 2-1 (b) Since f is continn va br—3 2 br—11 2 = SEE = SB ci6,9] 4. (a) #'(2) = 22 —3=0, thus the critical points ate c= +1. Thus min{f(—1), (0), f(2)} = rin =1,-1} = ~1 and mar{ f(-1), f(1), f(2)} = max{5,-1,—1} =5 (b) f/(@) = ~20os(2) sin(z) - — cos()(2sin(z) +1) = 0, thus the critical points are ¢ = 1, 74/6,.11/6. Thus on (6,8); CHAPTER 1, PRELIMINARIBS aint 10) Jer) H/6), (144 /6),J(28)) = min{1,1,5/4,5/4,1} = mnax{ 0) (7), (5/8) f(024/0), f(2n)) = mas{l 15/4 5/41} = 5. (8) Se) = da? — Be = Arf? — 2) = 0, thus 6 = 0,2VEe [-2,2] 0) Se) = eos(z) + 2eos(22) os(1) + 2(2cos#(2) ~ 1) Acost(2) + cos(z) ~ 2 0 a= (14/8/83 © cos1((=1 + ¥33)/8), 20 — cos™!((—1 + V3B)/8) (6) $"(2) = phy and LILO = 2. Solving gly = } yields c= 1. () F2) = (2? + 2e)/(a 4 1)? and LYM — }. solving f"(@) = (2 + 27)/(a-4 1)? = 3 yields e= 14 vB . The given function satisfies the hypotheses of the Generalized Rolle's’The- orem. Since f(0) = f(2) = f(3) = 0, there existe a c € (0,8) such that J") = 0. Solve be —8= io find e~ 4/3. (a) (Bxetde = re? — (2 =e? 41 (b) f2, Berd = $in(z?+1)[1, =0 (The integrand is an odd function) (0) £ fG Peos(t)dt = 2? as(r) (b) fF oP at = ol (322) = arer 10. (a) Poy [14 60%de = Br5|4, = 52 Solving 62? = 52 yields ¢ = £2678 € [-3, (b) Efe? xeos(z)dr = Z(xsin(x) + c0s(2))$*/? = (1+ 2). Use ‘calculator to approximate the solution(s)" zeos(2) — (1+ By; ¢% 2.16506, 4.43558 € [0,3n/2]. 1, (@) p=? () dpa (2) ha apes = 8G ~ she) = Slime oo Ohad — gp) = 3 (4) Sa ar = DEG — ak) = Hlitigco Shea (aby ~ aba) = $ 2. BINARY NUMBERS 7 (2) — ail — 1) + Ble 1) - Be 1)? + Hr -1) 41 (0) 42? 341 (©) et —fot 41 13. The Taylor polynomial of degree n = 4 expanded about x9 = 0 for f(r) = sin(z) is P(x). u. 15. The average area is given by; gly f? nrtdr = $(3)f = Wan, 16, Any polynomial P(x) satisties the hypothoses of Rotle's Theorem on the interval [a, 6]. Thus P’(1) has at least. n 1 real roots in the interval lost, P(x) has at least n— 2 real roots in the interval a,8],..., and PO) hhas at least n(n — 1) = 1 real root in the interval [a,b 17. If f,f’ and f” are defined on the interval (a,6], then f is continuous on the interval (a, ] and f is differentiable on the interval (a,b). By Theorem 1.6 (Mean Value Theorem) there exists numbers ey € (a,e) and e2 € (¢,) such that: 0 it follows that f'(ey) = fle)/(e- a) and that f’ and J” are detined in the interval (a,b), it fllows that /" also satisfies the hypotheses of Theorem 1.6. This there exists a number d € (a,b) such that: r= ee aoa aaa <° since f(o)>0. 1.2 Binary Numbers 1, Aumwes wil ape on speci plato. On Ge oe a 3. (a) 0.75 (b) 0.65625 (ce) 06640625 (d) 0.85546875 4. (a) 14140625, (b) 3.1416015625, (a) v2 — 1.414625 = 0.00015109.. (b) » ~ 3.1416015625 = —0.000008908. .. CHAPTER 1. PRELIMINARIES 6. (a) 23 = 1011 iwo 23 = 211) 41 u 5) +1 B= 2Q)41 2 = aa)+0 1 = %0)41 sr = 2143) +1 43 = 201)4+1 2 = 21041 10 = 25) +0 5 = 20)41 2 = 2)+0 1 = 20)+1 (©) 878 = 101111010120 (4) 2388 = 1001010101009 7. (a) 0.0111jo —(b) 01101 (€) D101 Igo (A) 0.100101 Teo 8. (a) 0.0076 (©) $= OF Dry. = 0-0 OR FRAG(#) RAC) ‘RAC() "RAC(4) % (a) F— 9.000110 90 = 0.000 TTrwe — 0.0001100:i20 0.0000000TT0.. oe = 0.00025 1.2. BINARY NUMBERS (b) $ ~ 0.0010010;0. 0.00 wo — 0.0010010 ro. = (.00000000100T ae o22s21428.... 10. In Theorem 1.14 let e= $ aud r= 4, then 2 s*u ‘Therefore, by the principle of mathematical induction, 2-™ ean be repre- sented as a decimal number that has N digits. 13. (a) % 010M ewe x 2-F = O01 x 27 Re OLOlin X27? = 0.01101 x 2-! ee Oe HE = 0.10019 x29 = 0.100twe x 2 f_% 0.101 ly x 27? 0.001011 two x 2° [ee ‘Thus (5 + 3) + $ * 0.11000 ® 0.001101 x 2-* 0.1101eu0 x 29 P= 001m <2? 0.101100 x 2-! zs O.1100T wo XT 10 M4, 16, 1, CHAPTER 1, PRELIMINARIES HX 0.10 X21 = 0.011100:u x 2 4 0110p x2? = 0.001101 yuo x 2° t 0.10100 we x2 ‘Thus (4 +4) + $~ 0101000 © HX Olly x2? = 0.01011 x2* dow O.1110 io x 2° = 0.001110 x 2-* eS BEF 0.10019 x 272 = 0.1001 x 27 01001 X27? = O.01001ine x 2-* Oe Thus (+ $)-+$ 0110: x24 @ FH FOOL Lew x 2° = 0.101000 x 2” 0.109 X 2-9 = _0.0001110 x 2° z 011001100 2 A O12 X 2° = 0.110100 ¢u9 x 2° = 0. Wile X2-? = 0.001001 0 2° eee ‘Thus (f+ $) +4 011M (a) 10 = 10lihree (b) 23 = 212three (0) 421 = 12012 siree (A) 1784 = 212002three (2) $= O.teiree (0) } =0Tehree (©) = 000Briree (@) B= 0.102rc6 (2) (@) 10 = 20/506 (b) (b) 35 = 120y:06 (6) (©) 21 = Wye (4) (€) 734 = 10414 jee (0) $= 0T3;ise () 4 = OF je (0) = 008 fre (8) HE = 0104 j0 1.3. ERROR ANALYSIS u 1.3 Error Analysis L 00008182, #=# — 0,0000300098..., 4 significant digits 50, Hak = 0.0355871..., (000008, == nificant digits 117647, O-significant digits 14 fart = Papa = (2.1414) (0.09125) (b) pi + p2 = 31.415 + 0.027185 Pipa = (31.415)(0.27182) (a) QFOTUNESEAR-oToTiTELIe _ o.meomTETIOS — 9.707108 The error ine volves loss of significance. () QausizEoas-p.satarinss . oemoneHIe _ 9 4999038 The error ine volves loss of significance, (a) In(#) ©) yaks (©) cos(22) (A) cos(e/2) (9) (2.72)8 = 3(2.72)? + 3(2.72) —1 20.12 — 317.398) + 8.16 —1 20.12 ~ 22.19 + 8.16 —1 5.09 (2.72 ~ 3)(2.72) +3)(2.72) -1 (0.2800) (2.72) + 3)(2.72) (-0.7616-+ 3)(2.72) —1 (2.2384)(2.72) =1 6.088 — 1 = 5.088 R272) = (2.72—1)8 (7° 5.088 2 CHAPTER 1. PRELIMINARIES (b) {((0.975)8 - 3(0.975)%) + 3(0.975)) — 1 = (0.9268 — 3(0.9506)) + 2.925) — 1 {(0.9268 — 2.852) + 2.925) +1 925 + 2.925) — 1 (0.975) (0.975) = ((0.975 — 3)(0.975) + 3)(0.975) — 1 ((-2.025)(0.975) + 3)(0.975) — 1 (-1.9774 + 3)(0.975) —1 (1.026)(0.975) ~ 1 1-1 R975) = (0.975 - 1)8 = (0025)? = ~0.00001562 TC) gt htt yt ay t ap ©0498 () dpta teed +h +s ~ oso 8. (a) The propagation of enor is ¢p + 6b €y ) +e bth Fa a G6 sre Hence, if 1 < {fl < |A|, then there is a possibility of magnification of the original error. © B+ &)G+aq\lF +e) BGP + Big + Gey + Baer + Fey + dept + Reger + epkgtr BOR + (Beg + Gey + Bier) +(Fepta + Hepte + Beate) + Oba Depending ou the abschite values of p, Gy and F, there is a possibility of magnification of the original errors fp, gan = 24h+ 2408 - O(n) = 1tht S43 +n) 1.3. ERROR ANALYSIS 13 10. eM +sin(h) = 14+2h+ 4+ 0(n4) esin(h) = ht P+ -orns) ‘An intermediate computation was 2, neat Me ae u ‘eos(h) + sin(h) cos(h) sinh} Leh B— 8 es O(n!) AE O(n) An intermediate comutation was ree ns OF 4 Sy ee 15 90 © 2880, 12, ‘The case for 22 is handled in a similar manner, 13. (a) 2, = -0.001000, x» = 1000 (b) 2 = =0.00100, +» = -10000 (©) 7% = =0.000010, 22 = —100000 (@) 2 = -0.000001, 1-2 = ~ 1000000 u CHAPTER 1. PRELIMINARIES Chapter 2 The Solution of Nonlinear Equations f(x) =0 2.1 1. Iteration for Solving x = 9(z) {a) Gleaely, 9(z) € C[0, 1}. Since g(x) = —2/2 <0 on the interval [0,1], the function g(z) is strictly decreasing on the interval [0,1]. If g is strictly decreasing on (0,1), then 4(0) = 1 and g(1) = 0 imply that 9{(0,1]) = [0,1] C [0,1]. ‘Thus, by Theorem 2.2, the fimetion g(z) hhas a fixed point on the interval 0.1} In addition: |f'(2)| = | - 2/2] = 2/2 < 1/2 < 1 on the interval (0,1). ‘Thus, by Theorem 2.2, the function g(x) has a unique fixed point on the interval (0, 1) (b) Clearly, o(r) € C[0,1}. Since g'(2) = -In(2}2-* <0 on the interval [0,1], the function g(z) is strictly deereasing on the interval (0,1). Tf 47's strictly decreasing on (0,1), then g(0) = 1 and 9(1) = 1/2 imply that 9([0,1)) = [1/2,1] ¢ [0,1]. Thus, by Theorem 2.2,the function 9(z) has a fixed point on the interval (0,1) In addition: |g/() = | -In(2)2-3| 1 on the interval (0,1). Thus, by Theore an unique fixed point on the interval (0, In(2)2"2 < ba(2) < Ine) , the Fimetion g(x) has Clearly 9(2) is continuous on [0.5,5.2] and 9((0.5,5.2)) ¢ (0.5,5.2) But, 9((0.5,2]) C (0.5,2). ‘Thus, the hypotheses of the first part of ‘Theorem 2.2 are satisfied and g has a fixed point in (0.5,2). While (2,1) is the unique fixed point in 0.5,2}, (f"(1)] = 1 ¥ 1, thus the hypothesee in part (4) of Theorem 2.2 cannot be satisfied 6 AGCHAPTER 2. THE SOLUTION OF NONLINEAR EQUATIONS F(X) = 0 2 (a) ~4t4r—het = 0 sta 6r48 = 0 z= 24 and g2) = 448-2 = 2 gd) = 4416-8 = 4 (b) wm = 19 m = 1.795 P2 = 15689875 Pa = 104508911 (e) Pm = 38 Pr = 398 rr = 39998 Ps = 399999998 (@) Por part (b) on Ro = 0.95 0.205 R= 0.1025 043110125 Ry = 0.21950625 095491089 Ry = O.A77495444 (©) The sequence in part (b) does not converge to P= in part (c) converges to P = 4 3. (@) p= V5, pa = VE+ VIS, converges () m= dpe © pm ‘The sequence 5.537809, diverges @ nm = 60.5, diverges 4. The fixed points are P= 2 and P = ~2. Since (2) = 5.and g/(—2) = fixed- point iteration will net converge to P = 2 and P= 5 3, 2, respectively 2 = ceos(z) 2(1-cos(z)) = 0 = = Onn 21. ITERATION FOR SOLVING X = G(x) Ww ‘Thus g(z) has infinitely many fixed points: P =2nx, where n € Z. Note lo'(2nm)| = |cos(2n)~2nm in(2nm)] = 1 ‘Thus Theorem 2.3 may not be used to fnd the fixed points of g(c), 6. |p2 ~ pal = |9(02) ~ 9(00)| = loca) (Ps ~ Po) < Kips — pal 7. |Eal = |P ~ mi] = |9(P) — 9(po)| = |a'(ee)(P — po)| > |P — pol = |Eol 8. (a) By way of contradiction assume there exists k such that pres = (Pk) = Pr. It follows that: 0.000173 + pe > pm —0.0001p, > 0 m= 0 ‘Thus Pk-1 = 0 oF Pe-1 = 10,000. Clearly, py—s # 10,000, since the maximum value of g(z) is 2500. This, if pe = 0, then pat, Pi = 0. A contradiction to the hypothesis pp = 1. Therefore, po > pi > *°> Pa > Pret > (b) By way of contradiction assume there exists & such that ps <0. It follows that: ssn) <0 —0.000173_; + 7-1 < 0 (-0.0001p)-1+1)pj-1 <0 From part (a); ifpj1 = 0, then pr #0. Thus pj1 #0. If pj.1 <0, then 0.00017; +1 Bi vw 10,000, ‘ contradiction. If pj > 0, then -0.0001pj-1+1 2 0 Pi S 10,000, 4 contradiction. Therefore, pq > 0 for all n (©) litt co Pa = 0 9. (a) 9(8) = (0.5)(8) +1. (6) [P~ pal = [8 1.5 ~05pe-1 $IP = Pn-al [1.5 ~ 0.5pn—1] = 313 — Pal = ISCHAPTER 2. THE SOLUTION OF NONLINEAR EQUATIONS F(X) = 0 (©) Using mathematical induetion we note that [P—ps| = $/P—po| and asinine that [P — px| = de|P — pol. Thus Pomel = 2y pd = oa 10. (8) Note: pr = po/2, pa = Po/2*,-.. Pes = po/2***,.... Thus Wags IPesal “preteens eka ay PH ae (b) Clearly, the stopping criteria will (theoretically) never be satisfied 11, In inoquality (11): [P ~ pal < K"|P ~ pol, where [g(2)] 0, £(0) <0, and (3) > 0; thus roots lic in the intervals {-3,0) and 0,3}. (b)_ S(@/4) > 0 and f(2r/2) < 05 thns a root lies in the interval [n/4, 7/2] (©) £8) <0 and f(6) > 0; thus a root les iu the interval [3,5]. (@) £(8) > 0, £(5) < 0, and f(7) > 0; thus roots lie in the intervals [3,5] and (5,7) [-24,~1.}, [-2.0, 16}, [-2.0, -1.8), [-1.9, ~1.8),[-1.85, -1.80] (0.8, 1.6}, 1.2, 1.6}, 1.2, 1.4, 1.2,1.3), (1.25, 1.30] (8.2.4.0), [8.6, 4.0, [3.6,3.8}, 3.6,3.7), (3.65, 3.70] 7. (60,68), (64,68), (6.4, 6.6), 6.5,6.5], (6.40, 6.45) 22. BRACKETING METHODS FOR LOCATING A ROOT 19 8. (a) Starting with ay < bo, then either a = ag and bj = “88%, or a; = $2540 and by = bo. In either case we have a) 19.89735 Thus N = 30. 20CHAPTER 2. THE SOLUTIGN OF NONLINEAR EQUATIONS F(X) =0 2. 13, u4 oh Fepltae bat) = bnlflbn) = (09) = f(bn)(bn = on On) — Flan. = =bafldn) + anf (bn = fla) = Tan) = Maf ln) ~ ba f (an Tin) ~ Fn) Beal <6 n(Bett) < me, sinc in isa steity nerasing fnetion. hes In(b—a)—(N-+1)In(2) <_ Ins) h ‘Therefore, the sinallest value of N is at (xe =25 8) ‘The bisection method can't converge to 2 = 2, unless e = 2 for some n>l N We refer the reader to "Which Root Does the Bisection Algorithm Fiud?" by George Corliss, Mathematical Modeling: Classroom Notes in Applied Mathematics, Murray Klankin Ed, SIAM, 1987. 2.3 Initial Approximation and Convergence Cri- tel Approximate root location ~0.7. Computed root —0.7034674225. Approximate root location 0,7. Computed root 0.7300851382. Approximate root locations ~1.0 and 0.6. Computed roots ~ 1.002966954 and (.6348668712, 24, NEWTON-RAPHSON AND SECANT METHODS a1 4. Approximate root locations 41.8, Computed roots +1,807375379, 5. Approximate root locations 14 and 3.0, Computed roots 1412391172 and 3.057103550. 6. Approximate root locations 1.2 and 0. 2.4 Newton-Raphson and Secant Methods 1. (8) pe = pen ~ pcre? © 2 (8) Pe = pana — Pegi? (b) © 3. (@) Pe = Pes — H(Pr—1 — 1) (b) Po PL Po Ps Pa Po rm Pa Ps “15 0.0625, 1.7743, 0.4505 16 2.52727 2.31521 2.30282 00 3.0 1.7143 1.3416 13410 21 2.075 2.05625 2.421875 2.031640625 (©) Convergence is linear. The error is reduced by a factor of # with each iteration, 22CHAPTER 2. THE SOLUTION OF NONLINEAR EQUATIONS F(X) = 0 4 (0) m= — Bg? ©) Ps mB (0) Convergenee is quadrstic. (roughly) doubles with eae 21 2.00606062 2.00002434 = 2.000000 = 2.000000 The number of accurate decimal places th iteration ‘The sequence {pe} converges to — ‘The sequence {pr} converges to SE. : aT 1) 3 1.01525. ) a.7ou49 6. (@) pe= mea ~ (149+ k- 19) arctan(py-1) () i. Ui, Titn sao Pe = 0.0 © i po= 1.0 pr = -0.570796327 ~0.116859904 Ps = ~0.001061022 Ps = 0.000000001 m=20 p= ~3.535743590 Pa = 13,95095909 Ps = ~279.344667 a = 122016.9990 fi, The sequence is a case of divergent oscillation 1 (a) = pea = Beaty (b) i ii Liga Pk = 0.0 Po = 0.20 0.05 —0.002380952 a = ~0.000005655 —0.000000000 24. 10. L 12, NEWTON-RAPHSON AND SECANT METHODS 23 (©) 200 21,05263158 22.10250034 23.14988809 24.19503505 SEES ii, Limp soo Pk = 08 (4) J(p4) = 0.00000000075:155 Pa = 241935484, py = 2.41436464 ). pa = 246371308, ps = 2.270278 ‘Pa = ~1.52140264, ps = ~1.52137968 Following the procedure outlined in Corollary 2.2, we assume that Ais a real uumber and find the Newton-Raphson iteration function g(r) for the function f(z) = 3 — A, Thus rr) os os Now let pp be an initial approximation to YA. Thus the Newton- Raphson iteration is defined by for k= 1,2, () Va (b) Following the procedure outlined ir: Corollary 2.2, we assume that A is an appropriate real number and find the Newton-Raphson iteration fumetion g(r) for the fianetion f(2) = 2% — A, Thus a) Now let po be an initial approximation to YA. Thus the Newton- Raphson iteration is defined by 24CHAPTER 2. THE SOLUTION OF NONLINEAR EQUATIONS F(X) = for k= 1,2, 13. No, because f(2) has no real zeros. 14. No, because f"(1) is not continuous at the root 2 = 0. 15, No, because f(r) is not defined on an interval about the root 2 ~ 0. 16. From (12) and (13) we see that (11) is the Newton-Raphson recursive rule for the function f(x) = x? — A. The zeros of f are VA. It follows from ‘Theorem 2.5 that there is a po such that (11) converges to VA. 17. (a) o(p) = p— p which implies that -7B = 0, which implies that f(p) 0) gp) =1~ Lease HL — tre 0, Since 9) = O and g'(p) is a continous function, choose ¢— 1. Then there exists an interval (p—d,p+d) in which |g'(2)| < c or |g'(2)| < 1. Therefore, ‘Theorem 2.2 implies that ltqsge Pa = P. 18. (a) Given O= Flow) +S PaN(o— ve) + FI" Day? then $00) + FN—m) = Fy" ea)lo~ pe)? fm) _ Pa) mit get = - omy (8) The ast expression in part (a canbe writen as _fe)) _ _ tte) ~(» FB) = “To Le FB 0- my Assuming f"(px) ~ f"ip) and f"(ee) & J"(p) when k is sufficiently lange yields PoP = pom & Ppp? a LO) pg, Fa © a7) Pe i one aro 24, NEWTON-RAPHSON AND SECANT METHODS 5 19. (a) I1/4.) Given A= layjlyny and B= [by]yey are uppertriangular matrices, then by definition, ayy =0= by, when é > j. Case 1: If > k then ay, =0 and cixbay = 0. Case 2: If i % ky then i < k and i > j imply that bys = 0; and thus unbas = 0. Thus, ifé > j, then the ij th entry of the product ABis SY, aixbey = 0. ‘Therefore, the produet of two upper-triaugular matrices is an upper-triangular matrix, 8. ny = 8,92 =2, 29 1, r= 1, and del(A) = 24 6. 2, = =2, 29 =2, 45 =0, 24 =3, and det(A) = ~30 38 CHAPTER 3. THE SOLUTION OF LINEAR SYSTEMS AX = B 7. From Program 3.1 2y = by/ayy and be Nan, yw MoDh wey ate for k= N—1, N-2, ..., 1. There are (N~1)-+1 = N divisions. Por each value of k there are N ~(k-+1) +1 = N~k multiplications (one for each term in the summation) and N—(k-+1)-+1 = Nk additions /subtractions (N~(k+1) from the summation and one subtraction from the numerator), ‘Therefore, there are TW 4) (v-yw— sn" 3 multiplications and additions/subtractions, respectively, 3.4 Gaussian Elimination and Pivoting 8,22 =2,49=1 2. my = 3,22 2 2g=1 3. 1 =1,2)=3,29=2 4 m= 2,02 25,2951 5. y= 5— 30420 6. y= 5 42n— 2? 1 Bet fa? — fot 8 m= 3,29 1,431, 24 9. =2, 29 25 = 1, a4 10. 2y=1, 22 =3, 25 =2, 24 1 2 =1,2=3,25= 2,04 2a =2 = 5 9 = —2, 24 = 13, The exact solution is [x y = [-1 1 J'. Clearly, (umexpectedly?) the MightyDo 11 solution is best: [2 y '=[ -0.99 "1.01 J 14. (a) Compare to 2; (0.00000000, :r2 ~ 0.00000100, 3 = 0.010000 3.5. TRIANGULAR FACTORIZATION 39 (b) Compare to.x; = 0.00035701, 177 = —0,0015951, 25 — 0.02820363, 25 = 0, 25201729 15. (a) ay = 25, 22 = —300, 273 = 1050, 24 = —1400, 75 = 630 (b) 21 = 28.02304, xz = ~348.5887, x5 = 1239.781, 24 = —1006.785, ty = 753.5564 3.5 Triangular Factorization 1 @) ¥=[-4 12 3x () Y=[20 39 9.x" 2 3. 4 5 2 2x" 127 12 1Y',.x" 2.7 oo]fi 1 0 4 Ool;fo 3 5 -s 1o0]/|o 0 -4 -w0 17% 1) [0 0 0 -75 40 CHAPTER 3. THE SOLUTION OF LINEAR SYSTEMS AX = B 8, Use the fact that Ly, Uy, La, and Uz are all nonsingular. 8. When F > 6 oe) = Fm + meal? = Yoo ate +29 30. (9) Camry ot the ini (8) Note A products 1 jak 0548 If P = (84, Bj, +-- Biy), then P! = (Ey, Ey, «+> Egy]! Thus PPP = laij)vxn, where Bu, = leishan where e1; = { ot OG w=, ={ 018 ‘ins POP = 1. Sivilary, PP’ = 1. ‘Therefore, P-! = P* 1. bet A= [abv whore ay =0, 14> 3, Thos A“? = dha where cy Cae Ce cg Bea provided i > j. Therefore A~? is upper-triangular, 3.6 Iterative Methods for Linear Systems 1. (a) Py = (8.75, 1.8), Pp = (4.2,1.05), Ps = (4.0125,0.96). eration will converge to P = (4,1). (&) Pr = (8.75, 1.05), Pz = (4.0125,0.9975), Ps = (8.900575, 1.000125). Iteration will converge to P = (4,1). 2. (a) Py = (1.25,1.5), Pz = (1.8125,1.8125), Py = Iteration will converge to P = (2,2). (b) Py = (1.25, 1.8125), Py = (1.920687, 1.98242188), Ps = (1.9031082, 1.99835200). Iteration will converge to P = (2,2). 9296875, 1.953125). 3 3 ITERATIVE METHODS FOR LINEAR SYSTEMS a (@) Pi = (-1,-1), Pa = (~4,-4), Ps = (—1 diverges away from the solution P= (4, 1) (b) Py = (-1,-4), Pz = (-13, —40), Py = (121,364). The iteration diverges away from the solution P= (4, 1) (a) Ps = (0.5,—0.5), Py = (1.25,1.25), Py = (—1.875,3.875). However, the solution is P = (0.2,0.2). (b) Ps = (0.5, 1.25), Po = (—1.375, ~5.3125), Ps = (8.46875, 29.140625).. However, the solution is P = (0.2,0.2) (a) 13). The iteration (2,1.875,0.75) (2.125, 0.96875, 0.90625) (2.0125, 0.95703125, 1.0390625) Iteration will converge to P = (2, 1,1) (b) (2,0.875, 1.03125) (1.96875, 1.0171875, 0.989257813) (2.00449219, 099753418, 1.0017395) Ps = Tteration will converge to P (1,1) (a) (5.5, -10,0.75) (48.875, 18.25, 4.625) (65.1875, 224, 7.6525) However, the solution is P = (2, 1,1) (5.5,17.5,-2.22) (65.625, ~340.375, 69.4375) (1401.71875, 7058.03125, ~1415.82813) However, the solution is P = (2, 1,1) (a) (-8,13,0.333333333) (67.3333383, 45.3333333, ~4.5) (214.166667, ~220,83383, 11.8889) Py = However, the solution is P = (3,2,1) 2 CHAPTER 3. ‘THE SOLUTION OF LINEAR SYSTEMS AX = B ) Py = (-3,45,~9.83333333) Po = (207.16067, -825.5,206.97222) Ps = (-3028.5278, 15934.0833, -3964.8565) However, the solution is P = (2,1,1) 8 (a) P, = (8.25,1.6,0:33538333) Py = (2.08383, 2.183933, 1.15) Ps = (2.001667, 1.956067,0.917222) Iteration will converge to P = (8,2,1) (b) (8.25,2.25, 1.04166667) (2.0479167, 1.98125, 0.9857639) (3.0011285, 2.030729, 0,9998640) eration will converge to P = (3,2,1) 9. (14) Ife € ®, then zx| > 0 for k= 1,2, or [Xj 0. (45) If X=0 then X = (0,0,...,0) and |IXI) = SX. ¥e assume |X], = 0, and by way of contradiction assume X #0. Then there is a k such that 14 O and |ze| > 0. But then, [lh = DN, [rel > 0» a contradiction to the hypothesis |[X||; = 0. Thus, iF FXlh = 0, then X =o. (16) NN. Therefore, S40, [re] > 0. Now WX Ei - Ete = lel3ohe mi = lellXy 10. (14) If r, € R then 2 > Oand |X| = VON, a} > 0. 3.6, ITERATIVE METHODS FOR LINEAR SYSTEMS 43 (a5) If X= then X = (0,0,...,0) and [XI] = ~SE assume |[X\| = 0, and by Way of contradiction assume X 0. Then there is a & such that xe 4 0 and 2? > 0. But then, |X] = VEN, #2 > 0—a contradiction to the hypothesis [|X|] = 0. ‘Thus, if ||X|j = 0, then X = 0. x ier? (a6) ex! lel) (17) First note from Exercise 2 of Section 3.2 that, cos(6) 1 » “ “ XUN¥ I ‘Thus (x4 YI? (X+¥)-(K+¥) X-X42(K-Y)+¥-¥ WIP + 20K-¥) + YI? WIP + 24H 0%) + YIP (M+ HY? < 4 ‘Taking the square root of both sides of the resulting inequality yields X+ ¥il < [XI] + YI) ML. (14) If.xy ER then x4] > 0 and [Xl] = maxrceew l2e| Xllno 2 0 4 CHAPTER 3. THE SOLUTION OF LINEAR SYSTEMS AX = B (25) If X=0 then [Xiao = maxictcw lee] = maxicrew 0] = 0. Now assume |X|] = 0, and by way of contradiction assume X70. Then there is a j such that x5 4 0 and [x4] > |xg| for k = 1,2,...,N. But then, [Xoo = [xj] # Oa contradiction of the hypothesis that IX} =0. as) UX lee = ma, lel = max lel 1B eles! = ld mas, bl = [el%leo an IX+Ylleo = max, lee + al say when B= j ley + us] Sime, [eel ma, Iv = [Xlle + 1¥ loo 3.7 Iteration for Nonlinear Systems 1, (a) (0,0) (b) ($(9 — 2V30), 3(-6 + V30)) ,(5(9 + 2V30), 3-6 - V30)) (©) @ynn) (d) (1,2,1) 2 (a) (4-2) (b) (1,1/2),(-1/3, 11/6) (©) 2-1)" ) , 0, Qn-+ 1) /2) (0) (GRE G38 aps) (GS aH ap) 3. The system hns two fixed points: 3 (32 a (32 =) 3 Voss Formula (16) becomes: 2 3.7, ITERATION FOR NONLINEAR SYSTEMS 45 and a be ea), | Pon z|+ Oy ‘The second fixed point doen't satisfy the first inequality, thus convergence isn't guaranteed. The first fixed point satisfies both inequalities and both inequalities are satisfied for every point (x,y) in the region defined by 9-2V30 1 9-2V 1 gg << tas and ‘Thus fixed-point iteration will converge to the fixed point qBq(11,54,—18) for any initial guess (po, 40,70). 5. (a) Fixed-point iteration: (Po,90) = (1.1,2.0) (Pings) = (91(1.1,20),92(0.1,2.)) = (1.12,1.9975) (242) = (91(1-12, 1.9975), go(1.12, 1.9075)) = (1.1166, 1.9964) (®a,45) (931-1166, 1.9964), 9a(1-1166, 1.9964)) = (1.1164, 1.9966) (b) Seidel iteration a (Pod) = (1.1,2.0) (Pig) (93(Po; 40), 92(P1» 90) (p29) = (91(P2,41),92(P2,91)) (Ps,a3) 1.12, 1.9964) 1.1160, 1.9966) (gu(Pa, 42), 92(P2, a2)) = (1.1166, 1.9966) 6 CHAPTER 3. THE SOLUTION OF LINEAR SYSTEMS AX = B 6. (a) Fixed-point iteration: (Poe) = (-0.8,~1.3) (ne) = (-0.2684,-1.3175) (Pa,¢2) (-0.2694, -1.3161) (P5;4%) = (~0.2696, 1.3153) (b) Seidel iteration (Po. 40) (om) = (-0.2719,-13191) (Pam) = (—0.2704, ~1.3139) (Pa) = (~0.2604, -1.3160) 7. - = Jen = |e Few = [202705] (a) 7 (e Py = rev ar=[ | Be msar=[ 118] (b) Po = [ea bon povar=[ pee) Py = Prvap[ 02] 8 (a) Clearly y # 0. Substituting x = 1/y into the first equation yields y=21. Thus the solutions are (1,1) and (=1, —1), (U) The values of the Jacobian determinant at the solution points are {3(1,1)| = 0 and |J(~1,-1)| = 0. Newton's method depends on being able to solve a linear system where the matrix is J(pp,qn) and 3.7. ITERATION FOR NONLINEAR SYSTEMS ar (Pa. 9a) is near a solution, For this example, the system of equations ill-conditioned and thus hard to solve with precision, In fact, for some values near a solution we have J(to,yo) — 0, for example, -3(1.0001, 1.0001) = 0. 9. Assming aj: #0, then Jacobi iteration for the linear system ane + ary + aye ant + ani + ane ayy + Asay + ase by ~ a2 ~ ange ¥ = m(o,y.2) = 2 Ae os ben ane a 5 = as(oyyya) = Sota ‘The fixed-iteration in (15) follows froin these equations. If the eoefficent matrix of the given linear system is strictly diagonally dominant then lae| > 37 fans] jak for k= 1,2,3. In particular, for k = 1 we have |ars| > [axa] + [aig] and = 0+ |e] + |e] = tales! ¢ ‘The conditions for ga(7,y,2) and ga(st,9, 2) are derived similarly. 10. From Newton's method: Pes = Py-I*F(Py) or 48 CHAPTER 3. THE SOLUTION OF LINEAR SYSTEMS AX = B [ren] = leds) - [5)-[a BEY [Ae] = [lm [ie E463) ‘Thus: alan = Ht fa nen) = 9-2 hth 11, (@) From the Mean Value Theorem there are numbers a and e sch that a = MG O),, 5 nie g, lal = [Peat 2B | «|u| «| ales | Aextas 0) < | or -( < Kro a [ses S : Oy Yn), (b) From part (a): les] < Kr and ry = maz{les|Ejl} < Kro. Thus lea] < K(Kro) = Kray Similarly, [Ba] < K?ro, (©) Assume 9gx(45,90) fecomale lee-tl < Krea < Kr, \Exal < KreoS Kr. ‘Then 3.7. ITERATION FOR NONLINEAR SYSTEMS 49 A Kn K(mar\ex-1|,|Ex-1|}) K(K16) = Kr lex! ” Similarly, |Bx| < Kry (d) Note: limp-oe len! Thus < Kr, ittnsc0 K"1y = O(ro) = 0, since 0< K <1, = Lu lend = im Lo pal = in (7 — pa) OF lita soo Pn = p- Similarly, lity: Qn = 4 12, (a) Note: As with derivative, we have 2(cf(e,9)) = oglu). FX) was defined as F(X) = [Ale thus, by scalar multiplication, CF (K) = [efi (2iy.oos9) ef yeaa) HOP(X)) = Linhmany where Babe foal @ase- ta) Ge Fle eayevte) = eG hleaser a) ‘Therefore, by the definition of scalar multiplication, we have J(cE(X)) = eH(E(X), (b) Note: FIX) $GR) = [lets este) falPrs---sea)l Hon 15-4) a(t t0)l = [itm fm+ gm! ‘Thus JFK) +600) = = SFX) +4(G00) 50 CHAPTER 3. THE SOLUTION OF LINEAR SYSTEMS AX = B Chapter 4 Interpolation and Polynomial Approximation 4.1 Taylor Series and Calculation of Functions 1. (a) a(x) = 225/31 425/s! Py(x) = 2 — 28/314 25/51 ~ 27/71 Po(a) = 2 ~ 29/3! 4+ 29/5! — 27/7! + 23/9! (b) |Eo(x)| = |sin(e)29/10!| < “2 = 0.0000002755... © Pole) = Syl1 + (@— x/4) ~(e— 0/9)2/2- (en /4)3/04 Ge m/Ay*/24-+ (a /4)5/120) 2. (a) Paz) =1— 22/2 +24/41 Pox) = 1 ~ 22/21 + 24/4! — 28/61 Pa(2) = 1 — 22/21 4 24/4! — 28/61 + 28/81 (b) [Ba(2)| = |—sin(e)2®/9!] < 42 = 0.0000027557... ©) Pav) = Fpl (w= /4) —(e — n/9)2/2-4 (2 — 0/49/64 (e = m/A)"/24) No, the derivatives of f(r) are undefined at 2 = 0. (a) Ps(z) =1~2+e?-23 404-25 (b) Bs(z) ~ a fBS2pr5 Py(x) = 1402 — 22/24 029 =1— 27/2 51 S2CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION 6. Pala) = 1-4 (e=1) + (2—1)? + (x —1)®, There are several ways to show J(e) = Ps(z). For example, Py(z) can be expanded and simplified. ‘The following argument makes ise of the Identical Polynomial Theorem—If two polynomials of degree 1 agree at n-+1 points then they are identical. Evaluate f(x) and Ps(2) atx = —1,0, 1,2: fl) = -8 = AK-1) £10) 0 = FO) fa) 1 = AQ) 42) 4 = AQ) Tis f(2) = Pala) 2 @) oy EA) (= 3? | = 99 5! Teo Pe) a a toe ease asTOr2 ) Pola) = 3+ br-9)— gle 9) + ghee — 9)? ~ arian — 9+ aabsas (2 9 (©) t= 4: Po(6.5) © 2.56116, 29 = 9: Pi(6.5) = 2.54955 8. (@) $2) =2, £12) = 1/4, £"(2) = ~1/32, © = 3/256 Pala) = 2+ Ha —2) - f(a - 2)? + g(a —2)* (b) Ps(1) = 1.732421875; compare with 34? = 1.732052808 (© F@) = -8(e+2)-77: the maxinmm of |f4(2)| on the interval 1 < 2 <3 oceurs when x = 1 and |f*(x)| < [J4(1)| < 3-7/2 ~ 0.020046. ‘Therefore, \Es(z)| < = 0.00083529.... (0.020046)(14) oe 8. F(2) =e implies 02) = , thas [y(0) = [ACMI = oye (0.1) = 4.16 x 10- and £5(0.1) = 83 x 10-* < 10-®. Thus we select = 5 to obtain the desired accuracy. 1B4(33m/32)| < smeuseese-m* «3.8 x 10-6, [£s(33n /32)| < ENSse/s—m” 75 x 10-8; thus use Py(2). 11. (a) F(x) = f%, cos(t?)dt, cos(2"), 2x sin(2?), 4.1. TAYLOR SERIES AND CALCULATION OF FUNCTIONS 53 F(x) = —42? cos(a?) ~ 2sin(2?), FO (x) = —12x-cos(x?) + 8x9 sin(x2), FON(2) = ~12c0s(2") + 1624 eos(24) + 4802 sin(z?) F (0) = f°, eos(¢2)at, F*(0) = 1, F"(0) = 0, PMO) = 0, FO) = 0. Thus no= f ott (b) F(0.1) © P4(0.1) % J°, cos(#2)dt 40.1 = 0.904524 + 0.1 = 1.00452 (©) Note: [£a(2)| = |£"@*| where cis between 0 and x. Thus |Pa(0.1)| = |e") < 2488" — 9.000001 12. (a) aretan(z) end Ste) de = S40! ( fae S( n') ror(f ) a - tout ®) gt gs? gata 3 ye arctan (2) = 91. oer) (Ge r= 20")(1- (©) 2V8 (1 +--+ St) 3.149268. S4CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION 13. (a) £2) =a)", f"(@) = 42), M2) = A+ 2), fe) = 2-30 +2, Inductively we see the pattern: eq) = DEM = DE (oleae ) » f(x" Py(a) = Sa 2 & © Ente) = LO MeMH (caytortar 4 1m " +i WHat (yee * Wwepgrat where ¢ is between 2 and 0. (2) P4(0.5) = 0.416660667, Ps(0.5) = 0.40468750, Ps(0.5) = 0.40553230, In(1.5) = 0.40546511 (©) 10.0<2<0.5 then Ba ~ 0.00000765.... | 02) 14. (a) When k=1, (2) = p01. +2)"%, Assume (yz +a (ata) os I) =P) (p— ns) +) Thea F(a) = (F%0))' = pP— Yn FNM eae (p—n + I(p~(n 41) +114 2) = wp) 4.1, TAYLOR SERIES AND CALCULATION OF FUNCTIONS ‘Therefore, by the principle of matkematical induction, for k > 1 (2) = pp 1)---(p—k+ DA +a* (>) B pte(Q)2t tg ere Pa) = Sof 10) p= 1) a kev _ epee MED og HOD) oN ae" (o) FO ont (N+ (= 1)---(p— (N41) + NO Hep gw (N+DE plp—1) panty Gro N = (d) P2(0.5) = 1.218750, P,(0.5) = 1.224121, Pp(0.5) = 1.224744, YTB = 1.224744 (©) IN =5 and p= 1/2 then Ey(x) in part (c) becomes Be) = age BEM +qF TF 0.0.< $05 and c is between Oand 1/2, then Ey(z) = 94526 945(1/2)° TaN} A| § | B5P20V(0) aL : aga * 0008204 (f) In part (a) let p = N: [Fs(x)| = N(N= 2) a N(N =1)-+-(N-N4+2)cN1 (Wi) N(N~1)---(N-N4+1)2% oN N(N = 1): a N(N = 1)2? z & Pua) = 1+Ne+ + 7 Niet Ni +W 1+Nr+ + = 1tNet bee NaN ga S6CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION, 15. (a) For f(x) =cos(z) and to = 0 we have age (ale) 2 where d is between 2 and 0, Thus a) < DE) < yr or ¢ < (107851) /5 = 0.164375. (b) For f(z) F(a) (x= $) where d is between x and x/2. ‘Thus 184(e)| < YO < ror# or & < (10-851) ¥9 a 0.164375... (©) For f(a) =e and 29 =0 we have (Buy = |“) where d is between 0 and 2. ‘Thus ee le4t2)1 <| or eFe® < 120(10-*). ‘The root-finding techniques from Chapter 2 can be used to show that < 0.158 will satisfy the error constraint. 16. (a) Py(2) is even (b) Py(2) is ode 17. If f is a polynomial of degree N, then f equals its ‘Taylor polynomial of degree N expaniled about 20: Sle) = Py(a) = Yo Pee = 20) = Consider the case where x > zo. Since f(t9) > Oand f{")(e9) > 0 for 1,2,-..1Y, it follows that S f')(xo)(z — ao)" Hla) = Pyle) = > Palle sot >0 for x > 29. Therefore, the real zeros, if any, of y = f(z) must be less than 0. 4.2, INTRODUCTION TO INTERPOLATION aT 18. For f(x) and 9 = 0: Py(z) = So ¥. Further, note that Pha) = Py-i(z) for N > 2. By way of contradiction assume p isa root of multiplicity M2 2. Then yt Px) = & and Php) = Pv-vta) So é = ‘Thus Py(p) ~ Py_a(p) = % = 0 or p= 0. A contradiction. Therefore every real root of Py(z) has multiplicity less than or equal to one. 19. In Corollary 4.1 it was shown that Py(x) = f’(x). Assume P\YY (2) = FON (a), Thus PP) = (PEP @)' = (s-P@)' = FM) Therefore, PA) 20, Let 2,20 € (a,b). Since g(x) = (to) and g is continuous, then by Rolle’s Theorem there is a c, between x and zo such that g'(c)) = 0. Induetively, there is acy such that g(a) (ew). Therefore, by Rolle’s Theorem there isa. between z and ew such that 9(*"*9)(¢) = 0 a F(x) for all k > 1. DQ) = fH) 9 Ey(2N +)! 0= 940) = mg - EMEA Solving for Ew(2): LPN C)ia— ae) 4H oe Wa! 4.2 Introduction to Interpolation 1. P(a) = -0.0225 + 0.0123 ~ 0.27 + 1.66 (@) Uso 2 = 4 and get by = =002, by = 002, by = 0.12, by = 1.18. Hence P(d) = ~036 S8CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION (b) Use 2 = 4 and get di = -0.06, d, = ~0.04, do = -0.36. Hence P(A) = ~0.36. (©) Use = 4 and get ig = —0.005, iy = 0.01833333, ig = -0.4666667, i) = 147383333, ig = 5.89933333. Henee I(4) ~ 5.89833383, Similarly, use x = 1 and get I(1) = 1.58833333, Thus f* P(r)dr = 1(4) - T(1) = 5.898383 — 1.58838833 = 4.305, (a) Use 1 = 5.5 and get by = ~0.02, 62 = -0.01, b) = —0.255, by = 0.2575. Hence P(6.5) = 0.2575. (©) The corresponding lincar system is atbt+erd = Baabe2e+d = 15 Wat+S+3erd = 142 1250+ 2564 5e+d = 0.66 ' & ‘The solution is a = 002, b= 0.2, e= 2. P(x) = ~0.0408 + 0.142 0.162 + 2.08 (a) Use x = 3 and get by Hence P(3) = 1.78. (b) Uso © = 3 and get d; = -0.12, d; = ~0.08, do = -0.40. Hence P'(3) = 040. 0.04, by = 0.02, by = 0.10, by = 1.78. (c) Use 3 and get ig = —0.01, is = 0.01666667, ig = —0.03, i, = 1.99, io = 5.97. Hence 1(3) = 5.97. Similarly, use + = 0 and get 1(0) =0. Thus fg P(z)dx = 1(3) — 1(0) = 5.97. (a) Use L5 and wet, by = 0.04, by = —0.04, 6 = —0.34, by = 0.55. Hence P(4.5) = 0.55. (0) The corresponding linear system is: atbietrd = 105 Ba4db+2e4¢d = 1:10 Wat+b+3erd = 1.35 12514+-25b+5e4+d = 1.75 ‘The solution is a = —0.029166667, b = 0.275, d= 0.1375, 3. (@) E2SGLO ~ 0.04%, MELA? w 1.70% LAT. 25 0.75%, LIE 1.60% =ecabigeasre002 = 45.83% change in as =basraghared oy 42.71% change in ay (b) Pa) = 1.625 (570833383, and 4.3, LAGRANGE APPROXIMATION 59 (©) P(A) = 0.220166667 (@) 1(4) — 1(1) = 4.938333333 — 1.173958333 = 3.759379, (e) P(6.5) = 1.70156261 4.3 Lagrange Approximation 1. (a) Paz) =(-) (b) Pala) = (-)# LyO=r+0=a tested +04 (nggentes (©) Pua) = (-DEROR + 0+ DSHS? = (4) Pr(z) = (1) $55 + 894} = Te -6 (©) Pale) = 0-4 AEB 4 88G=D = a2? 25 2 fla)=242%e (9) Py(2) = 0.42? — 1.20 43.8; Py(1.5) = 2.9 (d) s(x) = —0.80° + 4.82? ~ 8.82 +78; Py(1.5) = 2.7 3. f(x) = 2sin(wr/6) (a) Pal) = (—2? + 72)/6; Pa(2) = 5/8 (b) Pala) = (~2* — 62? + 672)/60; Pyl2) = 1.7 4. f(z) = 2sin(rz/6) (2) Pala) = (-2" + 72)/6; Py(4) = 2.0 (0) aCe) = (2° — 62? + 672)/60; Pyid) = 18 for all c, thus Es(2) = 0 for all x. for all ¢, thus Bs(x) = (2+ 1)(x ~ 0)(r = 3)( — 4). (6) By(x) = eaten nce= a9 6. (0) Pata) = CERES (aaah test 4 gh eens ae fp etde = 0.676833 o The fourth derivative of f(z) = 2° f(x) (14 In(o))te" + 20"? + ¢: 2 +3¢1 + ina? = (tome) +2(1-+ In(a)) (e * 60CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION is positive on the interval [1,1.5]. Thus the third derivative of f+ SMa) = Bet + Infe)) +2" + n(n)? + (+m) is strictly increasing on the interval (1, 1.5] and the maximum value of |f""(z)| ocours at 1.5: [f2*(6)] < (1.5) = 7.97643 = Mh Using h = 0.25 in (27): ¢ (0:25)(7.97643) 162(2)] Tg o.020854 7 (a) a2) = Eagle) + Lala) + Loale) = (e=a)e=m) , @-rle~m) (eo=mi)(eo— 2) * Cer zo)lar = 22) (x ~z9)( — 21) "2 — To)(t2 — 21) ‘The function g(r) i a sum of polynomials of degree less than or equal to two. ‘Therefore, 9 is& polvuotial of degree les than or equal to two, (b) 920) = L2o(zo) + Lra(#o) + Laa(to) —1 = 1+040~ 0. Siilarly g(e1) = 0 = 3(za) (©) In part (b) it was shown that the polynomial g(z), of degree less than or equal to two, has at least three distinet real zeros. But, the Fundamental Theorem of Algebra says a nonconstant polynomial of degree less than or equal to two can have at most two distinct real zeros. Therefore, g(x) =0, a polynomial of degree zero, for al x 8. For z= ay (te = Fo) +++ (te ~ a1) — Teo1)*--(Te— EN) (Ge = to) ++ (te = tea) @e = Teva) (Ee EN, soy = ay) ay = nae aNay = nas) Cay 2) oo (@e = 34) <* Ge = Bea) (e — Tei)" (Be = FN) ‘too Lye = 1 for any real number 2. 4.3. LAGRANGE APPROXIMATION a 9. Let f(z) = cya® + eye" +--+ +e. Thus f¥*D 20, Tt follows from Theorem 4.3 that Sa) = Pale) + Seaeearetecsad pov (ey Py (a) + Sazaleesienas Pua) 10. 1"(o}] < | ~sin(1)] = 0.84147098 = Mz [£(e)| < | —cos(0)| =1= Ms {£(e)| < | sin(a)| = 0.84147098 = My (a) TEh?Ma/8 = 12(0.84147098)/8 < 5x 10-7, then h® < 4.753580x10-° and h < 0.00218027. (b) TE ay . YO <5 1077, then h® < 7.794228 x 10-8 and h < boa ) Ae = Miwa <5 x 10-7 then ht < 1.426074 x 10-7 and h < DoGia5i98 U [e~a9ll2—2,]le—2a| = [t+ Alle Al = lo(t)] where v(t) = (C+ AYO — hy) = 8 — th? for -h < t 1 (b) The Newton interpolatary polynomial for the set of points { (74, ue) eho 530 uf 3 Pulz) = w+3 («Hie») a uw ra = felt (ia valle) Sled + = (in ote] ile = -) ava a ka +h (ira. calfe~=)) = ¥ ha Sled +> (ives on) TT -») am 0 = Pxix), a polynomial of degree N, assuming that not all Nth divided differ- ‘ences equal zero. 10, Py(2) = —2 + de — 2-1) = ~2? + 52-2 UL Pala) = 8+ 92-1) -(e-1)(@-2) 12. Pala) 1) +a(e— 12-2) 2B. (ran) = ERE = |e ~x/2)(z~ n)x* sin(re) Co < Flee—0/2\r-m) ‘The function g(r) = |1(r—1/2)(2~n)] is continuous on the closed interval {0.x}. ‘The maximum value of g occurs at an endpoint or at a critical 4.5. CHEBYSHEV POLYNOMIALS (OPTIONAL) cy number in the open interval (0,7). In particular, the maximum value curs atthe eral umber 2 = Behe. Therefore, [VK als oo (=) 7.700142 4.5 Chebyshev Polynomials (Optional) 1 Tix) 2xTa(x) ~ Ta(x) = 20(4x* - 3x) — (22? - 1) 8x4 ~ Gx? — 29? 41 = Bet Be? +1 To(x) 2aT a(x) — T(x) = 22(82* — 8x? + 1) - (42 - 32) A6r° — 16x5 + Qe ~ da? + 3x = 162° — 202° + 5x Tole) = 2as(z2) ~Ta(a) = 2r(16x° ~ 202° + 52) ~ (824 — 82? +1) sc — 402 + 107? — Be + 80? — 1 = 322 — aot + 182? 1 ‘Tr(2) 2eTo(x) — Ts(x) 2x(32x° — 4824 + 1804 — 1) ~ (16° — 2003 + 5) 64x — 9625 + 3629 — 2x — 162° + 200° — 5 Ga" — 11208 + 5624 Te 3. When N = 1: 7y(r) = 2 and the leading coefficient is 1 = 21, Thus the statement is true when N = 1, For the inductive hypothesis assume the statement is true for N= j, i.e; the leading coefficient of T;(z) is 24-4, From Property 1: Tjsi(t) = 2x7,(2) ~ T;-1(2), where T,(x) and T,-1(2) are polynomials of degree j and j 1, respectively, ‘Thus the leading coefficient of Tya(z) is 22-1) = 20+). “Therefore, by the Principle of mathematical induction: "The coefficient of 2” in T(z) is 2”) when N > 1 4, To(z) +1 is even and T;(z) is odd. Hence 27(z) is odd and x73(x) is even, The sum of two even functions is even and the sum of two odd fumetions is odd. It follows that Ta(r) = 27) (xr) — To(z) is even and Ty(z) = 2rT,(2) ~Th(x) is odd. Assume that Tax(2) is even and Tox (¢) is odd for k= 1, .-.,.m, Then Tapsa(r) = 22Toe41(2)—Tae(2) is even and Taxsa = 22Tan42(2) — Tava (2) is odd. Therefore, it follows that T2yy(r) is even and T44+1(z) is odd for all M. 86CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION 5. Ta(x) = 22-1, T3(x) = 4x. The critical value in (1,1) is =0. At the endpoints T3(—1) = 1 = 7,(1) and at the critical value T3(0) = —1. The minimum value of T3(2) over [-1,1] is ~1 and the maximum value is 1. in + 2°, Ty(z) = —3 + 122? = 3(~1 + 22)(1 +22). At the endpoints T3(—1) = —1 and Ts(1) = 1. The critical values are 2 ~ 1/2 and 22 = =1/2, At the crisieal values T3(1/2) = —1 and Ta(~1/2) The minimum of Ta(x) over [1,1] is -1 and the maxinimam is 1 =AGr + 32r5 = 167(22? — 1) = 162(2 ~ values are 7; = 0, +1/V2. At the end- 1, At the critical values Ta(-1/v2) 1. The minimum of T4(x) over [-1,1] points T4(—i) = 1 and Ta(t =1, Ta(0) = 1, and Ta(1/ v2) is “1 and the maxinum is L 8. () sin(z) ~ 0.998082842 ~ 0.158504802° (0) EEG < et = o.massa06 9. (a) In(o-+2) = 0.60549038-+ 049905012" ~0.14334600? +0,019000732? @) Ue 10. 0 = cos(5x/6) = sf, = 0.08125000 V3/2, 21 = 0, 22 = cos(n/6) = V3/2. (-0 (2-8 -e (+8) (e-¥#) 0+) 0-8) eet ees (a) (2 AL. (a) cos(ar) = 0.469520872? (oy UO weal = oassstz0 12, (a) e* 1+ 1129772082 + 0.532041802* (b) el < fel — o.1s326174 18. The error bound for Taylors polynomial is [f(a) e Taalz) = Lna(z) {sin(1)| at 0.00002087. 4.5, CHEBYSHEV POLYNOMIALS (OPTIONAL) or ‘The error bound for the minimax approximation is: (sea) 27(8!) {sin(a)| _ (al) = 0.00000261. 14. The error bound for Taylor's polynomial is: «7 a th Lol al = 0.00016696 ‘The error bound for - minimax approximation ist L(@)] a .00000261. 15. The error bound for Taylor’s polynomial is [£(@) ge < Gp = 200000742 ‘The error bound for the minimax approximation is: (2) et et ol < Jer = 0.000000853. “Fey Fay 16. » x DONT (en) = Yoon(érs) eostjne) io co = YD Hleoslti~ zn) + cos + j)) ms Assume i 4 j, Thus: Case 1: If N is odd, then cos (ir ngette n) =~ cos (ere 14,) fork =0,1,...,N. A Therefore, in this ease jar result occurs for the term cos((i — j)z)- x x LMI) = LY Heoslli jae) + cosl(é + j)xe)) Caso 2: The ease when, 68CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION AT. When i= j #0 x x DME (an) = YL eoslize) cose) eo = C1 =D Feo (+ san) + c(i J)20)) a ei = YL Fleos2ian) + c0s(0)) 2k+1 ig deo (we) 44D) | Ne Ned = 04 Nth_ Net 4.6 Padé Approximations A. 1 poy Las = prs 1/24 = 0, a1 = 1/2, m1 = 1/2 = Byala) (0) 1 Po -1/24 = Py $= $= 0, 4 = 2/3, 1 = 1/6 BEE » Rya(e) = EE () e+) = aha 3 @) lm, $+ Bam RIF =00=-Fm= se By, (b) WMS Be chen ftan(r) | 15-2? 2. 15 6a? = 1sr FESS = Roale) tan(2) x (@) 1=po, -3+a =P §-F=On=hm=H arctan(x!/?) at ge’ sctanle) ae (b) aarctan(1) | 15 +42? z 15+ 9x 5a + 40% actan(e) = TEE '3.2(z) 4.6. PADE APPROXIMATIONS 69 © ae #+# (Se) 5. (a) L= po, Lt ar = pay 1/2 4+ 41 + a = Pa, 1/6 + 41/2442 =0, 1/24 + 1/6 + 42/2 = 0 First solve this system: eG H+E4$ = 0 = -1/2, m= 1/12, m1 = 1/2, p= 1/2 em Rags) = EERE, (b) HEHE = 1+22(s&n) s(t) ore ny 1/3 ~ 91/24 92 = Pa, -1/4 4+ 01/3 - u/2= (0. Solving the ast two equations for gy and a yields qn = 6/5, 42 = 3/10, p ~7/10, and pa = 1/30 () 304212 +2? 10+ Br + Oa” ints) then 004207 +28 In +2) = 30 abe + On? (8) 1 = po, 1/3-+q0 = pa, 2/194 1/84 92 = poy 17/315-+201/18-4q2/3 = 0, 62/2835 + 174/315 + 292/15 = 0. Solving for 9, and q2 yields 4) = 4/9, 92 = 1/63, py = “1/9, 99 = 1/945, tate? ee ir i TOCHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION (b) tan(z) 945 ~ 1050 +2? 2 M5 FF Tet SAB — 105042" ny ay 945 — A027 + That = a (c) Recursively dividing yields the quotients: tan(z) © ee ea = 16798369500 212900 | __ soma (SEER — 2442) ‘“* pesan0e7 * TanaT © ~~~ j9987 3807380 ‘The continued fraction form is: 1 at a Mate 8 (a) L= po, 1/3 +91 = pr, 1/5 — 41/3 +42 = pa, -1/7 + 41/5 - a2/ 0, 1/9~4,/7+92/5 = 0. Solving for g; and qo yields q, = 10/9, a Rsalz) =a + 5/21, pi = 7/9, pe = 64/945 arctan('/?) _ det fhe? (b) Substitute 2 for 2? in the result from part (a): arctan(s) 945 +7352? + Gat = 945 + 105027 + Dana arctan(r) ® Rsa(z) 94527352°6425 945 + 105027 + 2050 (c) Recursively dividing yields the quotients: Ge | O7r 34960" as’ ® — Tog" ® = 56205 390000257 2916" agove2s °° ~ 31225 ‘The continued fraction form for Rs,4(2) is a % Boalt) =a + 4.6. PADE APPROXIMATIONS a 9, Note: et = S22» #. From formula (5) we consider: ee (art SHE tt tars ae? +990") (pot niet p22? + ps2"). Matching; common terins yields the linear system: 1-po 0 lta-m = 0 1 ptata-m = 0 dada + 0 Gtpntatonps iii Hiintjeta = 0 toa aa Totyntgntye = 0 mae mtmetEetin = 0 Solving the last three equations firs, yields 1 = —4, 2 = qh, and qs = rfp. Substituting these values into the fist four equations yields py = 1, Pi = $, P2 = 5, and ps = yy. Therefore, Lt des dye? + hea? ihr ae 120 + 60x + 122? + 33 120 = 602 + 122? ~ 28 Rea(z) 10. Note: e* = fq ¥. From formula (5) we consider: (tes Rt E+ H+ tartan? tera) ~(p0+ m2 + to2? pa + pat) Matching common terms yields the linear system: 1-po 1+a—p 1 ptatm-m = 0 et gtyuteta—m = 0 ‘72CHAPTER 4. INTERPOLATION AND POLYNOMIAL APPROXIMATION io tgutgetwtunm = 0 ft pry t ge tynta = 0 Le dnt tot teed ° atant yet getgu = ee 0 atgnt ge tye tae = Welles ie gtant get gmt gm = 0 Solving the last four equations fst, yields ¢) = —, go ~ dy an = —Zry and ge = rd, Substituting these values into the first ive equations yilds Po=1, p= 4, pa =, Po= gy and pa = yay. Therefore, Ltdet So 4 dota Real) = ifr ge 3 tee 1680 + 8402 + 1802? + 2077 + 24 1680 — 8402 + 180? — 2073 + xt Chapter 5 Curve Fitting 5.1 Least-Squares Line 1. (a) Solve: 104 +08 04452 y=0.7r + 2.60, Ba(f) = 0.2480 (b) Solve: 80A +08 04458 y= —0.6r + 3.40, Fa(f) ¥ 0.2828 (6) Solve: 30A +08 0A+5B y=0.7—2, Eo(f) 0.1414 2 (a) Solve: 404 +0B 0A+5B Ey(f) ~ 0.8958 804+0B OA+5B y= 0.792 ~ 1.26, Ba() ~ 0.5299 (©) Solve: 1204 +08 04+ 5B 585r + 2.64, Ba(f) ~ 0.6488 B B12 63.2 6.3 15 132 4 CHAPTER 5. CURVE FITTING 8. (0) Dea eme (DM, af = B= 07, y= 0.77, Balf) 0.2049 (b) Da tam /DlL ak = BF = 0.574, y = 057Ar, Bal f) ~ 0.0756 (©) Shazam /Dha ak = ABP = 1.58, y = 1.582, £a(f) 0.1720 4. Use the second normal equation (fy 24) ARNE = through by NW, and obtain A (3 572, %)+B=$5) AE+B=9. tn and divide 1. Therefore, 5. In (10) the sum of N times the first equation and ~ S28, zy times the second equation is: N N = N N »(Sa)4-(Sa) A=NYnn Sonu ei 7 ties Thus A = NYS tem Df me SM we (Chaz) - (Sham) B (NOE sem ~ DM DN we) Substituting the expression ‘or A into the first equation in (10) and solving for B yields Diase (NDE tee ~ DN DP we Ekim - _ PEM NEM ON same + (DMs ae) Oka Nv "7 2B NYE ae Oh aos = b (Chime Si-O SE ran) NOM (te-B? = NYDN (eh - 2ru7 +7) = N(CMie- 2D tO, = ¥(dtad-$(Ctin)'+# (OlLa)) = NEM at-(Ohia)” =D 5.1. LEAST-SQUARES LINE 5 Clearly D = NEL, (tn)? > 0 since N > 2 and the abs are all dlistinet. 7. To find the least-squares line ¥ = AX for the data (Xe,Ye}fl, frst minimize F(A) = TfL, (AX — Ye)?, Solving yields Making the substitutions X_ =x, ~7 end Ye = ye — 7 yields Tha@e-~Dim-D _1 A= LY ee — 2 - Sea OL MD ‘To see that this is equivalent to the result obtained for A in Exercise 5 ‘make the substitutions indicated in Exercise 4 to obtain A = $Yii(e-A(n-7) NDE ena set = MO In Exercise 4-it was shown that (Z,J]) ‘ies on the least-squares line y = Ar+B for the data points (7%, ye }juy- Thus J = AF+ B or B =H AT. Therefore, the expressions given for A and B in Exercise 7 are equivalent to those given in Exercise 6. 8. (a) y= 1.68660, Eyl) 13 50022°, Ha(J) = 0.29 The best ft. G1TT2?, Fa(f) = 0.859 The best fit, 5606", Ha(f) = 1.165, 9. (a) y= S882, Ba(f) = 0.034. The best ft 2, Ba(f) = 1.189 (b) y= $88, a(f) = 1.082 yASEE, Ea(f) ~ 0.035. The best fit 6 CHAPTER §. CURVE FITTING 10. (a) Given f(2 E(A)= lr and {rk,ye}{-2, minimize fea (Ate ~ Ye) SR = Dh 2ee (Are ~ ye) 2 (D0 Arf - DN ram) Setting QE/AA = 0 yields the single normal equation: (Es) A= Sou (b) Given f(x) = Ax? and {2e,ye}%_, minimize F(A) = Soh, (A2f—m)*- BE = Di 2h (Arp -m) = 2(DMi 4et - DE zt) Setting 9E/9A = 0 yields the single normal equation: (Ss) A= dan fet (©) Given f() = Az? + B and fru, ue}, minimize E(A,B) = D8, (Aah + B- yn) Tikka 28 (Azh +B ve) = 2(DEi Ard + DM, Bef - DLL, atu) $= Dhi2(Aef+ o-m) = 2(0Mi 4g + D8, B-DN we) Setting E/0A 0 an AE/0B = 0 yields the normal equations (Chiat) 4+ (Chast) B = Chale (chisi)Atae = Chive lL (a) Fir, 00 Ew limp Din Eine (a) (hey nan 5.2. CURVE FITTING (b) limgacoty = lino OE = bir (os) (isan) ‘To show that j= 1/3 use the Mean Value ‘Theorem for Integrals: 1 2 f 5 Figo Dita ((b~ a) +0) = Hirigcor ((25#) (2442) + 0) 1 a Tir oo EN tontige tee ttn = lithnwo Dhha f ((b- a) +0) = lin cope DEL J ((b- 0) +0) (22) tty cw Sohan F ((b— a} +0) (234) 2a Je S(2) de =a 5.2 Curve Fitting 1. (a) 164A +200 [a 208 vue de ted 2A=4C ) 164A + 200 5 208 yn Bt oe 20A+4C : 2 (a) HAyI0C = -248 1B = 108 y= —1.92" + 1.08¢ + 3.98 WA+5C = 09 CHAPTER 5. CURVE FITTING (b) 108 WA+5C = 25.65 P 4 2.18r + 3.13 [verte () 10B WA +5C { MAC = = 2 1SALSB — gi515, 3 4=0-7475, B= -1.0123, Ce = 0.3634; y = 0.363109%470r ” { G.1993A+4.7874B = 8.9366 (a) { S5A+15B 25.9297 A7874A45B = 6.1515 §4= 18859, B= 0.5755, C= 0? = 05025; y = 0.562509 (6) tw part (a) Ff) = 1.2723 and in part (b) Ba(J) = 04761 A+SB = —08647 “ass @{ Sa o8 = TOSOT 4 = -osons, B= 13004, C=? = 3.8065; y = 3.8685" 08082 1GA+5B = 5.1619 | = w { BALSB nis) 1A= 0.2482, B= 0.028; »= ym IE (6) In part (a) Ha(f) = 0.1192 and in part (b) Za(f) = 2.1663, (@) (3) y = 3.053614" (Gi) y= 2.899521 0386 (b) @) y= (.75732+0.7845)-? ii) y = (0.5777x + 0.8499)? (©) In part (a i) Ea(f) = 0.0041 and in part (a ii) Ea(f) © 3.4097, In part (bi) E2(f) ~ 0.8195 and in part (b ii) Ba(f) = 0.0767 (a) Using linearization: y = rere ‘Minimizing least square: y = linearization: y= 5000 (0) Using inearization: y = ye pEO perro Minimizing least squase: y~ Tyagtrerrere linearization: y= a (0) Using nensizations y = 77788 pass, PO} lioins) Minimizing least squares: y= > 7-800 ream, P(10) = 808.6 (millions) 386.3 (anil- 5.2, 10, u. 12, 28, 4 15, CURVE FITTING 0 sing Hinenrization: y = 00 - (mil ) | ation: y = Typ tMlorrerer: PCO) = 284.6 (mil Minimising lent squares y = --yqe8- rem, PUO) = 2842 (aillions) A+B. Use the change of variables X = 1/r and Y = 7 to’get AX +B. y ao ad 2 Use the change of variables and constants X = ry, ¥ = y, A= —1/C and B= D/C to get ¥ = AX +B. 1 = AeTB = arte Use the change of variables X = x and ¥ = I/y to get Y = AX +B. Uy = spe, then 2 = 4882 = (1) +B. Use the change of variables arand Y = Iy to get ¥ = AX 4B. Substituting X = In(z) and Y = y ito y = Aln(x) + B yields ¥ = AX +B. Cz4 In(C) + Inf) In(C) + Aln(x) y In(y) In(y) Use the change of variables and constants X = In(z), ¥ = In(y), and = In(C) to get ¥ = AX +B. Hy = (Az +B), then y-¥? = Ar —B. Use the change of variables X=rand ¥=y""/? to get ¥ = Ar +B. y = Cre In() = in(cy— Y = Bar Y = Arto 80 CHAPTER 5. CURVE FITTING 16. (a) To minimize E(A,B) = DN, (Acos(ey) + Bsin(re) — ye)?, first find the partials with respect to A and B: & Setting the partial derwatives equal to zero yields the normal equa- tions: Cher 2(A costs) + Bsin( re) — yx) cos(ze) Sipe 2(Acos(ze) + Bsin(r4) ~ m)sin(a) wa (ZR c0s4(en)) A+ (SNL, cose) sin(xe)) B hi we cos(ze) (Xf, eom(ou) sin(wa)) A+ (ON sin*an)) B Char vesin(7) (b) f(x) = 0.4998 cos(r) +2.1541 sin(r) 17. First take the partial derivetives of E(A, B,C) with respect to A,B and c: BB = Deidre + Bat C — x)e BB = Dh WAAre + Bye + CO — ze) gh = 2% Ary + By, + C ~ x) Setting each partial derivative equal to zero and using the properties of finite summations yields: (Chi¥) A+ (Chita) B+ (Ohan)O-Vk ase = 0 (CMa sam) A+ (Ohiwg) 8+ (Ck w)o-Lki mere = 0 (Chis) 4+(Ohim)B+ER,c-Dhia = 0 or (Cis) A+ (Chim) b+ (Oka) = Cian (Ctism) A+ (Chi) B+ (SMiw)o = Dime (Shi we) A+ (Chim) e+NC = Cia 18. (a) MA415B+8C = 82 15A+19B+9C = 93 BA+OB LSC = 49 A= 24, B=12,C=38: 2=24r 41.29 +38 5.3, INTERPOLATION BY SPLINE FUNCTIONS 81 (b) 15A +198 +3C MA+15B+8C = 8A49B45C = 16, B= -12,C=72: z= 16r~1.2y +72 {c) WA+12B+9C = ~7 WA+UB+IC = 3 9A+7B+5C = 0 A=~-22,B A, C= 2.0: 2=-2.2r—1dy +2.0 19. For the first function Fa(f) a: 5.689605 and for the second function Ex(f) © 25.151736. ‘The second funetion has a vertical asymptote be- tween 4 and 5, 5.3 Interpolation by Spline Functions 1. (a) Making the substitutions $(1) = 1, $"(1) = 0, $(2) =2, and $"(2) O into $(z) = 09 + a,x +092? +agz8 and $"(1r) =a; + 2are + Saga? produces the system Ay +0; +03 bay ay + 2p + 3a, 4g + 2ay + Aaa + Bag ay + day + 12g (0) a9 = 6a; = ~12a2 = 905 = -2: S(x) = 6122 + 92? — 204 2. (a) Making the substitutions S(1) = 3, $'(1) = —4, $(2) = 1, and S"(2) into S(x) = ag + az + age? + aszr° and S'(x) = a + 2agr + 3agr* produces the system 9 +0; +42-+05, 0, + 2a — Bas ay + 2ay + dap — Bag a; + 4a + 12as (b) a9 = 5a; = 2ag = —Gag = 2: S(x) = 5+ 2x — 62? + 208 3 (a) Cubic spline {b) Part IIL not satisfied: $9(2) # $4(2). (c) Cubie spline (a) Part IV not satisfied: $5(2) + (2) 82 ho = 1, hy = 3, ha = ho = Ly hy = 3, hy = 3; do = 2, dy = Ay dy = —2/%; uy = 18, CHAPTER 5. CURVE FITTIN 2, dy =, dy = ~2/3; uy = 18, u = —10 ee a ‘Then mo = ~460/101 and ns = 856/303. ‘The cubie spline is, one {Bm tm 2 ve f 3m + me Sof) = B(x +3)° — BO(r +3)? - (243) +2 2 [-3,-2] Sila) ed ~He+2) ce [-2,1) Soa) = Be —1)°- He- P+ ge) 43 re ltd) hho = 1, hy = 3, ha = 3: do = —2, dy = 1, dy = -2/3; 1 = 18, 1 = -10 saive { one gre = 18) to get m; = 82/29 and img = ~184/87 Set mo=0= ms. The cubs spline is Sola) = Be +3)— Br +3) 42 re [-3,-2] Si(x) = Hr +2) + Bet 2)?-Bee+2) re [21] S2(2) = Hle- 1) - Ble -1)2 + Be-1) +3. ce ft] fo = 1, hy = 3, ha = 3; do = ~2, dy = 1, dy = ~2/3; 1 = 18, up = —10 Bm tim = 18 Solve Om: + 18m, 19 >t get m= 263/126 and m2 = -5/9. ‘Then mo = 187/63 and mg 403/126. The cubic spline is Sola) = ~ Bh (+3) + oe re [-3,-2) Hilr+ 29+ Bers 2P—-Hesy re l-2,1] Be - 8 - Ae + Be-1)43 re l1,4) 0 Solve { Pm tne = wo got my = 25/11 and rm = ~9/11 ‘Then mg = 25/11 and mg = -9/11. The cubic spline is ee re [-8,-2] = ((-H(e+2)+ B) (@+2)-B)(e4+2) ze f-2,1) a eo re [l.4] hay =1, hy = 8, hy = 8) dy = —2, dy = Ay dy = ~2/35 01 =28, ‘im +32 — 19 sare { seat = 1g to got om = 92/29 and mz ‘Then tig = $"(—3) = —1 and mg = $"(4) = 2. The eubie spline is 5.3. INTERPOLATION BY SPLINE FUNCTIONS 83 (ie (e +2) + $8) (@+2)- PB) (e422) re [2,1] ((@ — 1) - #8) (@- 148) (@-1) +3 ve [1,4] . (a) ho = 1/2, hi = 1/2, fin = 1/95 do = ~3, dy = -1/8, dy = 1/35 uy = wef Pmtim = 4 = 2 1B, va= 4 Solve | Ene De = tect my = Zand ma = 1, Then mg = 28 and mg ='2. ‘The cube spline is | Solz) = ((-1(n- 3) +B) (e-4)~B)(e- +8 ee [4] le H@+3)-B)@+3)42 re -s,-2) Sez) =((-H@-)+1)@-1)-N@-)+3 rely, Sule) = (3 (2-3) +) (E- H+ (@-H)+F ve [9,2] () save { 3 my toma = 47 80.868 m = Sand mz = 0, Then mg = 8G1/2) = 0 and ms = $"(1)2) = ). The cubic spline is [ste 2) +0)(@-})-7) (2-H +E re [hay a + FE Wn Siz) = ((-He-1) +4) (@-1)-9)@-1) 43 re [1,8] Sal) = ((5 (#3) +0) (@- 3) +0) (3) + Fre [9.2] 10. (a) ho = yr/2, by = /Bn]2~ VAP, ho = BRB — TRIB: do = VFR, dy = 0, dh Op = OYE tn 0 Solve 8.714959, +0.917490mg = 7.181061 0.917490m, +2.782252m, = 16.849736 to got my = 0.479571 and my = 5.884950, Then mo = ~2.149645 and mg = ~29.561425. The cubie spline is So(x) = ((0.349635x ~ 1.074822) 2 +0) 2 +1 26 (0, V9] Sule) = ((nsuiois GvR 0.239785) (e— VF) rel[VB sa(a) = ((-0.30008 (2- J) +2017) (2 VB) sista) (2— YB) re [V5 V9] CHAPTER 5. CURVE FITTING (b) Let mo = $"(0) = 0 and sng = $"(/572) = Solr) = ((0.289785r ~ 0.808060) 2-41 Ze (0, /¥] S.(2) = ((2.702600(x — /¥) + 0.239785) re Coheed | (Vv) 2¢[vE-y¥] Sa(a) = ((—2.042495 (2 - 9F) + 2.942474) (2— VF ~1.230158) (x /3F) re [VE V¥ Sale) = FH eer ~ 2)? + pt (eau) + (PE PE) (en — 2) + (iat — mage) ay) = BE (3 @— 20) + 3h (e— 24)? - em) +E (x — an)? + (JE - BHP) (nee) (HL — mate) oe a ‘The spline has the form: + Sele) = sho + Sino ~ te) + Seale — 24)? + sual —ae)® ‘The coefficients sx, are now determined: 2 First, TEN + BE w= 0 Second, ~ GH (8ni) — f+ Maya 4 Wen — Maat oe he ma oy hing Se Third, GA (Bhs) = BR = ast, ge + My = es =a), 5.3, INTERPOLATION BY SPLINE FUNCTIONS 85 12. (a) si seal — 84)? + Seale ~ ax)? + seale ~ 4) + unde = SE — 2) 4 BEC) 4 S58 2)? + yal —a) EE Ah (eer — ta) + $2 ee ~ 24) + EA oeg — a)? tueleees ~ 24) = (Pe + 292) he + SA) ha te) ig (b) Sp Ste) de = 5.054688 (©) °"? s(a) dx ~ 0.80749 13. When & = 1 (12) becomes hong + 2(ha + hi) + hymna = ty Substituting the end-point constraint my = (do ~ S"(x9)) — 3 into this equation yields ho ( (da ~ $"(20)) — 3) + 2ho + ha)ons + Rama = my (= ho + 2(ho + hr) ma + Aime =m ~ 3(do ~ $"(x0)) (Bho + 2h) my + hyn = uy —3(do — $"(z0)) Similarly, letting & substitution my = 1 in (12) and making the end-point constraint (S'(aw) — dy) — 7351 yields Ay amnaa + 2hw-a + hy-s)imya +hnaa (wy(S'en) = twa) 2) 3 hy-amn-2 + 2hwa + Shw—1)my 1 = tna — 3(8'(2y) ~ dv-1) ‘Thus solving the linear system in Lemma 5.1 yields mi, may...) mya. ‘Then m; and my_y are used in the corresponding formulas in Table 5.8 (3) to solve for mo and my, respectively. 14, When & = 1 (12) becomes homo + 2(ho + ha) + hyrng = uy 86 CHAPTER 5. CURVE FITTING Substituting the end-point constraint mo = my ~ *2™%="4) into this equation yields fo (m= AAD) othe) ima a (80 +26 +98) m+ (1s HB) me = is Similarly, letting k = N —~ in (12) and making the end-point constraint yay + 2(hy_2 + hy —1)my—1 Hho (my an + Meanieiaen=ma?) a ) gaa =n ‘Thus solving the linear system in Lemma 5.3 yields mm, mia, ..., m1. ‘Then rm; and mg, and my-2 and my are used in the corresponding formulas in Table 5.8 (iil) to solve for my and my, respectively. 15. (a) Given f(z) = 2° — x we note that f(-2 11, and #“(0) = ~1. Thus we sock the clamped cubic spline S(z} ax + be? + or +d with derivative $'(2) = 3az? + ke +c that satisfies the coustrains $(—2) = -6, $(0) = 0, S'(—2) = 11, and ‘5"(0) = =1. Substituting the constraints into S(x) and S"(2) yields the linear system 8a} db 204d a 12a-4b-+e with solution on [2,0]. (b) Given f(z) = 23 — 2 on the interval (~2,2] consider the clamped cubic spline $(2): { Solr) <1,d=0, Therefore, S(2) = f(z) aga! + bye? + coe dy [H aur +h2? Herr do (0,2) Sulz) 5.4, FOURIER SERIES AND TRIGONOMETRIC POLYNOMIALS 87 © It is sufficient to show Sp(z) = f(z) and $4(2) = f(x) on [-2,0] and {0.2}, respectively. For So(z) the constraints $9(-2) — 6, $9(0) = 0, $5(-2) = 11, and ${(0) = 0 yields the linear system: Bag + Ab — 2eq+ do = 0 dm = 0 Tap ~ 4g ey = 11 2p = 0 with solution ay = 1, bo = 0, co = I, and do = 0. Thus $o(2! J (2) on the interval [—2,0]. A similar argument shows that (2) ‘J(z) on the interval [0,2]. Therefore, f(z) = 13-2 isits own clamped ‘eubic spline for the given nodes over tive interval [2,2 First genralize the results in parts (a) and (b) to any third-degree polynomial on an interval [a0], As an induetive hypothesis assume that every third-degree polynomial is its own clamped cubie spline ‘on an interval [a5] with k nodes. Then using the generalized results from parts (a) and (b), and the in¢uetive hypothesis show that every third-degree polynomial is its own clamped cubic spline on an interval [a,0] with & +1 nodes, Therefore, the statement is true for any interval [a,6] with NV nodes. (4) In gencral the statement in part (¢) is false for the other four type of 5.4 Lf cubic splines. Fourier Series and Trigonometric Polynomials = 4 (sin(z) + $ sin(Se) + 2 sin(Sz} + $sin(72) +---) 2 $(2) = 4 (cose) + dy cole) + Ze com) + 2 con?) +---) 3 194d (BA) own (22) anes 4. f(x) = $ (cos(x) — § cos(3x) + 3 cus(S2) — Leos(7.r) + ---) 5. f(a) = 4 (sin(e) - rsin(Sz) + Jy sin(Sx) ~ Jp sin(72) + ) 6. From Exercise 1: fee)=4 (snte) + Fsin(Be) + Zsin(Gn) + $sin(72) + ) . 88 CHAPTER 5. CURVE FITTING Letting x = x/2 yields f(n/2) = 1. ‘Thus 1 = (sin (g) + bon FF) + bin (38) + $sin GH) +) Lagada de 7. Froin Bxercise 2: S@)= $ (cone) ++ ypCos(ba) + Zp con) + dy conte) + ) . Letting x = 0 yields f(0) = 1/2. Thus B= $ (con) + Jeeoss(a)) + dy con(5(0) + Je cos(70)) +---) Bon lektde dee 8 H(2) = Fy —con(a) + fr n(2e) — dp cos(te) + conta) 9. If g(x) has period 2n, then a; = 1 J", g(a) cos(ja)de for j = 0,1,2,--. Let r= ft. Thus a; = 5 I" 9 (Bt) cos (4) (#) at = $S2 p49 (Bt) cos (284) at Let f(t) = 9 (Bt) a function of period 2P. 4) = BLE, S(O) cos (4) at Let t= (dummy variable} = BLE p se) 008 (#4) ax Similary 6, = p {Ep f()sin(jnx/P)de for j = 1,2, 10. f(@) = x (wae) (222) 1. a = } oy = (sn) +(2 a) by =F (cos (HF) — cas(sn)) 2 po=0+ 95 (S OP os oon (#2) 5.5, BEZIER CURVES 89 13. The function f satisties the hypotheses of Theorem 5.5. ‘Thus f has a Fourier series expansion: f(z)= wie + D(a; cos(iz) + by sin(jz)) In addition, f(—2) = f(x) for all x € Dy. Thus f(z)sin(j2) is an odd function and mo peratieee=o since the integral of an odd function over an interval symmetric about the origin is zero. Therefore, + Ya; cos(j2) ro F(z) sie 14, The proof of Theorem 5.7 is similar to the proof of Theorem 5.6. 5.5 Bézier Curves 1. Boalt) = 61 ~ 1208 + et Bs s(t) = 10t ~ 20¢4 + 101° exit) = 21 — 4048 4 2107 2 (1) Biwa(d) + tBeaw-i(t) =a-9( "7 Jeo -oNe( Wop )ta-o = (PF ea more (953 Joao (48) (IEE) =(2)e0-or 3. Note: The binomial coefficients are non-negative, and t* and (1 — t)*~* are non-negative for t € [0,1]. Can also be established using forsula (4) and mathematical induction. 4, Dice Beal) = Boa(®) + Bralt) + Boalt) + Bos(t) = (1-1) +31)? +3048 =1+(-343)t+ 8-6-3) +(-143-341)8 =1 Bun(t) 90 CHAPTER 5. CURVE FITTING Ee Boslt) = 5(Baa(t) — Boalt) = 5(64%(1 — t)? — 401 -)) $B s,s(1/3) = 80/81 and 4By,5(2/3) = 40/81 gan) = (7 )ea-oy " (4) tao ova 9 1ay (20-09 eran . ( “ )era 15 = ve) On the open interval (0,1), BYy(t) = 0 when t= «/N. Since B,y(0) = 0 = By,w(1) and B,x(i/N) > 0, the maximum value of the Bernstein polynomial B,,y(t), on the interval [0,1], occurs at t= i/N. z Bult) = ¢ 1 yt " -( ( Cayo ia Hern ) ) seta = nareonenn N 8. (a) P(t) = (1+ 6t - 9? +50, 3 — 120 + 271? — 1804) (b) P(t) = (24 at + 18e? — 2809 + 1074, 3 + 120 ~ 2008 + Bet) (6) P(t) = (1+ 5t, 14 5t + 108 — 300 + 15¢4) 9. P(t) = (14 3t, 1461), 10. By Definition 5.5, 0 ifn 0 if#N-1 Barwa ( TE y and Biwye{ PEN} Thus PQ) = YOPN(Bi1wa(1) — Biw-i()) Ss = MPy -Py-1). 5.5, BEZIER CURVES 1 LL, Note: by Definition 5.5 Bean {9 125. Bawato= {9 12} 0 G40 and Be-at0)={ 1 ico ‘Taking the derivative of P'(é), evaluated at ¢ = 1, shown in Exercise 10 above, yields Pry = DP (Fi sat) So, 0) w = OPAN(N ~1)(Be2.n-2) - Beaaw2(1)) (N= 1)(Bi-1,y-a(1) ~ Ban) ” = NN 1) 9 P\(B-2,y-2(1) ~ Bea.n-a()) ~(Biax-2(1) ~ Biv1())) = N(N ~1)((Pi— Pi) - (Pi ~ Po) = MN ~1)(P2 ~ 2P: + Po) 12, (a) The line segment (including endpoints) with endpoints (1,1) and (7,~3) (b) The parallelogram and its interior with vertices (~4,2), (3,5), (2,8), and (1,2). (©) The triangle and its interior with vertices (0,0), (0,1), and (1/2,0). 92 CHAPTER 5. CURVE FITTING Chapter 6 Numerical Differentiation 6.1 Approximating the Derivative 1. f(2) = sin(2): Find approximations to /'(0.8).- hey Bor ‘Truncation Error 0:1 | 0-605540712 | O.0OTTUBUT | v.00rzTATsT ‘0.01 [0.596695 100 [0.0000TT60o | v.oo0012747 ‘o.007 | 0.696706600 | 0000000109 [.dom000I7 2. f(x) = e*: Find approximations to (23) [fey Error Truncation Error OT | 9.990814405 | —0.0TS63T050 | O.0TSSTIV6T (0.01 _["9.974348950 | —0.000166495 | 0.000183720 [0.007 | 9.974184000 | —0.000001545 | 0.000001837 3. f(e) =sin(x): Find approximations to (0.8) [Fey Error ‘Truncation Brror ‘O:1_| 0,696704390 | 0.000002320 | 0.000002322 ‘0.07 [0696706710 | —0.00000000T_| 0:000000000- 4. f(z) = €*: Find approximations to (23). a [Vey Error Truncation Error ‘O.1 | 974149167 | 0.000083288 | 0.000040608 (0.07 ['9.974182750 | —-0.000000205 | 9.000000004 {a) f"(2) = 12.0025000 (b) f"(2) ~ 12.0000000, (¢) Por part (a): O(H8) Por part (b): O(h (0.05)? ((e)/6 = -0.0025000. (0.05)*/°(c)/30 = 0.000000. 93 94 CHAPTER 6. NUMERICAL DIFFERENTIATION 6. (a) Taylor's Theorem appiied to f(z +h) expanded about zo = yields thas fern apt Heth = So Pie that CO When n = 1 this yields ee peg fig = Foye rons Le where [r= ¢ _ ae = 8 ee GH” Sabatttingh = (3) "into 9") = Bee lf vicasa” ((#p)"”) > By > oF 0. Thorefore, by the second derivative test, g(h) haw a minimum at i n= (#) (b) Let a(n) = $e + MG. Ten Be, 2Ma® — —45e 4 4Mn 90) = 953+ 5 = Son 96 10. u. 12, uM 16, (a) Formula (3) (20) given 1"(1.2) = (b) Using differentiation rules from caleulus, obtain I'(1.2) CHAPTER 6. NUMERICAL DIFFERENTIATION Solving 9/(h) = 0 yieles Substituting h = ( (fi) 45 aM 30K o e+ 4Mh> = 0 a= (4H) ye into g"(h) = 35+ BAPE victds gf! (a 0. Therefore, by the second derivative test, g(h) has a mi 13.6824 and E(1.2) ~ 11.2975. and £(1.2) © 11,2976. jum at s1’(1.2) = ~13,5840 and B(1.2) 11.3024, Formula 6793 | Numerical differentiation formulas (3) and (10) yield D’(10.0) = 4.4205 and Di(10.0) a 4.4248, reepoctively. Differentiation rules from calculus vvield D’(10.0) = 4.4248, (a) (b) bain RK [® FC) | Brrr | round-off-erancationl 0.1 [=0.83050 | — 0.00754 | 0.00005 + 0.00161 = 0.00106 (0.01 _|=0.93200 | —0.00004 | 0.00050 + 0.00003 = 0.00052: 0.007 | =0.93000 0.00500 + 0.00000 = 0.00500 i Error | Tround-offf-]irancation] or = 0.00012 | 0.00005 ++ 0.00014 = 0.00019 0.01 =0.00017 | 0.00050 0.00000 = 0.00050 0.007 0.00167 [0.00500 0.00000 = 0.00500. Maximize E(t) = 2928 +2.5h?. Solve £'(h) = 0 and obtain h = 0.1 Maximize E(h) = 29873 + Q05K4, Solve EY(h) = 0 and ol h = 0.827196. BTS FU3) | Brot] romeo [erameation] 0.1 =0.95906"| ¢.00002 [0.00008 + 0:00000 = 0.00008" 0.01 | 0.93208 | 7.00004 [0.00075 + 0.00000-— 0.0007 ‘8.001 | =0.92917 | —0.00287 | 0.00750 0.00000 = 0.00750. 6.2. NUMERICAL DIFFERENTIATION FORMULAS 97 16, %__[ =F G0) | bron Tound-off [truncation] 01 [03 7.00000 [0 00008 + 0.00000 = 0.00005 01 | 0.33350 | 0.00077 (0-001 | 0.35585 | —0.00250 | 000750 + 0.00000 = 0.00750, 6.2 Numerical Differentiation Formulas (a) (5) = ~0.040001600 (Bb) "5 (c) "(5) = ~0.039909833 (4) "5 = 1s? 2 (a) £1) = -0.540190000 _(b) f""(L) = -0.539852200 (©) $"(1) = -0.540301667 (4) F(t) = -0.540302306 ~ — cos(1) 3. (a) £5) = 0.0000 (b) f""5) = 0.0400 (©) £5) = 0.0138 (4) #”"5) = —0.0400 = ~1/52 4 (a) £%(1) = -0.5200(b) f"(1) = 0.5400 (6) P11) = 0.5133 (4) F"(1) = 0.5408 ~ ~ c0s(1) 2, #1) = 2.0000 4, f"(1) = 12.0002 #1) = 12.0000 8, f"(1) = 29.9902 Sle+h)= f(a) +g) + 2L@) , Be Sl —) = Ja) nya) + EL) _ SEO S(e+h)— fle—h) = 2nf"(a) 4 LP , WM) Similarly, (or substitute 2h for h in the previous equation) S(e+2h)— (22h) = ang'(e) + BELMG) , case) a oF Then S(e+2h)-2f (r+h)+f(e—h)— f(e—2h) = CHAPTER 6, NUMERICAL DIFFERENTIATION Now solve for f(z) and got p00) — LEH 2) ~ OF 8) + 2f (a — hy ~ Se 2h) _ HPF) + mae 7 fant e=. g(81(2)(—n)* fet =P OO pen Poet i = Substituting 2h for h in the two previous expressions yields: eer See Jet 2n) = SLO 5 ay) SMH ‘k=O a bend a Then w+ 2h) —Af(a-+h) +6f (2) — 4 f(x —h) + f(e—2h) = HAG) (x) + O(R) ‘Thus 410 (0) = LEH BN) — she) + Bie) = f(r — h) + f(@— 2h) =F eile) Co, ons] — [oo apossi0. (@) [or Conaisis] (for =o00re oz | —o05m] [OX] ~0.900085 os fos] — [os | —0.990805 We are given, as approximations, that the points (z+ h/2, "(x + h/2)) and (x ~ h/2, f'(¢ ~ h/2)) lie on the graph of "(2). ‘The slope of the tangent line at « can be approximated with the slope of the secant line passing through the two given points. Thus I") thee ~ “GERM —W = Let yD) pie =nj2) = 2fo + I = fathtls 6.2. NUMERICAL DIFFERENTIATION FORMULAS. 99 Ll, Let to = 2, =2-+h, and ty =24 3h, Then and = Qlo=3h +f) or Thus £2) = ay +a,(x~(2+h)) = 28fle) + 9f(e +h) ~ f(x + 3h) 12, Let to= 2, ty =4—h, and ty =r +2h, Then and ‘Thus 100 CHAPTER 6. NUMERICAL DIFFERENTIATION f(z) = o+a:(e-(2—A)) oe fof) , =Bfo+ 3s +h = Saath he = MG) lent foam 13. (a) pie) + fa) = BEAotha, we Th 2fi = Afo+ 2f-a + hf — hha a +N) fi = 4fo+ (2= A) fa nF ' 4 (b) La) + F@) = ‘fo = 1Ofi + 8f2 ~ 2fs ~ 3hfo + Ahh — hf we (4 = 3h) fo + (=10 + 4h) fi + (8 — A) fa - 2fs me () 0) 14, In the two representations the value of ¢ lies between a+ h and 2, and 2r—h and 2, respectively, Thus, in general, each representation will have a different value of c, say ¢ and ¢2, respectively. As given the formula for f(x) is inappropriate, out under the appropriate assumptions about the size of h and the behavior of {()(x) the formula for {"() could be a ‘g00d approximation, Chapter 7 Numerical Integration 7.1 Introduction to Quadrature 1 (a) trapezoidal rule 0.0 Simpson's rule 0.666667 Sinpson’s 3/8 mile 0.649519 Boole’s rule 0.636165, (b) trapezoidal rule 1.379769 Simpson's rule 0.958319 Simpson's 3/8 rule 0.986927 Boole’s rule 1.008763 ) trapezoidal rule 0.420735, Simpson's rule 0.573336 Sinupson’s 3/8 rule 0.583143, Boole’s rule 0.593376 2 (a) trapezoidal rule 0.603553 Simpson's rule 0.638071 Boole’s rule 0.636165 (b) trapezoidal rule 1.020128 Simpson's rule 1.005610 Boole’s rule 1.008763 101 102 ONAPTER 7. NUMERICAL INTEGRATION © trapezoidal rule 0.577889 Simpson's rule 0.592124 Boole's rule 0.593376 3 (a) feat = FE(LCa) + 4p(24) + 50) = Beale? + (+o 46) = Wha a)(208 + 20h + 20 _— ~ Bs footie = PSO) +4708) + 50) (b—a)(a + 40" + ys) Cae) = Waa)(Ga +30 + Bab? + 309 (b) "pede = af S Bash ie 2a * ae = Pome |, Gm = RL = hy + Ape = Sot h) |. The degree of precision is n= 1 ‘The degree of precision is m= 3. ‘The degree of precision is n = 5. (a) m=(b-a)/(d—c) 7.1. INTRODUCTION TO QUADRATURE 103, (b) ‘The precision is 1 (©) The precision is 2. (a) ‘The precision is 5. fc S(2)de = ie Ps(a) dr ° (= n)(e~2)(2~ 13) = fo Sees ae (@o = 1)(#0 — 22)(40 — 5) +f i — ®o)(x = t2)(x — 23) ea \eer alors =) (c= ao)(e—2Ne=25)_ 4, +f eee (e- alle ale + [gee Now make the substitution 2 = zo + ht where h = (a3 ~ 70)/3. ‘Then de = hdt, 2 ~ 23 = (k— jh, 2~ 24 = h(t ~i), m9 = 0,2) = 1, 2g =2 and x3 = 3. This yields the first line of the expression in Exercise 9. Starting at the last line of the expression in Exercise 9: - #(4 +54 Ds) +P (15427) 6 2 28 (Bw 2) £8 (8) = Ween Which is Simpson’s $ rule, [Cred = [roe - (Enite=s) 104 CHAPTER 7. NUMERICAL INTEGRATION Now make the substitution = xp + ht where h = (3 ~ ao)/3. ‘Then dr = hat, 2 ee ee aud 15 =5. 7 Ss = 1lt— 2 ay(¢—4y(e—) ae +A [oye 24e-ayee—aye-ay + 2K [eo 0-90-9904 ayie—syar A (= O)(t = ft —2)(6— ye ~ spat 4 [00-29-90 sat + [6-00 nea 0-90-98 6-42) -4() (2) Me) (2) = i 0f04 15h +50f2 + 50f5 + 1544-4 19/5) 11. Constructing a divided-difference table for the three points (29, f(z0)), (a1, f(#1)) and (2, f()) produces the second-degree Newton polynomial Pale) = fo+ (&) e294 (23h th) (e-x)e—2) ‘Thus [Prac = [Pia A otf eel fe-mae BOM Pg agtenye = to + ht where A = (23 — 29)/3. Then Ati), 29 = 0, 2) = Land 23 =2. Now make the substitution de hdt, rq, = (kjk ea 7.2. COMPOSITE TRAPEZOIDAL AND SIMPSON’S RULE 105 ” a wf tts ee ee ae = Moins+nn— 1) (5) +Moa ened 2 (ibe 48) F = Bhfo+ 2h — fo) + = Uo tan es) Simpson's rule 7.2 Composite Trapezoidal and Simpson’s Rule A. (a) F(x) = aretan(z), F(1) ~ F(-1) = m/2* 1.57079632679 116746305691, (b) F(x) = 22 - aes aan F(1) — F(Q) = 2cos(2) + sin(2)/2 = 2.87079554995998 2 TY.) = 28sTan88471, = 2e-* = 1.52379338880291 A, T(f,h) = 1.52162778130, 00216500759 ‘cos(2) + dsin(2) ~ 2 = 0.804896034208442 2, T(f,h) = 0.78330408729, 02159194692 0.805005, 106 CHAPTER 7. NUMERICAL INTEGRATION (0, FG) = ~Beos(2e)e-*- fsin(2a)e~* F(x) — F(0) = 3 — 3e™ = 0.982714432604491 i M=10, r/1C, T(f, h) = 0.36695122058, Br(fyh) = 001571921211 ii. S(J,h) = 0.389795 2.) [VIF Bede = L5tra6casi6o019 ls i, A= 10, T(f,1/10) = 1.55260045, ii, M=5, S(f,1/10) = 1.54786419 18 to [viverra i. M = 10, T(/,x/40) = 1.310891 ii, M = 5, S(f,7/40) = 131144352 31144249821555 © [vier Rte= mrnaioms i. M = 10, 7(f,1/10) = 1.19318470 M =5, S(f,1/10) = 1.19270186 8) ae [Vode = asnsr218820124 fb i, M = 10, T(f, 1/10) = 3.64244664 i, M=5, S(f,1/10) = 3.56372816 s/t (b) or if sin(2) /T+ cas*(@)de = 3.65837776802123 iM = 10, T(f,0/40) ii, M=5, S(f,7/40) (0) an [meV Rar = asisersioTes i. M= 10, 7(7,1/10) = 4.85802252 ii, M-=5, S(f,1/10) = 4.84924283, 65242104 = 3.05869833 4. (a) The trapezoidal rule (M = 1, h = 1) is exact for f(2) = eux +c cover [0,1] since: TUS) = FF) + F(0)) = Flew + (61 +60) = and [itcwrende= (2F +02), date 7.2. COMPOSITE TRAPEZOIDAL AND SIMPSON'S RULE. 107 (b) It is sufficient to show Ex(f,1) = Jp corde — T(car?,1), Thus {1 = yao Ex( fi) = 2a) and, = 2a tec 2&4 32776 5. (a) By the summation properties of definite integrals, it is sufficient to show Simpson's rule is exact for each of the polynomials e322, en2?, e121, and ¢o. Thus SG code = 2e9 H(co + 4e0 + €0) = 2c Bosee= of 2-04 dey +201) = 2ey 2 or 5, ef § Se eade = oe] $2 40+ den + dea) = $e 0 2 Peter = sel fey (0-4 deg + 8e3) = dey (b) It is sufficient to show j cea'de — S(cge4,1) = Es(eg*,1) ~@- 2 Bx(eat',1) = =P OGIeN GO" ae ~ 2% 3 2" 2 = (B-F)a- cuz? casts LO44e +100) = 6. (a) We want a quadrature fornmla: [aoe = 090) +0100), that is exact for polynomials of degree loss than or equal to one. ‘Thus we find values of wp and w satisfying the equations: Idt = w(t) +41(1) lo wo(0) + wi(1) 108 CHAPTER 7. NUMERICAL INTEGRATION or 1 = up tay and $= wy. The solution is wo = 1 = $. Thus the quadrature scheme [ae $010) + boa) is exact over the interval [0,1] for all polynomials of degree less than for equal to one. (b) Make the substitution 2 = 9 + ht into the approimation scheme (note: f(x) = g(t), dt = Bd, 9 = 0, and x = 1): BL stent = 54000) seen or i : [ towte= Bi po, the trapezoidal rule for M = 1 and h = 21 — 29 on the interval [0,21]. 7. (a) We want a quadrature formula [Hote wna) 4x91) +4092), that is exact for polynomials of degree less than or equal to two. Thus we find values wo, w1, and w» such that [ow fw lo 2 [ee = w(0) +41(1) +u2(4) wo(1) +024(1) +.2(1) (0) +on(1) + 02(2) wo tu tug = w+ ap = wi td = ‘The solution of the linear system is wp = 1/3, w = 4/3 and w = 1/3. ‘Thus the quadrature scheme 2 [aote~ 3a + Sot + 3012 is exact for polynomia's of degree less than two on the interval [0,2] 7.2. COMPOSITE TRAPEZOIDAL AND SIMPSON'S RULE 109 (b) Make the substitution 2 = 29 + ht into the quadrature scheme (note: S(e) = ot), dt = far, 29 =0, 21 = 1 and zp = 2): 5 LP sete = jen + ste + Hen) [FC totem Rio ah 49, Simpson's rule for M = 1 and h = 22-520 on the interval [70,2] 8. (a) Use the bound | f(x) cos()| < |c0s(0)}| ((a/3 - 0) #2) /12 <5 x 10-9, thea substitute h= /(3M) and get #*/162 x 10° < M?. Solve and ge: 4374.89 < M; since M must be an integer, M = 4375 and h = 0,0(0239359, Boge SU %)| = 1/4, and obtain $5X 10-%, then substitute h=1/M and get x 10° < M?. Solve and get 2041.24145 < M; since M must be an integer, ‘M = 2042 and h = 0000489716. (b) Use the bound |/2)(2)] (3—2)hh2 3-24 (6) Use the bound |f(x)] = (2 — 0)2h? (2 = 2e"*| < |f(0)| = 2, and obtain 5X 107%, then substitute A= 2/M and get x 10° < M?. Solve and get 16329.9316 < M; since M must be an integer, ‘M = 16330 and h = 0.000122474 9. (a) Use the bound |f(x)| = |cos(2)] < |eos(0)] = 1, and obtain ((#/3—0) 2) 12 _< 5x 107%, then substitute h = x/(6M) and get 4° /34.992 x 107 < M4, since M must be an integer, M = 18 and = 0.029088821. (b) Use the bound | f(z) = por S |f()| = 3/4, and obtain BBM 5. 10, hen biti b= 12M) and get ch x 107 < M+, Solve and get 15.1087 < M; since M must be au integer, M = 16 and h = 0.03125. (6) Use the bound [7%] = [(r — (2 — 0)4h4 < [f(0)| = 4, and obtain <5 x 10°%, then substitute h 10° < M‘. Solve and got 54.602417 < teger, M = 55 and h = 0.0181818, (2M) and get ys x since M must be an n0 CHAPTER 7. NUMERICAL INTEGRATION 10, MTA TUR) | Er(F,h) = OF) 1_[02 0.199008 [0.0006660, 2 [oi [0.199500 | 0.001664 + [0.05 | 0.1996252 [0.000086 S| 0.025 [0.196564 | 0.000104 16 [0.015 [0.1996682 | 0.000026 IL Mk SEAT Psh n= OF) 1 [075 [7.365804 [0.002560 0.375 | 1.3634208 | 0.000152 4 [0.1875 _[71.3032869 [0.000000 &_| 0.09575 [13032781 | -0.0000006 12, (a) Let h= 2528, 2 09 4-h, and F(x) = f(z). Then ne Fe) = PP vensh | = Pa(r) + Exs(f,h), FON )(2— “ys 3 where ¢ is between x and 2*. By the Fundamental Theorem of Cal- cenlus: ff teres @ F(es)~ Fao) Pa(a1) ~ Pa(z0) (Fat) + Piet) —2") + BP Yenr 29) RG) + EG )lca— 2) + SPM Vla9 2) V ono)» 08m) = MMF (2*) = 2hF"(z9 +h) = 2hf (eo +h), the midpoint rule. The error term is: Em(fh) = PMN — EPH ea)(—m FP Medes — 2") — FPO) 20-27) a = Erte) + FO(C0)) = Pua) + S"eo)), 7.2. COMPOSITE TRAPEZOIDAL AND SIMPSON’S RULE. Mm If f"(2) is continuous on [ro,2r1), then, by the Intermediate Value ‘Thoorem, there exists c € [10,7] such that J"(e;)+£"(co) = 256) Thus Eay(f,h) = 2p") (b) Note: We now let h= 2374, the length of the ith subinterval. ‘Then [ * Heyde XP sews ~ Elon(e3)) aBtlor(o-3)9): a " the composite midpoint formula, (©) From part(a) over the interval (x;_y,)] we have Exy(f,h) = 4 f"(cs) ‘Thus over the interval [20,2] : 7 LE re=B yer x fee (Ere) : Eulfh) " ‘The term in parentheses can be recognized as an average of values for the second derivative and hence is replaced by fc). Therefore, wwe have established that for the composite midpoint formula: Eu( fh) Gaaf"o _ oa) 13. (a) [0 te2)Mde = 1.1074 (b) (2+ sin(@/A)de = 5.5111 (©) Seas Sede © 2.5582 (4) ff.2%e~*de 0.6867 (e) fg 2x cos(e)de = 0.8157 (8) sin(22)e*de = 0.4593 14, We first determine the error when the rule is applied over the interval [0,22]. In the proof of Corollary 7.2 we were able to use the Second 42 CHAPTER 7, NUMERICAL INTEGRATION Mean Value Theorem for Integrals. But, in this case the expression (1 — ‘®o)(@ — 1,)(e ~ x2) changes sign on [9,72]. Hence, we proceed in a different manner. Let P3(z) be the Newton interpolatory polynomial of degree two for F(z) at the nodes zp, 7, and 22. Let x be the value at which we want to caleulate the error. Adding 2 to the divided-difference table for Ps() yields Py(z) an interpolatory polynomial agreeing with f(z) at xo, 21, x2, and 2. Thus Paz) = Po(z) + f't0,21,22,21(z — 20)(2 — 21)(2 — 22) But Ps(x) = f(z), at 2, thes F(e) = Pala) + fleo.2,22,2\(2 — 20)(2 = 21)(@- 22) Integrating: J Sa)dx = Soe Pale) + JE leo, 21,22, 2)(2 —20)(e~ 2)(0—22)der = Hot Afi + fa) + Jey flo, 21,22,2](e ~ 20) —21)(2—22)de We now consider the error irs BH H) = [Swen sa ae ~no)e ~~ 20h Define sta) =f ¢—20)t 2) Note: By the Second Fimcamental Theorem of Caleulus; g'(2) = (x — q)(—21)(%—z2), and by she Fundamental Theorem of Calculus; g(r’) = SF (@—ao)(2—x,)?. Thus gto) = 0 = 9(2), g(x) > Ofor all x in (29,:70), and Bs(H.0)= | feoseice 2 elds Integration by parts yields: 7.2, COMPOSITE TRAPEZOIDAL AND SIMPSON'S RULE. 3 Es(f,h) Meeozrzncaeeg~ J” ole) fleo21,25 alee ~ f° aay steoes2naifee [Pata where d= d(x) € (20,2), by Theorem 1.7 Generalized Rolle’s Theorem, Applying Theorem 1-11 Weighted Integral Mean Value Theorem yields Ex(f,h) FD(0) qe | aaiae 19" (f'u-roit-nitt—n) ee £90 f° (["-2att-nt-ate) a (oNe) pet Fo [zoe 2nit— nylon ~ nat Bg HOO: where ¢ = e(¢) € (9,172). Now suin the error over each subinterval: Es(f,h) = aw Le) om Assuming f“ is bounded and continuous over [a,b], then by Theorem 1.2 Intermediate Value Theorem there exists ¢ € (a,6) Such that ‘Therefore, Bsn) = _ (mse) = Ady 14 (8) 10 = BY Fe) =a Mfg 0a b= af %: ieee) a4 CHAPTER 7, NUMERICAL INTEGRATION 7.3 Recursive Rules and Romberg Integration 1 (a) JIT RUG RUA RUJ,2) -oonrarr T[0.02577300 | 0.03226900 2 [ooawrir[o.raraase1 [ ORBISON Oo) TRO TR 7 -a.00T90505 1 [oozes | 028877 Z [OOTo TSH [ .ORRTTRAT | OOIRTOSUT i) JT RUD) RAY, RS,2) Tass. T | 21080 | TATOOS 2 [1 rsiotesT [1 o7seRett | 1 oOMNOE «@) TRO TR 1 foe 1 [e.asieeans | aaaoTaSIm 2 | As6s5e45 [419879722 | A TTOROEGS © JT RU) RUT) RUD Teaser SOL BPE 2 [121625896 [1.201100 | TITRE G) TRA RT OE 1 | 2 ramORRT | I TONOTTA 2 [2.99870907 | 3.08359515 | 3.0976365 2. (a) ari) fim S(d) = Jim, 7.8. RECURSIVE RULES AND ROMBERG INTEGRATION 115 ) i200) = fin, OSD = SUD som 3% (@) fpiar fitde=8 fiatdr= B order = 64 fietde= 93s A atae = 8 BQ) = B(7+9241243247) <4 Blxy1) =f (0432424496 +28) BU.) = (0432+ 1214) +32(9) + 7(10)) = B(x.) = (7(0) + 32(1) + 1218) + 3227) + 7(64)) = 64 Blat,1) = £(7(0) +321) + 1216) + 32(81) + 7(256)) BEE 1) = H(7(0) +322) + 12(82) + 82(248) + 7(1024)) = 298 (b) eyed Tost Se — B(x, 1) = S384 WB =2(4 —0(6(4)* Ep(a®,1) = 24 = OOH)" _ _ 128 945, ze 4, We want a quadrature scheme i * et) = ong(0) + ong) + 0192) +u09(8) +0408) that is exact for polynomials of degree less than or equal to four. Thus we seek wy, w, w, w3, and w4 such that pow = tender tay tay fw = wy + Dun t Boy + lay pee = wy + dun + Oy + 1604 few Hy + Ben Tay + Big 1 + 16s + Bly + 256% 6 CHAPTER 7. NUMERICAL INTEGRATION 4 = wpter tun ter tun 8 = uy t2en + Bunt don Bm cy ttn +805 + 1a GL = uy + Bin + 27a + Bhs 124 Tse + M6t2 + Blws + 25604 mn ofthe linear system is wy = Hr = hun = fen = 4d. Therefore, i aad = & (too) + 824(1) + 1292) + 32419) + 794) or if * pedde Boole’s composite rule for Zerho+32p1 12430 47h) = Land M = 1 over the interval (0,4). Ufo + fi + 2fo +4fs + fa) — Fo + 4S + fu) = dy (1Ofo + 64 + 32fo + 64fs + 16 fy — 2fo — 8fa — 2h) = (Mf + 64f, + Ufo + 64fa + fa) B (Tho + 32h, + 12jo + 32fs + 7h) Boole’s Composite rule for J = 2. IT(F,W) — TU. 30 B(fo + 2h + 2f2 + fs)) ~ 3 Fo + fa) (8fo+ 6fi+6f2 +3f4~ fo fa) = (fo+3hi+3fe + fe) Simpson's 2 rule (6) from Section 7.1 7. Multiply both sides of (25) by 16 and subtenct. (26) from the result: 16 [2 f(a)de ~ f° fade = 16S(f,h) ~ S(f,2h) + b2(16 — 64)h® + b3(16 — 256)h5 + 7.3. RECURSIVE RULES AND ROMBERG INTEGRATION uz or f ‘Palade = SUA) =S(F2h) _ABbah® _ 240bsh® ee is 8. Multiply both sides of (28) by 4* and subtract (29) to obtain: 48Q-Q = 4*R(h,K ~1)— R(2h,K ~1) eid — ARYA A eg( ah — 4PM? or 4 Rh, K =) = ROK K~1) | ond (a) 2 wa - = x ie = 4 Rh == RA Ds ogaeea) + 9. (a) f(z) = 0, thus by Theorem 7.7 R(3,3) = 256. ‘The following Romberg tableau shows the result. 1024 0 0 0 cas Gr Gage 0 Sot Pane (b) £29(@) = 0, thus by Theorem 7.7 R(4,4) = 2048. ‘The following Romberg tableau shows the result. 12640 0 0 sos LOR og 0 ayer eo fee eee ee Spe AE ETT ao ons 10. (a) r= 0 t=0, r= 1-5 t=1, and Vi =¢ on the interval (0,1). [Ge f vB eanar= [rane [a 18 CUAPTER 7. NUMERICAL INTEGRATION (b) Bor f yde, Rombar integration converges slowly because the higher-order derivatives of the integrand fe) = VF are not bounded near 7 = 0 11. (a) Substitute hy for h in the formula for M(f,h) to get the sequential midpoint rule: sm) ~atinnn=noSes (0+ (ef) a) (b) Since the given error term Eyy(f,)) has the same form as the error term for the trapezoidal rule, we follow the work outlined in formulas (20) through (33) and see that R(J,0) = M(J) for J > 0, and for J>K AF RIK ~ 1) ~ RU ~ 1, — 1) RULK) = a 7.4 Adaptive Quadrature ‘There are no Exercises for this section-just Algorithms and Programs. 7.5 Gauss-Legendre Integration 1. J2 60% dt = 64, GUs,2) = 586660667 2, 2 sin(t) dt 1.41647, G(f,2) = 1.410157 3. £3 82 at o.9460881, GY, 2) ~ 0.0460811 ft, . 4 He [eae x oats, o(7,2) = 0382201 Al 4.2) 5. 2 fF cos(0.6 sin(t)) at = 0.91200486, G(J,2) 6 (a)N=4 ()N=6 91200411 7 The roots of the Legendre polynomials are (a) Jp, (b) 0,-£V05, and (c) #0.8611363116, +40.3399810436, 8. If the fourth derivative does not change too nmuch, then ‘| ‘The truncation error term for the Gauss-Legendre rule will be less than the truncation error term for Simpson's rule. 7.5. GAUSS-LEGENDRE INTEGRATION 9 9 Pat = 3 G31) = G3(t) = Gs(t?) Galt) = F{6(-VOH)? +8(0) + sv") ~0 Gxt) = F610.) +8(0) +5006)" Galt) = F(-2106)°7 +8(0) +5105) ~0 10. If the sixth derivative does not change too much, then Le) | =f e2)| |"t5750 | < |“t5r20—| Since the magnitude of the truncation error terms are about the same, both methods have about the same precision. But the Gauss-Legendre rule requizes three calculations compared to five calculations required by Boole’s rule 11, We want a quadrature scheme 1 [ flevte 0. 9(-VOB) + nf) +1605) that is exact for polynomials of degree less than or equal to two. Setting J{@) equal to 1, x, and 2 in the previous scheme yields the linear system = wy tun buy — VOB + VOBu = 016i + 0.60 The solution of the linear system is wy = 3, 2 = §, and ws = §. ‘There- fore, 1 [tert = H61(-VOB) + 8110) +5f1V0B), the three-point, Gauss- Legendre rule, 20 CHAPTER 7. NUMERICAL INTEGRATION 12, Truncation Error for GanseLegendre: 2822070" truneation error for Romberg: o((a)"") (@)"). Chapter 8 Numerical Optimization 8.1 Minimization of a function L (a) #'(e) = 62? — 18¢ + 12 = G(x - 1)ix—2) On (~00,1) : f"(z) > 0, thus f is increasing On (1,2): #"(2) <0, thus f is decreasing On (2,00) : J"(2) > 0: thus / is increasing, (b) £1@) = ahs > 0 for all x in the domain of f, thns f is increasing for all z in the domain of f. (©) £2) = =1/2? <0 for all « in the domain of f, thus f is decreasing for all « in the domain off. (@) #(@) =2*(a+ (2) On (0,e~) : J"(z) <0, thus f is decreasing, On (e-#,o0) / f(x) > 0, thus f is increasing, (a) f(2) is unimodal on (0,4), since f'\r) = 2x ~2=0 when z= 1, and f(z) $0 on (0,1) and f’(x) > 0 on (1,4), (b) f() is unimodal on (0,4), since f(x) = ~ sin( and f’(2) <0 on (0,x] and f'(x) > 0 on fr, 4) (©) £2) is unimodal on [0.1,10}, since f"(2) = 2*(1 + Iu(x)) = 0 when and f(z) <0 on [0.,e") and f"(2) > 0 on fe 10) (2) f(2) is unimodal on [0,3}, since f"(2) = (3—2)2($2— 3) = 0 when = 9/8, and {"(z) <0 on (0,9/8] and f"(2) > 0 on (9/8,3] (9) f"(x) = 122° — 161 — 11; local minimum at x = 11/6 (b) £"(x) = 1 — 6/2; local minimum at « = YB (©) £(@) = (@ +52 + 4)/((4~ 2); eal (a) f"(a) = e*(x ~ 2)/a%; local minimum at x = 2 (6) F'(z) = ~ cos(x) — cos(30); local minimum at 2 = 0.785398163 = 0 when 2 =, inimum at ¢ = 1 v1 122 10. CHAPTER 8, NUMERICAL OPTIMIZATION (8) £'(@) = -2{cos(z) - cos(2x) + cos(32)); local minimum at z = 2356194490 Minimize the distance squared: d(x) = (x ~ 3)? + (2? ~ 1)2; a(x) 2(22° — x ~ 3). The minimum ocenrs at x = 1.28962390, Minimize the distance squared: d(x) = (x ~ 2)? + (sin(x) - 1)%; a(x) = 22 —2-+sin(x) cos(2)—cosiz)). The minimum occurs at 2 = 1.96954061. 7 = ~1.09638, y = ~4.87831 (a) {ao, bo] = [-2.4000, mre [1,61] = [-2.4000, -1.9056], {zs ba] = [-2.2111, ~1.9056) (b) {ao, bo] = {0.8000, 1.6000], fax, ,] = [1.1056, 1.6000], faa, 2} = [1.1056, 1.4111) (©) [00,0] = (0.5000, 2.5000), [a,b] = (1.2639, 2.5000), a2, ba} = [1.7361, 2.5000), (@) {205 bo] = (1.000, 5.000, i 1] = (2.5279, 5.0000), [a2,ba] = [2.5279,4. (8) [a0, bo] = |-2.4000, co {a1 61] = [-2.4000, -1.9056), az, ba) = |-2.2112, ~1.9056) (®) a0, 0] = (0.8000, 1.6000), fax, 1] = (1.1056, 1.6000}, faa, ba] = [1.1056, 1.4112] (©) [a0,bo] = [0.5000, 2.5000}, (a1, ¢1] = (1.2640, 2.5000), (a2, bo] = (1.7360, 2.5000} (4) [a0,bo] = [1.0000 5.0000), far.s] = 2.5281, 5.0000), (ans bal = [2.5281, 4.0502] (8) Po = ~2.4000, Pring = ~2.1220, Ping = ~2.1200 (b) Po = 0.8000, Prin = L276, Pring ~ 1.2884 (©) Po = 0.5000, ?min, = 1.9608, Pring = 1.8920 (4) Po = 1.0000, Pins = 2.8750, Pring = 8.3095, (8) Po = ~2.4000, py = —2.1180, po = -2.1200 (©) Po = 0.8000, px = 1.2809, pp = 1.2834 (©) Po = 0.5000, py ~ 1.8566, (a) Po = 1.0000, p; = 3.8333. Note; py is the abscissa of the minimum, since f is a cubic (a) bax = (=498)*(- —0) = 0.14590 (8) by a4 = (=1998)"(-1.6- (-2.3)) = 0063119 8.1. MINIMIZATION OF A FUNCTION 123 (©) be ~ ax = (=44)" (a5 - (-46)) = 0.065858, (a) P20 — 35, 000 < 46,368 = Foy (b) 2322 = 7,800,000 < 9,227, 465 = Fis {c) $48 = 66,000,000 < 102,334, 155 = Fup 3 Fron 2 Fuk = Fate Fa: ee ee a, (19) (20) (21) = S(p1) — f(P0) = P(r) — P(po) — ane (Pi =P2)® , Bp — pol? _ apo ~ p2)* _ (Pa ~ pa)? = ee ee 7 3 2 alt)? 2 aly = 1)* + By — 1)? +09* — BF a7? ~ (99 — 8)? + 37-1) +809? ~ 2741-74) (34? — 3y +1) + A(1 -2y) ACE"(Px) ~ S'(p0)) = A(P'(72) — P'(p0)) a(S =n) + ee =P) sale = Po) 7 (ee nue 28 hy sate? + 7 7 7 Say — 1)? = 28(y ~ 1) ~ day? + 2A Boa? — 2941 = 9?) + 2817-7 41) Ba(1 ~ 27) +28 A§o) = hP'(po) 3a(po~p2)® | 28(po ~ po) - a( too pa, 280 2) =n (3a? _ 2Bby = nt Be) = Bay? — 28 15. The result follows immediately by adding twice the difference of equations (21) and (19) to equation (20), 124 CHAPTER 8, NUMERICAL OPTIMIZATION 16. The sum of equation (21) and + times equation (20) yields AF (Po) +9G = Bary? — 214 + y(Ba(1 ~ 24) + 287) AY'(Po)+3G = 307 ~ 309? Bay? + (G -3a)y + f(y) o 17. (a) [ay,bs] = [+2.4000, ~1 9000), [a2, bo] = [-2.2500, -1.9000] (b) (Principle of Mathemaical Induction) When & = 1: bom = (25M +0) ao, To wets) In either case: =. te 2 ‘Thus the statement is true for k= 1. It follows, Pesta = ASE ae 1 = Satee(ied)+« bo = a0 = = Spt en(—ghy ‘Therefore, by the principle of mathematical induction: bo — a0 = Dee = gE +26 1 : for all k> 1. () k=13 18. (a) P'(x) = 3a(x — ag)? +(x ~ a9) +7. Solving P’(x) = 0 yields: 228 + VP ay eo = _ B+ VP aay ~ Ba Thus eee 3a, 82, NELDER-MEAD AND POWELL’S METHODS 125 (») Substituting ag into P(2) and P'(2) yields: P(ao) = flac) = p and PX(a) = f(a (c) Substituting bo into P and P’, and letting h = bo — ag yields: an + Bh +yh+p = f(b) Bah? +29h+7 = $'(bo) ah? + ah? (bo) — f(ao) — hf" (ao) Bah? + 28h (lo) = f(a) Bliminating (—2E, + hE2) yields: ah? = —2(F(bo) ~ f{ao)) + 2hF'(ao) + WC" (bo) ~ f"(a0)) =2As (bo) = f(a9)) + 2hf'(ao) + WCF" (bo) = f"(a0)) Be _ 2 (eagles ~ 7'(a) = h _ 6-2(5?) _g-a = hbo a0 Similarly, eliminating « yields: BIE = (bo) ~ feo) — hf (09)) — H(t) ~ $C) pas (aS glee fs) = (Serie . 3(->) ~G=3D-G (4) [21,4] = [-2.4000, -2.1197}, fan, bs] = [-2.1200, -2.1197] 8.2 Nelder-Mead and Powell’s Methods 1, (@) fe(a.u) = 30? —3, fy) = ay? -3 Critical points: (1,1), (1,—1),(—1,1),(=1,-1) Local minimum at (1,1) (b) fe(2,u) = 22 —y +1, fyley) = 2-2-2 Critical point: (0,1). Local minimum at (0,1) (0) fol(2yu) = 2ay + ¥?~ By, foley) = 2? + 2ry — 3x Critical point: (0,0), (0,3), (8,0), (151) Local minimum at (1,1) 126 CHAPTER 8. NUMERICAL OPTIMIZATION Sule) = HP Critical point: (1,=1),(-1,1). Local minimum at (=1, 1), (@) foley) = —400a(—2? + y) ~ 2(1 — 2), fy(x, 9) = 200(-2? + y) Critical point: (1,1). Local minimum at (1,1) 2M (3/2,1) R =2,0) E -11/2,-1) 3M 3/2,-3/2) R ~6,—4) E ~21/2,=13/2) 4. M=(B+G4P)=H1,1,1) R = (13.1.0) 5/3,5/3) 5. M=4(B+G+P)=}(0,3,1) a 2 i : i 4 i F E = f(A/2,1/3) +n(0,0)) = f/2+m,1/3) | oe) =e rs a. ‘has a minimum at 7, = 0.5. Thus P, = (1, 1/3). When i= 2 the function S(Pi + 2U2) S(A/1/S) + 20,1) J(,1/3+») 1 1 . = s-9(Len)+(Lon) has & minimum at = 0.666667. Thus Pp = (1,1). Sot Uy = (P Po)! and 0 05 = [T ccwostt |: 8.2, NELDER-MEAD AND POWELL’S METHODS 17 ‘The funetion FPo+ Ua) = F((1/2,1/8) + 9(0.5,0.666667)) J(1/2-+ 0.57, 1/3 + 0.666667) = 5-3(E +051) +(+00)° = 2 eee ~8(§ + o0icsor) + (2 +0800067)) has a minizaum at y | Thus X; = (1,1). Set Po =X. When i =1 the fimetion F(Po+ Ui) FY) +0) f0+n,1) = 3-3 +n) +0 4+n)9 has a minimum at 71 = 0. ‘Thus P; = (-,1). When i= 2 the function {(P: +22) J((1,1) + 92(08,0.666667)) = f(1+0.5y2,1+0.666657%2) = 5 3(1 + 0.592) + (1+ 0.579)" ~8(1 + 0.666567 72) + (1 + 0.666667%2)* hhas a minimum at y= 0. Thus Py = (-,1). Set Uy = (P2— Po)! and 05 0 [sows 0 | ‘The function F(Po+ ya) = F((1/2,1/3) + (0,0) £01) 1 is a constant function. Thus the minimum occurs at X2 = (1,1). 7 Let U [ ha | and Po = Xo = (1/2,1/3). When i =1 the function A(Po+ Ui) 4((1/2, 1/3) + 1(1,0)) 40/24 m,1/3) ~bontd (Lan) +d(Lon) 128 CHAPTER 8. NUMERICAL OPTIMIZATION has a minimum at 7, = 0.833333, Thus Py = (1.33333,0.33333). When i= 2 the function S(Pi+%2U2) = f((1.88333, 0.33333) + 92(0,1)) 13333 + 72) 33333 + 92) + 1.83898(0.83338 + — 2)? has @ minimum at 7 = 0.800002, ‘Thus P2 = (1.33383,0.833335). Set Uj = (P2 = Po) and 0 0.833333 2 [? doo? | The funetion S(Po+ We) = f(i1/2,1/3) + (0.838333, 0.5100002)), J(1/2 + 0.8833837, 1/3 + 0.500002y) ~3(0.38333 + 0,500002y)(0.5 + 0.833333, +(0.83333 + 0.500002)°(0.5 + 0.883333) +(0.83333 + 0.5000027)(0.5 + 0.83333)? has a minimum at 7 = 0.872467. Thus X; = (1.22706, 0.769569). Set Po =X. When #= 1 the function f(Po+nU:) F((1.22706, 0.769569) + y(0,1)) (1.22706, 0.76969 +) ~2.1755(0.769569 +71) + 1.22706(0.769569 + 91)® 4 has @ minimum at 4; = 0.116901. ‘Thus Py — (1.22706,0:88647). When i= 2 the function J(P1 +2U2) J\(1.22706, 0.88647) + 79 (0.838333, 0.500002) ‘(1.22706 + 0.83983372, 0.88617 + 0.893333 4. 0.50000272) = ~3(0.886147 + 0.50000272)(1.22706 + 0.83333372) +(0.88647 + 0.5000027.)?(1.22706 + 0.88333340) (0.88648 + 0.50000272)(1.22706 + 0.88383340)? hhas a minimum at 2 = 0.0927493. Thus Pp = (1.14977,0.840005). Set Uy = (Pz — Po)’ and =| 500002 0.705262 0.883333 0772011 ] ‘The function F(Po+ Ua) = f{(1.22706,0.769569) + (0.072922, 0.0705262)) 8.2. NELDER-MEAD AND POWELL’S METHODS 129 ‘£(1.22706 — 0.072011, 0.760569 + 0.07052627) = ~3(1.22706 — 0.07729114) 0.769569 + 0.0705262>) +(1.22706 ~ 0.077291)? (0.769569 + 0.07052624) +(1.22706 ~ 0.07729114) (0.769568 +-0.07052627)? has a minimum at + = 3.07333. Thus Xz = (1.4646, 0.552819) 8. The midpoint of the segment joining the points B and G can represented by the vector B+ (G~ B). Thus 1 1 B+ 3(G-B)=B+56- 9, Reflecting the points of the vectors W, M, and R all lie on the same line segment, Thus, by the definition of scalar multiplication and vector addition, we have R~ W = 2(M ~ W) or R= 2M - W. 10, The expansion requires moving from R a distance cqual to the length of the vector RM in the direction of the vector RM, Thus E R+(R-M)=2R-M. 11. Given a triangle with vertices A, B, and C. Let D and E be the midpoints of the sides BC’ and AC, respectively, and let F be the point of intersection of segments AD and BE. It follows that F—A = k,(D—F) and F- B= kx(B~F). Thus POA = w((B-F)+(C-2)4+(D-0)) = (Re-2) +HC-a)+4B- ©) =k (ie - B+ hB- +) 1 1 ar (gem +}-4) +-2y) (-3)e-» (4) (F-A) Since F — A and F — B are not parallel we must have 1~ 4 = 0 and ky (- 4) =0. Therefore ky or n(he-m) hr) )e- a 130 CHAPTER 8, NUMERICAL OPTIMIZATION 8.3 Gradient and Newton’s Methods 1. (a) Vs (a,y) = (22 ~ 3,39? - 3) VS(-1,2) = (2(-1) —3, 3(2)? — 3) = (5,9) (b) VF(z,y) = (200(y ~ 2*)(—2x) ~ 2(1 ~ 2), 200(y ~ 2?) VS(4/2,4/8) = (200 (§ ~ (5)*) (-2@)) - 20 ~ 4) 200($ ~ (4)*)) = 9) (o) VFlasy, 2) VA(O.m 3/2) —usin(ny) ~ 2 os(2),—rsin(ry), 1 cos(x2)) 1 sin(0) ~ § cos(0), ~O-sin(0}, ~Ocos(0)) = (—7/2,0,0) 2. (a) When Po = (1,2) 1 8 = vpn Po) 1 = peepee OOD = ( . 7m) * \Vi0w Ya06, ‘The function S(Po} + So) = f((-1,2) + y(5/v106, -9/ VT06)) Sion) Gone = 8-3-7) +0- FR) By by \? -9(2+ Fm) + (1+ He) tas @ minisnum a7 = nin = 1.5908. ‘Thus Py (0.223068, 0.601523). Similary, Po + hminSo = 1 Si ype OVP) = (0.874158, 0.485641). ‘The function J(P1 +981) = (228068 + 0.8741587, 0.6 — 1523 + 0.485642) = 5 ~ 8(0.601523 + 0.485641) + (0.601523 + 0.4856414)° —8(-0.223068 + 0.8741587) + (0.228068 + 0.874158)? hhas a minismun at 7 = hymen = 1.38124. Thus 1 + hninSy = (0.984354, 1.27231). 8.3. GRADIENT AND NEWTON'S METHODS 131 () When Po = (1/2,4/3) L en 702) i = ee Oo = (0.708735, -0.705479). The funtion S(Po) +780) = ((0-5, 1.38383) + 9(0.708735, -0.705479)) (0.5 — 0.708735)? +100(1.33333 ~ (0.5 + 0.708735) — 0.705479-)? 0.626677. Thus Py = Po + itminSo = hhas a minimum at y= Ps (0.944148, 0.891226). Similary, 1 $= FapPyy OVID) = (0.727355,0.686261) ‘The funetion J(P1 +981) = (0.944148 + 0.727353, 0.891226 + 0.686261) (0.055852 ~ 0.727355)? +100(0.801226 - (0.944148 + 0.727356)? + 0.6862619)" 0.06057708. Thus P2=Pi + hrninSi = (0.944568, 0.891622) hhas a minimum at y= min (c) When Po = (0,x,%/2) L So = Tapp OVP) 1 THv7 0 ra VOD) = (1,0,0). "The funtion F(Po) +780) = f((0,x,"/2) + ¥(1,0,0)) ae cee) —sin (12 has a minimum at y= Rmin = —1.0. Thus Py = Po + hminSo (-1,x,x/2). The process ends at this point since Vf(—1, x, x/2) 0. Specifically, a critical value of the function f has been located-at ‘hich thr iy be sealer. CHAPTER 8. NUMERICAL OPTIMIZATION 288 290 © [= a] [“ 0 +] | 00 9 10 0 4 (a) Q(X) = f(Po) + VF(Po)-(K~Po) + H(X — Pu)Hf(Po(X~ Po}! = H4[- 8]feht 92] shlatl yn 2i[3 lass | = M=56e-+1) + 9(y—2) + (r+ 1)? + 6(y 29? ) QE) = 1(Po) + VE (Po) -(K—Po) + EK — PuJHY(Po)(K ~ Pa)! a = 5r+[ J [4 4] c 200 32-4] zs 200 le i] = Be Be + soy — sony + 10? - Ha © GX) = SP) + VFlPo)-(K—Po) + F(X — PoJHY(Po}(K ~ Po)’ 1+[-§ 0 O)-[2 y-e 2-8] 1 — 0 -1 z syle en gl] ao oll ans -10 a5 P)=P;~ Pi = Po ~ Vf(Po)((Hf(Po)) *Y) = Vs(Ps (HF) 8.3. GRADIENT AND NEWTON'S METHODS 133 (b) If Po = (0.5, 1.38333), then Pi = Po ~ Vf(Po)((HJ(Po)) *)') = (0.498424, 0.248424) Po = Py — VJ(P:)((H/(Pi))"")) = (0.493401, 0.24342) (c) The matrix Hf(Po) is uot invertible. 6. (a) When Py = (~1,2) So = —V/(Po)((Hf(Po))"')') = (2.5, -0.75). The function £(Po+780) = 5—32-0.75y) + (20.754)? =3(-14 259) + (142.59)? hhas a minimum at = min = 1.07614. Thus Py = Po + Amin So = |1.69033, 1.1929) (b) When Po = (015, 1.83833) So = —Vf(Po)((HS(Po))~1)’) = (-0.0023184, ~1.08563). ‘The function F(Po +780) = 100(1.33333 — (0.5 ~ 0.00231847)? — 1.085654)? +(0.5 + 0.023384)? hhas a minimum at y= hin = 0.969984, Thus Py = Po + hminSo = (0.5, 1.38324) (0) The matrix (Pp) is not invertible. 7. By definition Vf (2,4) = [fe(2,1) fy(eu)}: It follows from Definition 3.8 of Section 3.3 that tafean Hate IV Fea) = Pa en fex(r.y) fey(%,y) ] _ few fen [Brew 8 Show left-hand sides of formulas (6) and (7) are equal. Subtitting X = (ea) and Py ~ (a0 into formula (@) sills QAru) = Fa,d)+[ fola,d) fy(a,d) |-[2e-a y-b} valeme wo) Ri) feed] [3 = 10.0) + f5(0,b\e0—0) + fyla)ly~B) + fayl0,B(2— Ny) + Bfanl ost) a)? + Fig(ady — B?. CHAPTER 8, NUMERICAL OPTIMIZATION ‘Taking partial derivatives with respect to 2 and y Qe(zy) = fola,b) + fayla,b)(y — 6) + fex(a,d)(x ~ a) Query) = fulasb) + fyela,b)(@ — a) + fyy(a,b)(y — b) Thus VOlrv) = [Qolsy) QWlew) | = (Lolo) fo.) +t ema yy fale Foie | = Vlad) +(2 vl-[a b)aay(ady’ Solve formula (7) Vs (Po) +(X~ Pa)(HY(Po)y =0 for X: (K- Po)iH/(Po))' = -V/(Po), assume (Hf(Po))’ is invertible, X — Po =-Vf(Po((HJ(Po))’)-* X= Po~ V/(Po((H/(Po)) '). Note: If a matrix A is invertible, then (A")-! = (A-Y. Chapter 9 Solution of Differential Equations 9.1 Introduction to Differential Equations 1. (a) Differentiating y(t) with respect to t yields y/(t) = —Ce-t + 21 —2. Substituting y(t) into the right-side of the differential equation yields Y= O~ (Cot 412-242) = Co 428-2 (b) (a) Differentiating y(t) with respect to t yields y(t) = 3Ce% — 1. Sub- stituting y(t) into the right-side of the differential equation yields ) + 3t= 300" —1 (e) L= 3. (a) Differentiating y(t) with respect to t yields y/(t) = —Cte~®/2. Sub- stituting y(t) into the right-side of the differential equation yields ep (b) L= 4. (a) Differentiating y(t) with respect tot yields y/(t) = -2Ce-2 +e-% — Ye-2, Substituting y(t) into the right-side of the differential equa- tion yields o* —2Ce™ + te) = 2Ce™ +62 — atem™ 135 136 CHAPTER 9. SOLUTION OF DIFFERENTIAL EQUATIONS (b) b=2 5. (a) Differentiating y(t) with respect tot yields y/(t) = 24/(C - #2). Sub- stituting y(t) into the right-side of the differential cquation yields 1 )\*__ *(ate) -oe () b= 60 6, Use the MATLAB M-file given prior to the beginning of the exercises. The differential equation and given general solution should be used to avoid points at which y/ is undefined, 7. Use the MATLAB M-file given prior to the beginning of the exercises. ‘The differential equation and given general solution should be used to avoid points at which 9/ is undefined, 8. Use the MATLAB M-fle given prior to the beginning of the exercises. The differential equation and given goneral solution should be used to avoid points at which y/ is undefined. 9. Use the MATLAB M-file given prior to the beginning of the exercises. The differential equation and given general solution should be used to avoid Points at which y/ is undefined. 10. (a) Differentiating y(t) = 0 with respect to t yields y/(t) = 0. Substi- tuting y(t) = 0 into the right-side of the differential equation yields v= 0) =0. (b) Differentiating y(t) = #7? with respoct to t yields 9/(t) = 37. Substituting y(t) into the right-side ofthe diferential equation Sields Va HORA gore (6) No, because fy(t,y) = 497%? is not continuous when ¢ = 0, and Timy..0 fy(t.y) = 00. 11, (a) Differentiating y(t) with respect to t yields y/(t) = cos(t). Sub- stituting y(t) into the right-side of the differential equation yields wf = (I~ sin®(0)¥? = (eos?(#))"”? = cos(t), since os(t) 2 0 on ‘0.2/4 (b) -n/2 0 for all t€ (a,b), and f, = g(t) and v(t) are continuous, Furthermore the functions and v are continuous, since they are differentiable, ‘Thus 2(t) is continuous for allt € fab). By the Extreine Value Theorem |p(t)| < -M = tax |p(t)| forall C€ (2,0). Therefore, the solution v(t) = 0is unique 9.9 Finite-Difference Method 1 (@) i= fg = 7.282743 ) sgy= Mid =Hsn ACID) — BOTTI poppy (0) (040.5) = 7.25 2. (a) hy = 0.5, 21 = 0.85414295 = 0.25, 21 = 0.93524622, 2 = 83762911, 152 CHAPTER 9. SOLUTION OF DIFFERENTIAL EQUATIONS (b) funy ja _ (0. saree) = 093524622 _ 9 sysrasiy 0.88233892 3. (@) A= 05,21 0.25, 2) 0.66721841 0.90452638, 272 = 0.72525082 Aaya 25 _ 4(0.66721941) ~ 0.72525082 7 > = 064787261 (o) (1) = 074741735 4 Ih < &, then M <2 or [pl $M < for j = 1,2,...,N — 1. For the ) second through N ~ 2nd rows (j {ah h [geo + pes — 2+ hg; [2+ mash, wad since g(t) > 0 on fa]. Similarly for the first and N+ 1 rows: h h 2+ Mal > [5m —1) and [2+ Maya] > |-Zpw—a— So, by definition, the cocficient matrix is strictly diagonally dominant and thus nonsingular. ‘Therefore, the given linear system has a nique solution, 5. (a) The tridiagonal coelfident mnatrix is: 2+he bey -fa-1 2+Me fa-1 0 Heal 2+hey fo —1 ° Hea -1 24+ ee 9.9. FINITE-DIFFERENCE METHOD 153, (b) For the first row (j = 1) Similarly, for the last row (7 ae zo a h patie sat. hey +2 We +2 [2+ hea] An u A 154 CHAPTER 9. SOLUTION OF DIFFERENTIAL EQUATIONS Chapter 10 Solution of Partial Differential Equations 10.1 Hyperbolic Equations 1 (@) u(x,t) = sin(nms) cos(2nnt) ur(2,t) = —2nx din(nez) sin(2nat) unle,t) = 42x? sin(nez) cos(2nmt) x(t) = nmeos{nx) cos(2nxt) uee(t,t) = —n?x*sin(nme) cos(nmt) ‘hs we) = tel, t) () u(x,t) = sin(nnz) cos(crnt) ud2,t) = —ensin(nnz) sin(enrt) un(t,t) = —en?a? sin(nx) cos(ennt) ue(z,t) = nx eos(nrz)cos(ennt) ter(,t) = =n2x? sin(nmz) cas(enat) ‘Thus uz.) = Peale.) Ieu(e,y) = $U@ + et) + sleet), then 12,0) = 302) + f(@)) = 102) and sue(x,0) = S(F"(2) - f'(@)) = 0 155 156CHAPTER 10. SOLUTION OF PARTIAL DIFFERENTIAL. EQUATIONS Furthermore; te = Uletat sea) ten = UUM) + "e~et)) w= Se bet) seat) ue = Sure tet) + f"(x —ct)) Thus Pugs = urs 3. Substituting h = 2ck into (5) yields tiger — Bog + Aegan _ less — Pag + meaty) ca ‘dc? h? 1 = Og = Aas + ag) a — Bis big 34d wages = 5s + 7 (Means + may) at 4 me 3 Ba 75 0.0 0.587785 | 0.951057 [0.951057 | 0.RTTRS 0 | 0.475528 | O-ro0iDT | O.7e0d2T | OATSSIE 02 [0.181636 | 0.20380 [0.203803 [0.181630 5. % [aa [as [aa [ae 0.0 [0.200 | 1.000 [1.500 | 0.750 0.1 | 0.600 | 1-000 [0.875 | 0.800 02 | 0.c00 | 0.375 [0.300 | 0.135 G. (a, t) = 5(f(a + et) + fiw — et) +b [ES o(s)ds, then, a weoadorei+t Secondly, (s)ds = f(x) +0~ fle), wl) = FU (e et) fe —et)) + F(ale + ct) + o(2 ~ ct), thus us(2,0) = 0+ 4(2o(2); = o(2). Finally, 10.2. PARABOLIC BQUATIONS 157 talent) = $f" e+e) + 1" ~et))+ Sloe +et) fle) (Fev a)+ sf (e- ety + LUle tet ~ gle at) eel) = 5M + el) + Ie) +E We bet) de —a)) Therefore, uy (2,t) = cuze(2, t). 7. Tn (6) let k= h/3, then (7) becomes t.j43 = wei + tinty ~ Maso 8. We=2, k= 0.02, and A= 0.8, then Since r Z 1 there is no guarantee of stability in formula (7), 10.2 Parabolic Equations 1. (a) Ifu(z,t) =sin(nmz)e“"**, then tuy(2, #) = —4n?n? sin(ner)etrn a(t Ure(@,t) Therefore, 4us,(x, t ®) rn cos(nnnarje4n°*t nx? sin(nza)et" rt ie(a,t). u(zyt) = sin(naz)en (mm)? u(2,t) (cnn)? sin(nme)e-(ena)*t uz(y) = ne eos(ama)e(onm)?t tge(2yt) = —n?x2sin(naz)e(enm)*t Thus u(0,t) = Pues(t). 2. Ik = A2/e2, then not guaranteed in form 3 In this case r £ 1/2 and stability is 7 = 00m —02 [504 [=00 [m=08 [me 10 00) 0.587785 | 0.951057 [0.351057 | 0.587 TRS | 0.0 0) ‘O.ATH5RS [0.709421 | 0.709421 | 0.47528 [0.0 00) ‘o.ssd7i0 | 0.622475 | 0.522475 | 0384710 [0.0 198CHAPTER 10. SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS 4. 7 =00[m=02[%=04] 00 z= 10 Oo 0.4000 [0.800 0.800 0. 00; 0.0 0.400 [0.7500 [0.7500__[ 0.400 | 0.0 0) 0.3058 [-0-7065_[ 0.7063 0.3037 [0.0 5. (a) Substituting k = A7/(2e%) into (15) yields $F (use — Hs) & ahr (tha sea — Quast t+ mesigtt + ang — Quy + 42g) Solving for wists Msiay ad tes yt Yields m Miser HOtigsr Merge = Ring H Minny Fm Ss for i=2,3,....n—1. (b) A has the tridiagonal form: 6-10 Ow we ee 0 -1 6-1 0 o-1 6-1 0 A 4 . oa 6-10 0-1 61 0 0-16 tage Per + Bains + 9,5 tage ung ++ 2, +4 x Mined tinny + 2tnaag + nay Unatjtt Dey + Din ag Hands (©) Clearly, the answer is yes. 6. Iu(e,) = DM, ase" sin(nz), then = > te = Gn? Daye snGjnz) = oe ter = Ga) Saye OP sinner) 10.2. PARABOLIC EQUATIONS: 159 ‘Thus u(2,t) is a solution of u(r, t) = use(#,t). Further 40,9 = aje-OP"* nid) = S20 =0 N : x YayeO"*sinija) = 0=0 x : x 2,0) = aye"O"ainGjne) = Joa; sin inz) u(1,t) Thus the given boundary conditions are satisfied 1) . n(x) . sin(3x) ig, (SGP a?) = (b) Through time the temperature at all points in the rod approaches zer0. 8. (a) We have ule t+ &) = ula.) (at) = : +k) and ttes(2,8) = Me— hot) = Dole) + ule + hat) + 0(H'). Thus tages winng— Dua tees _ k = he “ tegen = tg + A nag Bay Mang) +B the explicit forward-difference equstion, (b) Solve the difference equation tiger — Mihi = Buia tong Pog — 2s ey _ 2h : for teats Masta and wy-ay41+ Thus with (LF ie) tsa — Beta sa at (1 Fe) ts + afrtisay + hh 160CHAPTER 10. SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS or haa gta + 2h? + Ragga — besa se Seuss FAP — Blas + hess + RMP, the implicit difference formula, 10.3 Elliptic Equations 1 (@) 4p: + pa +Ps —80 Pi 4p2 + Ps -10 Pi~ 4Ps + Ps —160 Prt ps— 4p, = ~90 () py = 41.25, pp = 23.75, ps = 61.25, ps = 43.75 2 @) 4g + a + 2a, % ~ 492+ 204 1 — Ag9 + a4 + 95 + 94a +06 93 — 495 +96 ta (b) 4: = 52.5657, a = 29.6566, a5 = 55.3030 = 33,03030, qs = 656162, 95 = 47.1616 3 @) te = @;cox(z)sinh(y) + by eosh(x) sin(y) Wee = ay sin(x) sinh(y) + by sinh(2) sin(y) tly = 4; sin(2) cosh(y) + by sinh(x) cos(y) ‘yy = a sin(z)sinh(y) — by sinh(x) sin(y) Substituting use and tyy into Laplace’s equation we see that ties + Uyy = 0. (b) ‘ayn cos(nit) sinh(ny) + byn.cosh(nez)sin(ny) ~ayn7sin{ni) sinli(ny) + dyn? sinh(nz) sin(ny) fy = dqnsin(nz) cosh(ny) + bqnsinh(nx) cos(ny) ‘Uyy = qn? sin(nz) sinh(yn) — ban? sinh(nz) sin(ny) Substituting tz and uyy into Laplace's equation we see that xe + Uy = 0. 10.3. ELLIPTIC BQUATIONS 161 4 weet hy) = (eth — 7, ule hwy) = (eA)? — 9? u(z,y +h) = (y+h)? u(a,y —h) = 2? - (y—h)? Substituting into (7): we Bah + 12 — 20h +h? — Dhy — b+ hy — w2 = a _ =heo 5. (@) ee + tyy = 20-426 (b) 2042e=-1, fates — 6. Determine if u(x, 3) = cos(22)+sin(2y) ia solution; since it ip also defined on the interior of R. That is: Uae + thy = —Aeos(2n) ~ Asin(2y) = A{cox(22) + sin(2y)) du Api + a+ Pa Pi 4p tps Pi 4ps + D5 Pat ps — 4p 162CHAPTER 10, SOLUTION OF PARTIAL DIFFERENTIAL EQUATIONS Chapter 11 Eigenvalues and Eigenvectors 11.1 Homogeneous Systems: The Eigenvalue Prob- 1 lem (a) pd) = —BA—4 and A= -1,Vi =[-1 1 = 4, Ve = [2 3} (b) P(A) = 9? —BA—52 and di = (8~ V7) /18, Vs =| (-1- VITA) 8 1 |! dos (8+ VEIT) /18, Va=[ (-14 v2I7) /18 1]! (6) pd) = 8-44 ~5 and y= 8, Vi = [-1 1 J'p =, Ve= Pet (@) pA) = 4 +7 18891163 1765 = ep a= Gg As= ae En a ‘SST tt = B12 > Va tea Tes ot ah i (6) p(X) = a4 1098 + 35? — 50 +35 and A=, Vi=[1 00 0]! M=2, Ve=[0 20 0) ds=3 Va=[0 0 3 0]! Mad Vi=[0.00 4)" 163 164 CHAPTER 11. EIGENVALUES AND EIGENVECTORS 2 (a4 (b) (3+ VIN) /2 ()5 (a) 1889/57 (e) 4 3. (a) |] A lla= 4.130649, || A |o= 5 (b) A 379685, || A lloo= 11 (©) I] A ll= 5.000000, || A llo= 5 (4) I] A [= 4.680464, || A lo= 6 (¢) |] A lla= 6.281336, | A lloo= 7 4. (@) The matrix A [ 2G | is dingonalizable since the eigenvectors Vi=[-1 1]' and V2=[2 3] are linearly independent. Let v-[4 3 Jette = | 3 =F | ana vw =a aI - [3 3] “(44 = diag(-1,4) =D ) 6581 -0.0065] y1_[ 0814 0.6190 0.7530 -0.7951 0.7684 0.6716 = v-tay = [ 5.8655. 0.0000 Deveav= [Sat Sets © O7071 0.7071] ya _f 07071-07071 -0.7071 0.7071 oor. 0.7071 —-y-tay = | ~5:0000 0.0000 paveay=[ Simo 1m (a) 0.4871 -0.3059 0.6522 0.6509 -0.9447 -0.2766, v 0.5824 ~0.1182 —0.7058 11.1. HOMOGENEOUS SYSTEMS: THE EIGENVALUE PROBLEM. 0.5569 1.2050 1.3318 vot=| -13752 0.5669 1.0628, 0.2292 0.8993 ~0.4960 3.3914 0.0000 0.0000 D=V Av = | 0.0000 1.729 0.0000 0.0000 0.0000 ~1.1642 ©) 0.5571 0.4625 0.7428 0.7471 o3714 0.4269 0.0000 0.2135 1.0000 1.0000 0.5000 0.3333 0.0000 1.4142 -2.8984 0.7071 a 0.0000 0.0000 2.6926 —5.3852 0.0000 0.0000 0.0000 4.6845 ama ig | 02 00 oe oo030 looo4 5. mp | c0s(8) —sin(o) cos(0) sin(8) =e [ey cos(?) | | —sin() cos(é) [ot]-r (b) The characteristic polynomial of aeney _ = (cos(0) ~ A)? + sin(@) = X= 2e08(0)A+1 Real eigenvalues occur when the discriminant is nonnegative: (-2e0s(9))? - 400) > 0 cos?(9) > 1s or 8 = nz, where n is an integer. 165 CHAPTER 11. EIGENVALUES AND EIGENVECTORS R,(a)(Re(a))! = 1 0 o 10 0 0 cos(a) —sin(a) [: os(a) sina) 0 sin(a) sat) 0 —sin(a) cos(a) il 0 =|0 costa) (a) 0s(a) sin(a) — sina) cos(a) 0. sin(a) cos(a) ~ cos(a) sin(a) Sin®(a) + e0s°(a) =1 RAR (A) = cos(s) 0 “P| [= 0 3] oO oe 0 1 0 in(3) 0 cos(8) J | sin(s) 0 cos(s) 05%(/8) + sin®(8) 0 —cos(8) sin() + sin( (8) cos(8) | = 0 1 ) 0 —sin() cos() 0 sin?(B) + c08°(@) R,(9)(Re(7))! = 8) ea) ae 1 ed) “xo aly on 5 sino) oan) enn) inen) na) + cosa) cos(y) ~ sin(y) *|[- cos(y) _sin(y) ‘| : =I (b) ‘The characteristic polynomial of Rp(a) is AA) = (A~ 1)((A—cos(a))? + sin?(a)) = (A= 1)(462 — 2d cos(a) + 1) ‘The eigenvalues are real when a= ne. The characteristic polynomial of 2,(3) is 21) = (A= 1)((A — 0568)? + sin2(4)) ‘The eigenvalues are real when 1 = nz. 11.1. HOMOGENEOUS SYSTEMS: THE FIGENVALUE PROBLEM 167 ‘The characteristic polynomial of R(1) is 4) = (A= 1)((A ~c08(})? + sin®()) ‘The eigenvalues are real when =n. 7 @) HA) = A= (a+aA—a) ~4 62+ (-a~(a+3))A+a(a43)—4 N= (B42a)\ 40? 4 804 (b) Solving p(A) = 0 yields y = B+2)+ VORP Tae = RAM OE ee (3+2a) + V2 2 = at4a-1 (©) Substituting A= a+4 and A= a~1 into (AL A) = 0 yields the linear systems 2y-2e, = 0 ~dey~ 29 24422 = 0" 02r— 49 with solutions where ¢ is an arbitrary constant. 8, By induction: Assume for nm; ATX = \"X where X40. Then A™X = A(A"X) = A(A"X) (AX) = 9X, ‘Thus * is an cigenvalue of A* provided A is an eigenvalue of A. It follows that V is an cigenvector associated with AF (let X = V), 9, From Exercise 8: if 3, V is an eigenpair of A, then 3%, V is an eigenpair of A? 10. wv A71QV) 2A“) yv 168 CHAPTER 11. EIGENVALUES AND El 3ENVECTORS U1. Since AV = 5Y, it follows that; (A —1)V. ‘Thus 5, V is an eigenpair of the matrix A ~ I 12 (a) (=1)%eq = pl0) = det(A.— OF) = det(A). Thus cy = (—1)"det( A), (b) In the characteristic polynomial, the coefficient cy is (~1)* times the sum of the principal minors of order k. Thus a= (Shaye Say, WV -V =5V-V =4Vv, where |a,,| represents the deterininant of a 1x 1 matrix. 18, By induetion: Assume for k =m; A™ = Vdiog(AP,AP,...,\)V-) Then Am oo Ama (Valiag( Ap YP... AM)V—2)(Vidiag( Ar, d2y--+5%n)V—2) = Vaiag AP ag, ameiyy—t ‘Therfore, if k is a positive integer, then AX = Valiag(A¥, Mf... AK)V—2 11.2 Power Method 1, (A =all)V = AV ~aV = AV —aV = (\—a)V. Therefore, (Aa), V is an eigenpair of the matrix A — al. 2 AV = Av. A-YAVY) = ATV) Vv = Naty) atv = iv ‘Thus 1/A, V is an eigeupaie of the matrix A~! 3. AV = Ov aV-aV (A-a)V rgV = (A-al)V; provided 2 # a, ‘Therefor aly. =, V is an cigenpair of the matrix (A — BV; (A~AVi XV; = AV, -AViX'V, AW = AaVi (a a1)Va ov, 11.3. JACOBI'S METHOD 169 ‘Thus 0, Vy is an cigenpair of the matrix V. 3B. (a) lA al] (0.8 ~ 4X07 — 2) - 0.06, 2? ~ 1.52.4 0.56 ~ 0.06 X= 152405 = Q-1e-05) (b) The augmented matrix for the sysiem (A — (1)I)V = 0 is -02 03 02 -03 The set of nonzero solutions (eigenvectors) of the linear system is {3/2 1) ste Rego}, (©) A[ 30,000 20,000 J’ = [ 30,000 20,000 |’ 11.3 Jacobi’s Method 1, (a) Let K and M be the given matrices of spring constants and masses, respectively. Let X =| xi(¢) x(t) a(t) ]'. Making the substi- tution 2,(t) = vj sin(wt +0) yields: X= sin(ut +8) [m1 vm v5 |! and X"—uPsinwt+6)( v1 2 oJ IV =[m wus |’, ‘then the given system can be written as: K(in(wt +8)V) + M(-u" sin(wt + 6)V) = 0 or KV (MOK(V which is the desired system. M(-?V) ~wV, (6) Let de = uf. Then 20 = uf" sin'/Tet-+ 6) for k= 1,2,8. ‘There- fore, Kale) = sin( VRE 0) [of wf 06]! for k= 1,2,3. 170 CHAPTER !1. EIGENVALUES AND EIGENVECTORS [40e:) 1 © [8-9 [4 Ne() 08 [ oss} ]- [eS tee | oe [2 Joe [2] 2 xn=se[2]42[-2] (b) XO) = Ge" [ a ] tote] ; ] 1 1 1 xo=-te[] [2] 14 t 1 4 16 11.4 Eigenvalues for Symmetric Matrices 1. Note: Z and W are perpenicular if and only if Z-W = 0. Thus mew = Ux+y)-hx-y) #X-X+Y-X-X-Ysy¥-y) & (ix? - xP) = f0)-0, since by hypothesis {[X_] = IY 41.4, BIGENVALUES FOR SYMMETRIC MATRICES m 2. P! = (1+ (-2)XX’)' =14 (—2) (XX’)' =14 (-2)XX/ =P 3. (a) From (2): P'P = P? (0) PP =I

You might also like