2.6 Practice Problems
Problem 2.6.1. Use the bisection method to find \(\sqrt [3]{25}\) to within \(10^{-4}\), by solving \(x^3-25 = 0\) on \([2,3]\). How many iterations does Theorem 2.1.3 require?
Show solution
Solution. \(f(2) = -17<0<2 = f(3)\), so there is a root in \((2,3)\). We need \(2^{-N}<10^{-4}\), that is \(N\geq 14\). Fourteen iterations give \(p_{14} = 2.92401\), and \(\sqrt [3]{25} = 2.9240177\). The first steps are \(p_1 = 2.5\) (\(f<0\)), \(p_2 = 2.75\) (\(f<0\)), \(p_3 = 2.875\) (\(f<0\)), \(p_4 = 2.9375\) (\(f>0\)), \(p_5 = 2.90625\) (\(f<0\)).
Problem 2.6.2. Use Newton’s method to compute \(\sqrt 6\), starting from \(p_0 = 1\), and show that the method is Heron’s method.
Show solution
Solution. With \(f(x) = x^2-6\), \(p_n = p_{n-1}-\frac {p_{n-1}^2-6}{2p_{n-1}} = \frac 12\left (p_{n-1}+\frac {6}{p_{n-1}}\right )\), which is Heron’s iteration (Example 2.3.13). The iterates are \(3.5\), \(2.607143\), \(2.454256\), \(2.449494\), against \(\sqrt 6 = 2.449490\). The first step overshoots because \(p_0 = 1\) is far from the root; from then on the convergence is quadratic and from above.
Problem 2.6.3. Early computers had no division. Show that Newton’s method applied to \(f(x) = \frac 1x-a\) computes \(\frac 1a\) using only multiplication and subtraction, and use it to find \(\frac 17\) from \(p_0 = 0.1\). For which \(p_0\) does it converge?
Show solution
Solution. \(f'(x) = -\frac {1}{x^2}\), so \(p_n = p_{n-1}-\frac {1/p_{n-1}-a}{-1/p_{n-1}^2} = p_{n-1}(2-ap_{n-1})\). With \(a = 7\): \(0.13\), \(0.1417\), \(0.14284777\), \(0.1428571422\), against \(\frac 17 = 0.1428571429\). Writing \(e_n = 1-ap_n\) gives \(e_n = e_{n-1}^2\), so the iteration converges exactly when \(|1-ap_0|<1\), that is \(0<p_0<\frac 2a\), and then quadratically.
Problem 2.6.4. Show that \(g(x) = \frac {x^2+3}{5}\) has a unique fixed point in \([0,1]\), and find a bound on the number of iterations needed to approximate it to within \(10^{-5}\) from \(p_0 = 1\).
Show solution
Solution. On \([0,1]\), \(g\) is increasing with \(g(0) = 0.6\) and \(g(1) = 0.8\), so it maps \([0,1]\) into itself, and \(|g'(x)| = \frac {2x}{5}\leq 0.4 = k\). By the Fixed-Point Theorem there is a unique fixed point, \(p = \frac {5-\sqrt {13}}{2} = 0.6972\). With \(|p_1-p_0| = 0.2\), bound (2.4) requires \(\frac {0.4^n}{0.6}(0.2)<10^{-5}\), that is \(n>11.4\), so \(12\) iterations suffice. (Near \(p\) the slope is \(g'(p) = 0.279\), so fewer are needed in practice.)
Problem 2.6.5. Use the secant method with \(p_0 = 0\), \(p_1 = 1\) to solve \(e^{-x} = x\), and estimate the order of convergence from the errors.
Show solution
Solution. With \(f(x) = e^{-x}-x\) the iterates are \(0.61270\), \(0.56384\), \(0.56717036\), \(0.5671433066\), \(0.5671432904\), with errors \(4.6\times 10^{-2}\), \(3.3\times 10^{-3}\), \(2.7\times 10^{-5}\), \(1.6\times 10^{-8}\), \(7.9\times 10^{-14}\). The exponents of the errors, about \(1.3, 2.5, 4.6, 7.8, 13.1\), grow by a factor of about \(1.7\), close to the theoretical \(1.618\).
Problem 2.6.6. Let \(p\) be a zero of multiplicity \(m\) of \(f\). Show that \(g(x) = x-m\frac {f(x)}{f'(x)}\) has \(g'(p) = 0\), so that this iteration converges quadratically. Use it with \(m = 2\) for \(f(x) = 1-\cos x\) from \(p_0 = 1\), and compare it with plain Newton.
Show solution
Solution. With \(f = (x-p)^mq\), as in the proof of Theorem 2.5.3, \(\frac {g(x)-p}{x-p} = 1-\frac {mq(x)}{mq(x)+(x-p)q'(x)}\longrightarrow 1-1 = 0\), so \(g'(p) = 0\) and Theorem 2.3.11 gives quadratic convergence. For \(1-\cos x\) the root \(0\) is double (\(f(0) = f'(0) = 0\), \(f''(0) = 1\)). Plain Newton gives \(0.454\), \(0.223\), \(0.111\), \(0.0554\), \(0.0277\): halving each time. The modified iteration \(p_n = p_{n-1}-2\frac {1-\cos p_{n-1}}{\sin p_{n-1}}\) gives \(-9.3\times 10^{-2}\), \(6.6\times 10^{-5}\), \(1.3\times 10^{-12}\).
Problem 2.6.7. Explain why Newton’s method for \(f(x) = x^3-2x+2\) starting at \(p_0 = 0\) fails, and suggest a remedy.
Show solution
Solution. The iterates cycle \(0, 1, 0, 1,\dots \) (Example 2.4.6). The real root is \(-1.7693\), and \(f\) has a local minimum at \(x = \sqrt {2/3}\) and a local maximum at \(-\sqrt {2/3}\); starting values to the right of the maximum are pulled towards the minimum, where the tangent is nearly horizontal. The remedy is to bracket first: \(f(-2) = -2<0<2 = f(-1)\), and a few bisection steps on \([-2,-1]\) give a starting value from which Newton converges quadratically (for example \(p_0 = -1.5\) gives \(-1.8421\), \(-1.7728\), \(-1.769301\), \(-1.7692924\)).
Problem 2.6.8. Show that Aitken’s method is exact for a sequence of the form \(p_n = p+c\lambda ^n\) (\(c\neq 0\), \(0<|\lambda |<1\)): that is, \(\hat p_n = p\) for every \(n\).
Show solution
Solution. \(\Delta p_n = c\lambda ^n(\lambda -1)\) and \(\Delta ^2p_n = c\lambda ^n(\lambda -1)^2\), so \(\hat p_n = p+c\lambda ^n-\frac {c^2\lambda ^{2n}(\lambda -1)^2}{c\lambda ^n(\lambda -1)^2} = p+c\lambda ^n-c\lambda ^n = p\). Aitken’s method assumes exactly this geometric model of the error, and removes the error completely when the model is exact; for other linearly convergent sequences the model holds only asymptotically, which is why the improvement grows with \(n\).
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.