Practice implementing and analyzing root-finding algorithms.
Self-Assessment Questions¶
Test your understanding with these conceptual questions:
IVT: If and , what can you conclude about roots of in ?
Bisection: How many bisection iterations are needed to reduce a starting interval of width 1 to width 10-6?
Fixed Points: Given , does the iteration converge? What is the fixed point?
Convergence Rate: If a sequence converges linearly with rate , approximately how many iterations to reduce error by a factor of 10-6?
Newton’s Method: Why does Newton’s method fail or converge slowly for near ?
Bisection Method¶
Q3.1: Basic Bisection¶
Consider the function on the interval .
(a) Use the bisection method to find a zero with . How many iterations are required? Does the iteration count match expectations from the convergence analysis?
(b) What is the resulting absolute error? Could this error be predicted by the convergence analysis?
Q3.2: Finding Roots with Bisection¶
Using bisection, determine the following roots to within . For each, report the solution (8 significant figures) and number of iterations.
(a) The positive root of
(b) The real root of
(c) The smallest positive root of
(d) The smallest positive root of
(e) The root of closest to
Fixed Point Iteration¶
Q3.3: Cosine Fixed Point¶
Prove that for any , the iteration converges to a unique fixed point . Find to at least 12 decimal places.
Hint
It may be helpful to consider .
Q3.4: Sine Iteration¶
Consider the sequence with .
(a) Show that there is a unique fixed point.
(b) Show that the sequence is monotone decreasing using . Show it’s bounded below by zero. Conclude convergence.
(c) Plot the first 500 values on a semilogx plot. Estimate the slope as iteration number increases. What does this mean for the rate of convergence?
Q3.5: Convergence Analysis¶
For each iteration, determine if it converges to the indicated when is sufficiently close. If it converges, find the order of convergence using both graphical analysis and Taylor series expansion.
(a) ,
(b) ,
Newton’s Method¶
Q3.6: Newton’s Method Applications¶
Write programs to approximate the following values using Newton’s method with . Use Taylor’s theorem to find a good initial guess.
(a) and
(b) from a root-finding problem
(c) The positive root of
(d) The smallest positive root of
Hint for (d)
You need an expansion that handles the singularity at .
Q3.7: Newton’s Method Basins of Attraction¶
Apply Newton’s method to .
(a) Plot the function. Use Newton’s method with starting guesses close to the roots to find the two real roots to 8 digits.
(b) For starting values
x = np.linspace(-2, 2, 200), determine which converge to positive/negative roots and which fail to converge.(c) Extend to complex starting values for . Find all four roots. Create a plot showing regions of convergence for each root (Newton fractal).
Q3.8: Multiple Roots¶
The function has a double root at .
(a) Derive Newton’s method for this function. Show the iteration is well-defined for , and the convergence rate is similar to bisection.
(b) Implement Newton’s method starting from . Observe its performance.
(c) Could you use bisection for this problem? Explain.
Q3.9: Division Without Division¶
Suppose your calculator’s division button is broken (only +, −, × work).
(a) Given , suggest a quadratically convergent iteration to compute .
(b) Implement your algorithm with convergence criterion .
(c) Apply to with initial guesses and . Explain results.
(d) Use bit operations (like in fast inverse square root) to propose an algorithm for a good initial guess.
(e) Demonstrate numerically that your initial guess guarantees convergence.
Hint for (a)
To find , solve where , or equivalently ... but that uses division. Try .
Q3.10: Newton in 2D¶
Consider the system:
Find an approximate solution by taking 2 steps of Newton’s method starting from . Compute and .
Theory Questions¶
Q3.11: Newton for Multiple Roots¶
If is a root of multiplicity , then with .
(a) Write out Newton’s iteration function in terms of and .
(b) Show that . Explain why this implies only linear convergence.
Solution for (b)
Since is nonzero (for ), the fixed point theorem gives only linear convergence with rate .
For a double root (): For a triple root ():
The convergence slows as multiplicity increases.