# Math 4650 Homework #4 due Friday, February 17 (2.5 #1d) The following sequence is linearly convergent.

Generate the ﬁrst ﬁve terms of the sequence {ˆn } using Aitken’s ∆2 method. p p0 = 0.5, Solution: We just use the formula (pn+1 − pn )2 . pn+2 − 2pn+1 + pn We generate pn up to n = 6 in order to get up to p4 . ˆ pn = p n − ˆ n 0 1 2 3 4 5 6 pn 0.5 0.8775825619 0.6390124942 0.8026851007 0.6947780268 0.7681958313 0.7191654459 pn ˆ 0.7313851863 0.7360866919 0.7376528716 0.7384692207 0.7387980650 pn = cos pn−1 , n≥1

The sequence pn converges linearly with rate ˆ converges linearly with rate pn+1 −p ≈ 0.46. pn −p ˆ

pn+1 −p pn −p

≈ −0.67, while the sequence pn ˆ

(2.5 #8) Use Steﬀensen’s method to ﬁnd, to an accuracy of 10−4 , the root of x − 2−x = 0 that lies in [0, 1] and compare this to the results of Exercise 8 of Section 2.2. (See Homework 3 solutions.) Solution: The standard ﬁxed-point method uses g(x) = 2−x . Steﬀensen’s method involves using ﬁxed-point iteration with the new function h(x) = x − [g(x) − x]2 . g(g(x)) − 2g(x) + x

2 In Exercise 8, we started with p0 = 3 , so we use the same starting point.

I will call qn the result of Steﬀensen’s method with qn = h(qn−1 ). I use Maple with 10-digit arithmetic. n 0 1 2 3 4 5 6 7 pn 0.6666666667 0.6299605249 0.6461940963 0.6389637114 0.6421740571 0.6407466531 0.6413809223 0.6410990063 1 qn 0.6666666667 0.6412161917 0.6411857443 0.6411857448 0.6411857444 0.6411857448 0.6411857444 0.6411857448

which implies that pn+2 − p = (pn+1 − p)(δn+1 + λ). (δn + λ)(δn+1 + λ − 1) − (δn + λ − 1) 2 . for every n. and show that limn→∞ δn = 0.5 #16) Prove Theorem 2. lim δn = lim n→∞ n→∞ pn − p Now we can solve this equation to get pn+1 − p = (pn − p)(δn + λ). In Exercise 8 of Section 2. Then express (ˆn − p)/(pn − p) in terms of δn . we get the error pn − p = pn − p − ˆ (pn+1 − pn )2 pn+2 − 2pn+1 + pn (pn − p)2 (δn + λ − 1)2 = pn − p − (pn − p) (δn + λ)(δn+1 + λ − 1) − (δn + λ − 1) (δn + λ − 1)2 = (pn − p) 1 − . we let δn = (pn+1 − p)/(pn − p) − λ as suggested. Plugging into Aitken’s formula. n→∞ pn − p lim Then the Aitken’s ∆2 sequence {ˆn }∞ converges to p faster than {pn }∞ in the sense p n=0 n=0 that pn − p ˆ lim = 0.14. We can also write pn+2 − 2pn+1 + pn = (pn+2 − p) − (pn+1 − p) − (pn+1 − p) − (pn − p) = (pn+1 − p)(δn+1 + λ − 1) − (pn − p)(δn + λ − 1) = (pn − p) (δn + λ)(δn+1 + λ − 1) − (δn + λ − 1) . and λ. δn+1 . we know that pn+1 − p − λ = λ − λ = 0. it wasn’t until p7 that we reached this accuracy. (2. Now consider Steﬀensen’s method. [Hint: Let δn = (pn+1 −p)/(pn −p)−λ. n→∞ pn − p To prove this.2.] p Solution: The theorem says: Suppose that {pn }∞ is a sequence that converges linearly to the limit p and that n=0 pn+1 − p < 1. Then by assumption. We have (adding and subtracting the limit p) pn+1 − pn = (pn+1 − p) − (pn − p) = (δn + λ − 1)(pn − p).We see that already q1 is within 10−4 of the desired root.

28 to attempt to ﬁnd this root.7368062997.28) Now f (0. Solution: We have f (0. but of course dividing by zero is always unpredictable.4 by a degree-one polynomial.25). but the nice thing is that since δn → 0 and δn+1 → 0.6 + f (1.1 #2bd) For the given functions f (x). The absolute error is 0. and x2 = 1. f (0.28) = 0.3x2 + 2. To approximate x = 1.Thus ﬁnally we have (δn + λ − 1)2 pn − p ˆ = lim 1 − n→∞ n→∞ pn − p (δn + λ)(δn+1 + λ − 1) − (δn + λ − 1)) lim .6 1.6) 1.25. x1 = 1.7214485851.6 #6) f (x) = 10x3 − 8.001.21141 = 0 has a root at x = 0.27) = 0 and f (0. MATLAB and Mathematica both give x2 = 0. so Newton’s method gets stuck: it gives something of the form 0 x2 = 0. Explain what happens.6.29.4) = 0. 0 which is undeﬁned. None of these programs are actually equipped to use L’Hopital’s rule to ﬁgure out what to do. The degree-one polynomial interpolation is P1 (x) = f (1.00001 and f (0.25) x − 1.4).28 − 0. (3.4).28) = −0.28) = −0.27 − . while Maple chokes and gives a “Float(undeﬁned)” error (presumably because it ﬁrst notices that the denominator is zero). so that P1 (1. we should use the points x1 and x2 (since they are closest to 1.409807615(x − 1.4) = 0.27. in the limit we can just plug in 0 and obtain pn − p ˆ (λ − 1)2 (λ − 1)2 =1− =1− = 0.27 (presumably because they ﬁrst notice that the numerator is zero and decide that the denominator doesn’t matter). √ (b) f (x) = 3 x − 1 Solution: The exact value is f (1. Construct interpolation polynomials of degree at most one and at most two to approximate f (1. so that Newton’s method at the ﬁrst step gives x1 = 0. 3 .27) = 0.799887214(x − 1. This looks like a mess. let x0 = 1.25 = −1.295x − 0. and ﬁnd the absolute error. n→∞ pn − p λ(λ − 1) − λ + 1 (λ − 1)2 lim (2. Use Newton’s method with an initial approximation x0 = 0.28 − f (0.015.01 = 0.25 − 1.25 x − 1.6 − 1.6) + 2.

The absolute error is 1.25 − 1) (1 − 1.25) x − 1.6 − 1.199548857(x − 1.080.25) = −7.4) = 15.6)(1.25 − 1.25 = −31.25). 4 .23569703(x − 1. The absolute error is 0.25 − 1.6) 1.6) (x − 1. The exact value is f (1. substantially larger than what we get using the ﬁrst-order polynomial.28 crosses the axis at 0.Figure 1: Problem 2.25)(x − 1. we use all three points to get P2 (x) = f (1.6 + f (1.016346025(x − 1)(x − 1.4) = 16. so that P1 (1.8169446701. and Newton’s method cannot continue past that point since it’s a degenerate root. The ﬁrst-degree polynomial is P1 (x) = f (1.25) + f (1. Thus P2 (1.04464677. To approximate with a degree-two polynomial.6 − 1.6 #6: The tangent line at x = 0.6 1.52151485(x − 1.07536663.6 − 1)(1.25 x − 1.03. (d) f (x) = e2x − x Solution: We do the same thing as above.6) (1.25).25) (x − 1.6) (x − 1)(x − 1.25)(1 − 1.6)(x − 1) + f (1) (1.6) + 65.4) = 0.27.6)(x − 1) + 4.

2 where 1.24 · 0. For the quadratic error we have |f (1.2 .25) + f (1. where 1 < ξ < 1.6.6]. so the error bound is 1.25 < ξ < 1.25)(1.4)| ≤ |f (ξ)| |(1.4) − P1 (1. 5 .4)| ≤ |f (ξ)| |(1.6) = 8e3.24.4 − 1.1 #4bd) Use Theorem 3.4) − P1 (1. 1.4)| ≤ 0. and we have |f (1. since ξ could be arbitrarily close to 1.6.25)(1.6.For degree two.6)(x − 1) + f (1) (x − 1. (3.1 #14) Let f (x) = ex . 1.6)| = 0. 2 2 where 1. We compute f (ξ) = 4e2ξ ≤ 4e3.4 − 1. we have P2 (x) = f (1.6) + 109.4 − 1.225. (3. 6 where 1 < ξ < 1.25)(1. (b) Solution: For the linear error we have |f (1. so we get the error bound 0. For the quadratic error we have |f (1. Hence the error is at most |f (1.4) − P2 (1. Hence the remainder formula does not give a useful bound in this case.59370733(x − 1.25)(1 − 1.4) − P2 (1.26976331.25) (x − 1. So we cannot say anything about the size of |f (ξ)| on the interval [1.25).6.25 < ξ < 1. for 0 ≤ x ≤ 2.002|f (ξ)|.6) (x − 1.6) (1.015 = 0.034. which blows 15 up at ξ = 1.4) = 15.4 − 1.2025248(x − 1)(x − 1.6)(x − 1) (1 − 1.6 − 1.25)(x − 1. Since f (ξ) = − 9 (ξ − 1)−5/3 .4 − 1.015|f (ξ)|.2 .6) (x − 1)(x − 1. Unfortunately we have f (ξ) = 10 (ξ − 1)−8/3 .6] occurs at 1. The maximum of the third derivative is f (1.6)| = 0.002|f (ξ)|.4 − 1.25.6 − 1)(1.4 − 1)(1.015|f (ξ)|. The absolute error is 0.4)| ≤ 2.25.3 to ﬁnd an error bound for the approximations in Exercise 2. and P2 (1.39. (d) Solution: Exactly as above we have the formulas |f (1. the maximum of |f (ξ)| on the interval [1.6)| = 0.25)(x − 1.25)| = 2.25) = −124.4) − P1 (1.47.9427881(x − 1)(x − 1.4)| ≤ |f (ξ)| |(1.6) + 42.

if we had used 0.5) = 2.75) = 2.25)−f (0.a.5.25) = 1.25) using linear interpolation with x0 = 0 and x1 = 0.5 (0. 1 − 0.25) = 1. Solution: The same formula as above yields P1 (0.25 + e0. Approximate f (0. and a third value between 0 and 0.105084812.1 #17) Suppose you need to construct eight-decimal-place tables for the common.75) using linear interpolation with x0 = 0.5 and x1 = 1. In this case we plug in and get P1 (0.75) = −e0. but actually the linear interpolation does better since it uses points that are much closer to the values under consideration.75) = 2.117000017.066501533.5 − 0 b.040335219 and |P1 (0.5.25)| = 0. (3. and 2. d.5.25)| = 0.011915205.75 − 0.25) and f (0.25) = e0 · 0. logarithm function from x = 1 to x = 10 in such a way that linear interpolation is accurate to within 10−6 . Therefore P2 (0.5 to approximate the value at 0. The errors in the quadratic approximation are |P2 (0. Determine a bound for the step size for this table. ln 10 . Solution: We write P2 (x) = f (0) (x − 1)(x − 2) (x − 0)(x − 2) (x − 0)(x − 1) + f (1) + f (2) (0 − 1)(0 − 2) (1 − 0)(1 − 2) (2 − 0)(2 − 1) 1 2 1 = 2 (x − 1)(x − 2) − ex(x − 2) + 2 e x(x − 1).75)| = 0.284025417 and f (0.183501550.25) − f (0. and x2 = 2. What choice of step size would you make to ensure that x = 10 is included in the table? Solution: The base-10 logarithm is f (x) = 6 ln x .5 · 0.75) by using the second interpolating polynomial with x0 = 0. or base-10. 0.75) − f (0.75 − 1) + e1 (0. And certainly if we use 0. Approximate f (0.75) − f (0. Solution: We have P1 (x) = f (x0 ) x − x1 x − x0 −f (x0 )(x − x1 ) + f (x1 )(x − x0 ) + f (x1 ) = x0 − x1 x1 − x0 x1 − x0 in general.324360636. x1 = 1. and 1 for the quadratic approximation. we would deﬁnitely expect to do better. So the errors in using the linear approximations are |P1 (0.25 = 1. 0. 1. we might expect it to do better than the linear approximation.75)| = 0.152774291 and P2 (0.25 is smarter than using 0.5 c.5. Using 0 and 0. We might have expected the quadratic approximation to do better. 0.131251126 and |P2 (0. Approximate f (0. Which approximations are better and why? Solution: The exact values are f (0. On the other hand.

8 ln 10 √ and we want this to be less than 10−6 . ln 10 1 Since f (ξ) = − x2 ln 10 . Hence the error is h2 |f (x) − L(x)| ≤ |f (ξ)| . 8 1≤ξ≤10 1 .004. the error of a linear interpolation is |f (x) − L(x)| = f (ξ) (x − xi )(x − xi+1 ) 2 for some ξ ∈ (xi . we get that at x = xi + h/2. xi+1 ). Since we want 10/h to be an integer (in order for 10 to be in the table). Now the quadratic polynomial (x − xi )(x − xi+1 ) attains its maximum halfway between xi and xi+1 . 8 for some ξ ∈ (xi . (x − xi )(x − xi+1 ) = (h/2)(−h/2) = −h2 /4. Since xi+1 = xi + h where h is the step size. the absolute value is maximized at x = 1. so |f (ξ)| ≤ Thus the maximum error is sup |f (x) − L(x)| ≤ 1≤x≤10 h2 .On each of the intervals xi to xi+1 . So we choose h < 10−3 8 ln 10 ≈ 0. The maximum possible error over all possible intervals is sup |f (x) − L(x)| ≤ 1≤x≤10 h2 sup |f (ξ)|. it might be convenient to choose h = 0. the maximum occurs at x = xi + h/2. xi+1 ). 7 . Plugging in.00429.