Math 3

4.9. Newton's method


The problem from the very beginning of Section 4.9 in Stewart, leads to the equation:

            48*x*(1+x)^60-(1+x)^60+1=0

How can we find the solution? We can start with the graph of the function appearing

in the left hand side of the equation:

> plot(48*x*(1+x)^60-(1+x)^60+1,x=0..0.01,y=-0.05..0.05);

[Plot]

One can get the solution by using Newton's method, as discussed in class ...

Newton's formula can be used in a variety of situations. For example, assume that you are

asked to evaluate sqrt(2) . What equation does sqrt(2) satisfy? Answer: x^2 = Float(2, 0) So we can apply

Newton's method to the function f(x)=x^2-2 , and the succesive approximations that we get

will be approximations of sqrt(2) .

> x:= 1:
for i from 1 to 5 do

printf(" n = %2d    x_n= %17.15f   sqrt(2) = %17.15f\n",i,evalf(x,17),evalf(sqrt(2),17));

x:= x/2 + 1/x:

end do:

n =  1    x_n= 1.000000000000000   sqrt(2) = 1.414213562373095
n =  2    x_n= 1.500000000000000   sqrt(2) = 1.414213562373095

n =  3    x_n= 1.416666666666667   sqrt(2) = 1.414213562373095

n =  4    x_n= 1.414215686274510   sqrt(2) = 1.414213562373095

n =  5    x_n= 1.414213562374690   sqrt(2) = 1.414213562373095

Next we modify the code above to get the solution to cos(x) = x .

> x:= 1:
for i from 1 to 5 do

printf(" n = %2d    x_n= %17.15f  \n",i,evalf(x,17));

x:= x + (cos(x)-x)/(sin(x)+1):

end do:

n =  1    x_n= 1.000000000000000  
n =  2    x_n= 0.750363867840244  

n =  3    x_n= 0.739112890911362  
n =  4    x_n= 0.739085133385284  

n =  5    x_n= 0.739085133215161  

Finally we obtain the interest rate of the problem that started the entire discussion:

> x:= 0.01:
for i from 1 to 10 do

printf(" n = %2d    x_n= %12.10f\n",i,evalf(x,17));

x:= x - (48*x*(x+1)^60 - (x+1)^60 +1 )/(60*48*x*(x+1)^59 + 48*(x+1)^60 -60*(x+1)^59):

end do:

n =  1    x_n= 0.0100000000
n =  2    x_n= 0.0082202481

n =  3    x_n= 0.0076802232

n =  4    x_n= 0.0076290513

n =  5    x_n= 0.0076286016

n =  6    x_n= 0.0076286042

n =  7    x_n= 0.0076286022

n =  8    x_n= 0.0076286021

n =  9    x_n= 0.0076286024

n = 10    x_n= 0.0076286014