ebook img

An Introduction to Numerical Analysis - Solutions PDF

190 Pages·0.484 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview An Introduction to Numerical Analysis - Solutions

An Introduction to Numerical Analysis Solutions to Exercises Endre Su(cid:127)li and David F. Mayers University of Oxford CAMBRIDGE UNIVERSITY PRESS Cambridge New York Port Chester Melbourne Sydney 1 Solution to Exercise 1.1 The (cid:12)xed points are the solutions of 2 q(x) x 2x+c=0: (cid:17) (cid:0) Evidently q(0) = c > 0, q(1) = c 1 < 0, q(x) + as x , (cid:0) ! 1 ! 1 showing that 0<(cid:24)1 <1<(cid:24)2. Now 1 2 xn+1= 2(xn+c) 1 2 (cid:24)1= 2((cid:24)1 +c); so by subtraction 1 2 2 1 xn+1 (cid:24)1 = 2(xn (cid:24)1)= 2(xn+(cid:24)1)(xn (cid:24)1): (cid:0) (cid:0) (cid:0) It follows that if xn + (cid:24)1 < 2, then xn+1 (cid:24)1 < xn (cid:24)1 . Now j j j (cid:0) j j (cid:0) j (cid:24)1+(cid:24)2 =2,soif0 x0 <(cid:24)2 thenx0+(cid:24)1 <2,andevidentlyx0+(cid:24)1 >0. (cid:20) Hence x1 is closer to (cid:24)1 then was x0, so also 0 x1 <(cid:24)2. An induction (cid:20) argument then shows that each xn satis(cid:12)es 0 xn <(cid:24)2, and (cid:20) n x0+(cid:24)1 xn (cid:24)1 < x0 (cid:24)1 ; j (cid:0) j 2 j (cid:0) j (cid:18) (cid:19) and xn (cid:24)1. ! Now xn+1 is independent of the sign of xn, and is therefore also in- dependent of the sign of x0, and it follows that xn (cid:24)1 for all x0 such ! that (cid:24)2 <x0 <(cid:24)2. (cid:0) The same argument shows that if x0 >(cid:24)2 then x1 >x0 >(cid:24)2, and so xn . As before this means also that xn if x0 < (cid:24)2. !1 !1 (cid:0) If x0 = (cid:24)2 then of course xn = (cid:24)2 for all n > 0. If x0 = (cid:24)2, then (cid:0) x1 =(cid:24)2, and again xn =(cid:24)2 for all n>0. 2 Solution to Exercise 1.2 0 x 00 x 0 00 Since f (x) = e 1 and f (x) = e , f (x) > 0 and f (x) > 0 for (cid:0) all x > 0. It therefore follows from Theorem 1.9 that if x0 > 0 then Newton’s method convergesto the positive root. 0 00 Similarlyf (x)<0andf (x)>0in( ;0)andthesameargument (cid:0)1 shows that the method convergesto the negative root if x0 <0. 0 If x0 =0 the method fails, as f (0)=0, and x1 does not exist. For this function f, Newton’s method gives exp(xn) xn 2 xn+1=xn (cid:0) (cid:0) (cid:0) exp(xn) 1 (cid:0) 1 (xn+2)exp( xn) =xn (cid:0) (cid:0) (cid:0) 1 exp(xn) (cid:0) xn 1 n>1: (cid:25) (cid:0) (cid:0)100 In fact, e is very small indeed. In the same way, when x0 is large and negative, say x0 = 100, (cid:0) xn 2 xn+1 xn (cid:0) (cid:0) = 2: (cid:25) (cid:0) 1 (cid:0) (cid:0) Hence when x0 = 100, the (cid:12)rst few members of the sequence are 100;99;98;:::; after 98 iterations xn will get close to the positive root, andconvergencebecomesquadraticandrapid. About100iterationsare required to give an accurate value for the root. However, when x0 = 100, x1 is very close to 2, and is therefore (cid:0) (cid:0) veryclosetothenegativeroot. Three,orpossiblyfour,iterationsshould give the value of the root to six decimal places. 3 Solution to Exercise 1.3 Newton’s method is f(xn) xn+1 =xn 0 : (cid:0) f (xn) Toavoidcalculatingthederivativewemightconsiderapproximatingthe derivative by 0 f(xn+Æ) f(xn) f (xn) (cid:0) ; (cid:25) Æ where Æ is small. The given iteration uses this approximation, with Æ = f(xn); if xn is close to a root then we might expect that f(xn) is small. If xn (cid:24) is small we can write (cid:0) 0 1 2 00 3 f(xn)=f((cid:24))+(xn (cid:24))f ((cid:24))+ 2(xn (cid:24)) f ((cid:24))+ (xn (cid:24)) (cid:0) (cid:0) O (cid:0) 0 1 2 00 3 =(cid:17)f + 2(cid:17) f + ((cid:17)) O 0 00 where (cid:17) =xn (cid:24), and f and f are evaluated at x=(cid:24). Then (cid:0) 0 1 2 00 f(xn+f(xn)) f(xn)=f((cid:24)+(cid:17)+(cid:17)f + 2(cid:17) f ) f((cid:24)+(cid:17)) (cid:0) (cid:0) 0 2 1 2 0 00 0 2 00 3 =(cid:17)(f ) + 2(cid:17) [3f f +(f ) f ]+ ((cid:17)) : O Hence 2 [f(xn)] xn+1 (cid:24)=xn (cid:24) (cid:0) (cid:0) (cid:0) f(x+n+f(xn)) f(xn) (cid:0) 2 0 2 0 00 (cid:17) [(f ) +(cid:17)f f ] 3 =(cid:17) 0 2 1 0 0 00 + ((cid:17)) (cid:0) (cid:17)[(f ) + 2(cid:17)f (3+f )f ] O 00 0 2f (1+f ) 3 =(cid:17) + ((cid:17)) : 0 f O This shows that if x0 (cid:17) is suÆciently small the iteration converges (cid:0) 000 quadratically. The analysis here requires that f is continuous in a 3 neighbourhoodof(cid:24), to justify the terms ((cid:17) ). A morecarefulanalysis O 00 might relax this to require only the continuity of f . The leading term in xn+1 (cid:24) is very similar to that in Newton’s (cid:0) method, but with an additional term. Theconvergenceofthis method,startingfromapointclosetoaroot, isverysimilartoNewton’smethod. Butifx0 issomewayfromtheroot 0 f(xn) will not be small, the approximation to the derivative f (xn) is very poor, and the behaviour may be very di(cid:11)erent. For the example x f(x)=e x 2 (cid:0) (cid:0) 4 starting from x0 =1; 10 and 10 we (cid:12)nd (cid:0) 0 1.000000 1 1.205792 2 1.153859 3 1.146328 4 1.146193 5 1.146193 0 10.000000 1 10.000000 2 10.000000 3 10.000000 4 10.000000 5 10.000000 0 -10.000000 1 -1.862331 2 -1.841412 3 -1.841406 4 -1.841406 The convergence from x0 =1 is satisfactory. Starting from x0 = 10 (cid:0) we get similar behaviour to Newton’s method, an immediate step to x1 quite close to 2, and then rapid convergenceto the negative root. (cid:0) However, starting from x0 = 10 gives a quite di(cid:11)erent result. This time f(x0) is roughly 20000 (which is not small), and f(x0 +f(x0)) 9500 is about 10 ; the di(cid:11)erence between x0 and x1 is excessively small. Althoughtheiterationconverges,therateofconvergenceissoslowthat for any practical purpose it is virtually stationary. Even starting from x0 =3 many thousands of iterations are required for convergence. 5 Solution to Exercise 1.4 The number of correct (cid:12)gures in the approximation xn to the root (cid:24) is Dn =integerpartof log10 (cid:24) xn : f(cid:0) j (cid:0) jg From (1.24) for Newton’s method we have 00 (cid:24) xn+1 f ((cid:24)) j (cid:0) 2j j 0 j: (cid:24) xn ! 2f ((cid:24)) j (cid:0) j j j Hence Dn+1 2Dn B; (cid:25) (cid:0) where 00 f ((cid:24)) B =log10 j 0 j: 2f ((cid:24)) j j If B is small then Dn+1 is close to 2Dn, but if B is signi(cid:12)cantly larger than 1 then Dn+1 may be smaller than this. In the example, x f(x)=e x 1:0000000005 (cid:0) (cid:0) 0 x f (x)=e 1 (cid:0) 00 x f (x)=e ; and (cid:24) =0:0001. Hence 0:0001 e B =log10 0:0001 =3:7 2(e 1) (cid:0) andthenumberofsigni(cid:12)cant(cid:12)guresinthenextiterationisabout2k 4, (cid:0) not 2k. Starting from x0 =0:0005 the results of Newton’s method are 0 0.000500000000000 3 1 0.000260018333542 3 2 0.000149241714302 4 3 0.000108122910746 5 4 0.000100303597745 6 5 0.000099998797906 9 6 0.000099998333362 14 where the last column shows the number of correct decimal places. The root is (cid:24) =0:000099998333361to 15 decimal places. The number of correct (cid:12)gures increases by a factor quite close to 4. 6 Solution to Exercise 1.5 From (1.23) we have 2 00 ((cid:24) xn) f ((cid:17)n) (cid:24) xn+1 = (cid:0) 0 : (cid:0) (cid:0) 2f (xn) 0 Now f ((cid:24))=0, so by the Mean Value Theorem 0 0 00 f (xn) f ((cid:24))=(xn (cid:24))f ((cid:31)n) (cid:0) (cid:0) for some value of (cid:31)n between (cid:24) and xn. Hence 00 ((cid:24) xn)f ((cid:17)n) (cid:24) xn+1 = (cid:0) 00 : (cid:0) 2f ((cid:31)n) 00 00 Now f ((cid:17)n) <M and f ((cid:31)n) >m, and so j j j j (cid:24) xn+1 <K (cid:24) xn ; j (cid:0) j j (cid:0) j where M K = <1: 2m Henceifx0liesinthegiveninterval,allxnlieintheinterval,andxn (cid:24). 00 00 00 00 ! Then (cid:17)n (cid:24), f ((cid:17)n) f ((cid:24)) and f ((cid:31)n) f ((cid:24)). This shows that ! ! ! (cid:24) xn+1 1 (cid:0) 2 (cid:24) xn ! (cid:0) and convergenceis linear, with asymptotic rate of convergence ln2. x 0 Fortheexamplef(x)=e 1 x,f(0)=0,f (0)=0. Startingfrom (cid:0) (cid:0) x0 =1, Newton’s method gives 0 1.000 1 0.582 2 0.319 3 0.168 4 0.086 5 0.044 6 0.022 7 0.011 8 0.006 9 0.003 10 0.001 1 showing (cid:24) x0 reducing by a factor close to 2 at each step. (cid:0) 7 Solution to Exercise 1.6 0 00 Whenf((cid:24))=f ((cid:24))=f ((cid:24))=0wegetfromthede(cid:12)nitionofNewton’s 000 method, provided that f is continuous in some neighbourhood of (cid:24), f(xn) (cid:24) xn+1=(cid:24) xn+ 0 (cid:0) (cid:0) f (xn) 1 3 000 6(xn (cid:24)) f ((cid:17)n) =(cid:24) xn+ 1 (cid:0) 2 000 (cid:0) 2(xn (cid:24)) f ((cid:31)n) (cid:0) 000 f ((cid:17)n) =((cid:24) xn) 1 000 : (cid:0) (cid:0) 3f ((cid:31)n) (cid:26) (cid:27) If we now assume that in the neighbourhood [(cid:24) k;(cid:24)+k] of the root (cid:0) 000 0<m< f (x) <M; where M <3m; j j then (cid:24) xn+1 <K (cid:24) xn ; j (cid:0) j j (cid:0) j where M K =1 <1: (cid:0) 3m Hence if x0 is in this neighbourhood, all the xn lie in the neighbour- hood, and Newton’s method convergesto (cid:24). Also, (cid:24) xn+1 2 j (cid:0) j ; (cid:24) xn ! 3 j (cid:0) j sothatconvergenceislinear,withasymptoticrateofconvergenceln(3=2). 8 Solution to Exercise 1.7 The proof follows closely the proof of Theorem 1.9. From (1.23) it follows that xn+1 < (cid:24), provided that xn lies in the interval I = [X;(cid:24)]. Since f is monotonic increasing and f((cid:24)) = 0, f(x) < 0 in I. Hence if x0 I the sequence (xn) lies in I, and is 2 monotonic increasing. As it is bounded above by (cid:24), it converges; since (cid:24) is the only root of f(x) = 0 in I, the sequence converges to (cid:24). Since 00 f is continuous it follows that 00 00 (cid:24) xn+1 f ((cid:17)n) f ((cid:24)) (cid:0) 2 = 0 0 ; ((cid:24) xn) (cid:0)2f (xn) ! (cid:0)2f ((cid:24)) (cid:0) so that convergenceis quadratic.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.