Math 128A - HW3 Solutions.pdf

# P 0 could not be used for newtons method because f 0

• Homework Help
• 7

This preview shows page 4 - 6 out of 7 pages.

p 0 = 0 could not be used for Newton’s method because f 0 (0) = 0. Exercise 2.3.12. Use all three methods in this section to find solutions to within 10 - 7 for the following problems. (a) x 2 - 4 x + 4 - ln x = 0 for 1 x 2 and for 2 x 4 Solution. We used the Matlab code posted on bCourses. For Newton’s method, we used intial points 1.5 and 3. p 0 = 1 . 5 converged in 4 iterations to p 4 = 1 . 412391172. p 0 = 3 converged in 4 iterations to p 4 = 3 . 057103550. For the secant method: initial points p 0 = 1 . 5 and p 1 = 1 . 6 converged to p 6 = 1 . 412391172 while initial points p 0 = 3 . 0 and p 1 = 3 . 1 converged to p 5 = 3 . 057103550. For the method of false position, we used starting points 1 and 2, and 2 and 4; the results were p 13 = 1 . 412391186 and p 19 = 3 . 057103526, respectively. Subscribe to view the full document.

Exercise 2.3.30(19). The iteration equation for the secant method can be written in the simpler form p n = f ( p n - 1 ) p n - 2 - f ( p n - 2 ) p n - 1 f ( p n - 1 ) - f ( p n - 2 ) . Explain why, in general, this iteration equation is likely to be less accurate than the one given in Algorithm 2.4. Solution. In the usual secant method, p n = p n - 1 - f ( p n - 1 )( p n - 1 - p n - 2 ) f ( p n - 1 ) - f ( p n - 2 ) , roundoff errors in computing f ( p n - 1 ), ( p n - 1 - p n - 2 ) and f ( p n - 1 ) - f ( p n - 2 ) cause loss of relative accuracy in the correction to p n - 1 . But this correction is likely to be much smaller than p n - 1 , so having only, say, two correct digits of the corrector can cause, say, the 11th and 12th digit to be fixed in updating p n - 1 to obtain p n . In the formula above, the new p n will not have more correct digits than the denominator, which may suffer severely from cancellation error (especially as the terms converge to the correct answer and f ( p n - 1 ) and f ( p n - 2 ) are both close to zero.) Exercise 2.4.1. Use Newton’s method to find solutions accurate to within 10 - 5 for the following problems. b. cos( x + 2) + x ( x/ 2 + 2) = 0 , ( - 2 x ≤ - 1) . Solution. Let f ( x ) = cos( x + 2) + x ( x/ 2 + 2). Then f 0 ( x ) = - sin( x + 2) + ( x/ 2 + 2) + x · 1 2 = x + 2 - sin( x + 2) . So to implement Newton’s method, we use fixed-point iteration with the function g ( x ) = x - f ( x ) f 0 ( x ) = x - cos( x + 2) + x ( x/ 2 + 2) x + 2 - sin( x + 2) . ( * ) Since the interval is [ - 2 , - 1], we will start with initial value - 1 . 5. Then the sequence of approxi- mations generated by Newton’s method is as follows: - 1 . 5 , - 1 . 47855 , - 1 . 46247 , - 1 . 4504 , - 1 . 44135 , - 1 . 43457 , - 1 . 42948 , - 1 . 42566 , - 1 . 4228 , - 1 . 42065 , - 1 . 41904 , - 1 . 41784 , - 1 . 41693 , - 1 . 41625 , - 1 . 41574 , - 1 . 41536 , - 1 . 41507 , - 1 . 41486 , - 1 . 4147 , - 1 . 41459 , - 1 . 41451 , - 1 . 41449 , - 1 . 41445 , - 1 . 41445 . The slow convergence rate is due to f ( x ) having a zero of multiplicity 4 at x = - 2. To see this, note that f ( s - 2) = cos( s ) - 1+ s 2 / 2 = O ( s 4 ), so f ( x ) = O ( | x + 2 | 4 ). In fact, Newton’s method fails to converge to the requested accuracy due to roundoff error in double-precision. (The answer is - 1 . 41421.) Exercise 2.4.6. Show that the following sequences converge linearly to p = 0. How large must n be before we have | p n - p | ≤ 5 × 10 - 2 ? b. p n = 1 n 2 , ( n > 1) . Solution. It is easy to show that 1 n 2 0 by a direct argument from the definition. Let > 0 choose N = d 1 e . Let n N with n > N . Then | p n - 0 | = | 1 n 2 | < 1 N 2 . You've reached the end of this preview.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern