Description
1. (a) [10 pts] Write a program that finds a root of the equation f(x) = sin(x) + 0.25
using the bisection method, starting from initial guesses of x = −1 and x = 1. Note the
number of iterations required to get |f(x)| < 0.0001 and observe the pattern in how the
error changes at each step (i.e., does it decrease smoothly?)
(b) [7 pts] What happens to the number of iterations required to get |f(x)| < 0.0001—
and the pattern in the error as the answer converges—if the initial guesses are changed
to x = −1 and x = 0? Why?
(c) [7 pts] Now mess around with the initial guesses, exploring the interval between
x = −1 and x = 7, and see if you can find some other roots. Turn in the x values of the
other roots that you find, along with the values of the initial guesses that you used in
each case.
2. [10 pts] Write a program that finds a root of the equation f(x) = sin(x) + 0.25 using
the secant method, starting from initial guesses of x = −1 and x = 1. Note the number
of iterations required to get |f(x)| < 0.0001.
3. [10 pts] Write a program that finds a root of the equation f(x) = sin(x) + 0.25
using Newton’s method, starting from an initial guess of x = −1. Note the number of
iterations required to get |f(x)| < 0.0001.
4. [8 pts] Compare the convergence patterns of the three methods (bisection, secant,
Newton) that you observed in the previous problems. Are they consistent with what
you know about the theoretical convergence rates and patterns of these two methods?
Explain why or why not.
5. [8 pts] Use the fixed point method and an initial guess of x = 1 to find roots of
f(x) = x
3 − 3x
2 − x + 3. Try a number of rearrangements until you find at least one
that converges and at least one that doesn’t. Explain this result: what is it about the
rearrangement that makes one converge and the other not? (You’re going to have to
explore guesses near x = 1 to answer this properly...)
1