CSC270 Tutorial on Root Finding
A ``root'' or ``zero'' of a function f(x) is a value
z at which f(z) = 0. Root finding is used in many
applications.
See the lecture
notes on the Newton and Secant methods of root finding. The
bisection method, which is not described in the notes, just keeps
dividing a root-containing interval in half. This interval [a,b] must
be initially chosen such that f(a)*f(b) < 0 (i.e. there must
be a root in [a,b]).
Instructions
- Select a root finding method and a function with the buttons on
the graph.
- Click on the graph to select an initial point or two, depending
upon the root finding method.
- Keep clicking to see the root finding in action.
- The point turns green when the root is found. Click to restart.
- The scrollbar changes magnification.
- Drag the mouse while holding down a button to shift the axes.
Things to check out
- What happens when bisection starts with the same sign of function
on each end of the interval? Try several functions.
- What happens when the various methods are searching for a double root,
like with the x^2 function?
- How does convergence compare with the various methods?
- Is a good test for the termination
of the Newton and secant methods? Can you find bad cases of early
termination?
Notes
No error checking is done on the initial inputs. In particular,
the bisection method doesn't check that the function has different
signs at each end of the interval. The Newton and secant methods stop
when . The bisection method stops when the
interval size is smaller than 0.04.
If nothing appears above, read this.
Java source code
(Other applets by James Stewart)