- Newton1.java -- Uses Newton's method for
the function f(x) = x
^{3}- 3x^{2}+ 2x + 0.1. - Newton2.java -- Newton's method for the
function f(x) = x
^{3}- 3x^{2}+ 2x + 0.5. - Newton3.java -- Newton's method for the
function f(x) = x
^{4}- 7.08x^{3}+ 16.104x^{2}- 15.0524x + 5.03118 - Secant1.java -- Secant method for the same function as Newton1
- Secant2.java -- Secant method for the same function as Newton2
- StartPts1.java -- An applet that illustrates which root Newton's method converges to for different starting points. The function is the same as in Newton1.java.
- StartPts2.java -- Similar to the above but the function is the one used in Newton2.java
- start1.html -- HTML file to run the applet in StartPts1.java
- start2.html -- HTML file for the applet in StartPts2.java
- CubeRoots.java -- An applet to illustrate the convergence to the cube roots of unity in the complex plane.
- cube.html -- HTML file to run the cube root applet.

- Compile Newton1.java (
*javac Newton1.java*) and run it (*java Newton1*). Use 100 for the maximum number of iterates and 1e-11 for the tolerance. Try the following starting points: -100, -20, -1, 0.426, 0.4227, 1, 1.5, 1.6, 100 **Question**: Recall that the convergence rate for Newon's method is quadratic which basically means that the number of digits of accuracy doubles with each iteration. Generally you can see this by looking at the error estimates at each iterate. What happened in the examples you tried if you start with no digits of accuracy?- Do the same as #1 above for Newton2.java.
**Question**: You should note some cyclic behavior for some starting points. What feature on the graph is this related to?- Run Newton3.java with several different starting points and find the roots.
**Question**: What are the roots and what did you notice about the convergence rate?**Question**: The function in Newton3 has two roots but one is not a simple root -- the root has multiplicity 3. Hence rate of convergence is no longer quadratic. Describe the convergence -- how many digits of accuracy are gained at each iterate once the iterates settle down and start converging?- Note that Newton3.java does not use the best evaluation method
for computing f(x) and fprime(x). Modify the program to use
nested evaluation. Compile and run it to make sure it is correct.
- Problem #10 on page 86 gives a slight modification of Newton's method for the case of a root of multiplicity m. Copy Newton3.java to Newton3M.java and change the program to use the fixed point method of problem #10. Run the program.
**Question**: What do you observe about the convergence rate? How many digits of accuracy are gained at each iteration and how does it compare to the unaltered Newton's method.-
Now run the Secant1.java program and Secant2.java and try some
different starting points.
In particular find starting
points that illustrate the fact that the
order of the starting points makes a difference. Also find starting points
(for either function) for which the method does not converge in
100 iterates (if possible -- and it is! -- find starting points
that cause the method to cycle).
**Write down the examples you find (and the behavior).** **Question**The convergence rate for the Secant method is the golden ratio (approximately 1.618034), meaning that at each iterate the number of correct digits is multiplied by 1.618 approximately. Is there support for that in the output? Is it evident that the secant method tends to converge more slowly than Newton's method?- Copy one of the Secant programs and modify it for the function in
Newton3.java. Run it for several different pairs of starting points.
Write down the points and your observations about the convergence
behavior. In particular observe how the convergence rate compares to
Newton's method for the root with multiplicity 3.

javac StartPts1.java appletviewer start1.htmlPut different starting points and increments in the textboxes to see convergence behavior in different regions (sorry about the way the numbers are sometimes displayed -- no time to make it pretty!).

The most interesting pictures occur when complex functions are used.
The program CubeRoots.java performs Newton's method on the
complex function z^{3} - 1 and paints a picture
showing the results. The roots are called the cube roots
of unity -- one is at (1,0), another at (cos(2Pi/3), sin(2Pi/3)) and the
third at (cos(4Pi/3), sin(4Pi/3)) -- that is they are spaced equally
around the unit circle. Again black represents lack of convergence, while
the other 3 colors indicate which of the 3 roots Newton's method
converges to if started at the given point.

- Compile and run the program (use the cube.html file). It graphs the rectangular region from (-3,-3) to (3,3).
- Edit the program to narrow the region -- change the starting value of x and y to -0.5 and the increment to 0.002. Re-compile and run the program.