5.5: 2, 4, 6, 7

[Graphics:Images/index_gr_1.gif]

2)  When Newton introduced his method, he did so with the example [Graphics:Images/index_gr_2.gif].  Show that this equation has only one root, and find it.

[Graphics:Images/index_gr_3.gif]

    I started at [Graphics:Images/index_gr_4.gif] and it took 6 steps to stabilize all 11 decimal places:

[Graphics:Images/index_gr_5.gif]

from visual.graph import *
from math import *

start = 1.5
numberofsteps = 10
x = start
for n in range(0,numberofsteps):
    print n, x
    g = (x**3)-2*x-5
    gprime = 3*(x**2)-2
    x = x-(g/gprime)

[Graphics:Images/index_gr_6.gif]

4)  Using Newton's method to find a solution of [Graphics:Images/index_gr_7.gif]:

[Graphics:Images/index_gr_8.gif]

[Graphics:Images/index_gr_9.gif]

[Graphics:Images/index_gr_10.gif]

    I started at [Graphics:Images/index_gr_11.gif] and it took 5 steps to stabilize all 11 decimal places:

[Graphics:Images/index_gr_12.gif]

from visual.graph import *
from math import *

start = 1.5
numberofsteps = 10
x = start
for n in range(0,numberofsteps):
    print n, x
    g = (x**3)+3*(x**2)-5
    gprime = 3*(x**2)+6*x
    x = x-(g/gprime)

[Graphics:Images/index_gr_13.gif]

6)  One of the more surprising applications of Newton's method is to compute reciprocals.  To make things more concrete, we will compute [Graphics:Images/index_gr_14.gif].  Note that this number is the root of the equation [Graphics:Images/index_gr_15.gif].

[Graphics:Images/index_gr_16.gif]
[Graphics:Images/index_gr_17.gif]
[Graphics:Images/index_gr_18.gif]

[Graphics:Images/index_gr_19.gif]

[Graphics:Images/index_gr_20.gif]

[Graphics:Images/index_gr_21.gif]
[Graphics:Images/index_gr_22.gif]

    a)  Show that the formula of Newton's method gives us:

[Graphics:Images/index_gr_23.gif]

    So starting with Newton's formula:    (p284)

[Graphics:Images/index_gr_24.gif]
[Graphics:Images/index_gr_25.gif]

    b)  Using [Graphics:Images/index_gr_26.gif] and the formula from (a), compute [Graphics:Images/index_gr_27.gif] to a high degree of accuracy:

    It took 7 steps stabilize all 11 decimal places:

[Graphics:Images/index_gr_28.gif]

from visual.graph import *
from math import *

start = 0.5
numberofsteps = 10
x = start
for n in range(0,numberofsteps):
    print n, x
    g = (1.0/x)-3.4567
    gprime = -1/(x**2)
    deltax = -(g/gprime)
    x = x+deltax

    c)  Try starting with [Graphics:Images/index_gr_29.gif].  What happens?  Explain graphically what goes wrong:

    With [Graphics:Images/index_gr_30.gif] we very quickly diverge to [Graphics:Images/index_gr_31.gif].  If we look at the graph as we follow a few steps of the Newton' method we can see that the slope [Graphics:Images/index_gr_32.gif] and [Graphics:Images/index_gr_33.gif] at [Graphics:Images/index_gr_34.gif], so [Graphics:Images/index_gr_35.gif].  If we do one more step we see that [Graphics:Images/index_gr_36.gif] and we just keep getting farther away from our target.  This happens because we jumped over to the other part of the function with [Graphics:Images/index_gr_37.gif] and their are no roots in that direction.  Even though their are no roots Newton's method still keeps trying to find one, but never succeeds.

[Graphics:Images/index_gr_38.gif]

[Graphics:Images/index_gr_39.gif]

from visual.graph import *
from math import *

start = 1.0
numberofsteps = 10
x = start
for n in range(0,numberofsteps):
    print n, x
    g = (1.0/x)-3.4567
    gprime = -1/(x**2)
    deltax = -(g/gprime)
    x = x+deltax

[Graphics:Images/index_gr_40.gif]

7)  In this problem we will determine the maximum value of the function:

[Graphics:Images/index_gr_41.gif]

    a)  Graph [Graphics:Images/index_gr_42.gif] and convince yourself that the maximum value occurs somewhere around [Graphics:Images/index_gr_43.gif], where [Graphics:Images/index_gr_44.gif].

[Graphics:Images/index_gr_45.gif]

    b)  Compute [Graphics:Images/index_gr_46.gif]:

[Graphics:Images/index_gr_47.gif]
[Graphics:Images/index_gr_48.gif]
[Graphics:Images/index_gr_49.gif]
[Graphics:Images/index_gr_50.gif]
[Graphics:Images/index_gr_51.gif]

    c)  Since the answer to (b) is a fraction, it vanishes when its numerator does.  Setting the numerator equal to [Graphics:Images/index_gr_52.gif] gives a fourth-degree equation.  Use Newton's method to find a solution near [Graphics:Images/index_gr_53.gif].

[Graphics:Images/index_gr_54.gif]

[Graphics:Images/index_gr_55.gif]

[Graphics:Images/index_gr_56.gif]

from visual.graph import *
from math import *

start = 0.5
numberofsteps = 10
x = start
for n in range(0,numberofsteps):
    print n, x, deltax
    g = -3*(x**4)-4*(x**3)+1
    gprime = -12*(x**3)-12*(x**2)
    deltax = -(g/gprime)
    x = x+deltax

    d)  Compute the maximum value of [Graphics:Images/index_gr_57.gif]:

[Graphics:Images/index_gr_58.gif]


Converted by Mathematica      April 19, 2004