Example 1.  Use the secant method to find the three roots of the cubic polynomial  [Graphics:Images/SecantMethodMod_gr_18.gif].  
Determine the secant iteration formula  [Graphics:Images/SecantMethodMod_gr_19.gif]  that is used.  
Show details of the computations for the starting value  [Graphics:Images/SecantMethodMod_gr_20.gif].

Solution 1.

Enter the function.  

[Graphics:../Images/SecantMethodMod_gr_21.gif]
[Graphics:../Images/SecantMethodMod_gr_22.gif]

The secant iteration formula  [Graphics:../Images/SecantMethodMod_gr_23.gif]  is

[Graphics:../Images/SecantMethodMod_gr_24.gif]

[Graphics:../Images/SecantMethodMod_gr_25.gif]
[Graphics:../Images/SecantMethodMod_gr_26.gif]

Hopefully, the iteration  [Graphics:../Images/SecantMethodMod_gr_27.gif]  will converge to a root of  [Graphics:../Images/SecantMethodMod_gr_28.gif].

Graph the function  [Graphics:../Images/SecantMethodMod_gr_29.gif].

[Graphics:../Images/SecantMethodMod_gr_30.gif]

[Graphics:../Images/SecantMethodMod_gr_31.gif]

[Graphics:../Images/SecantMethodMod_gr_32.gif]

There are three real root.

Starting with the values  [Graphics:../Images/SecantMethodMod_gr_33.gif].  

Use the secant method to find a numerical approximation to the root.  

First, do the iteration one step at a time.  

Type each of the following commands in a separate cell and execute them one at a time.

[Graphics:../Images/SecantMethodMod_gr_34.gif]
[Graphics:../Images/SecantMethodMod_gr_35.gif]

[Graphics:../Images/SecantMethodMod_gr_36.gif]
[Graphics:../Images/SecantMethodMod_gr_37.gif]

[Graphics:../Images/SecantMethodMod_gr_38.gif]
[Graphics:../Images/SecantMethodMod_gr_39.gif]

[Graphics:../Images/SecantMethodMod_gr_40.gif]
[Graphics:../Images/SecantMethodMod_gr_41.gif]

[Graphics:../Images/SecantMethodMod_gr_42.gif]
[Graphics:../Images/SecantMethodMod_gr_43.gif]

[Graphics:../Images/SecantMethodMod_gr_44.gif]
[Graphics:../Images/SecantMethodMod_gr_45.gif]

[Graphics:../Images/SecantMethodMod_gr_46.gif]
[Graphics:../Images/SecantMethodMod_gr_47.gif]

Now use the subroutine.

[Graphics:../Images/SecantMethodMod_gr_48.gif]

[Graphics:../Images/SecantMethodMod_gr_49.gif]
[Graphics:../Images/SecantMethodMod_gr_50.gif]
[Graphics:../Images/SecantMethodMod_gr_51.gif]
[Graphics:../Images/SecantMethodMod_gr_52.gif]
[Graphics:../Images/SecantMethodMod_gr_53.gif]
[Graphics:../Images/SecantMethodMod_gr_54.gif]
[Graphics:../Images/SecantMethodMod_gr_55.gif]
[Graphics:../Images/SecantMethodMod_gr_56.gif]
[Graphics:../Images/SecantMethodMod_gr_57.gif]
[Graphics:../Images/SecantMethodMod_gr_58.gif]
[Graphics:../Images/SecantMethodMod_gr_59.gif]

[Graphics:../Images/SecantMethodMod_gr_60.gif]
[Graphics:../Images/SecantMethodMod_gr_61.gif]
[Graphics:../Images/SecantMethodMod_gr_62.gif]

From the second graph we see that there are two other real roots.

Use the starting values  [Graphics:../Images/SecantMethodMod_gr_63.gif].  

[Graphics:../Images/SecantMethodMod_gr_64.gif]

[Graphics:../Images/SecantMethodMod_gr_65.gif]
[Graphics:../Images/SecantMethodMod_gr_66.gif]
[Graphics:../Images/SecantMethodMod_gr_67.gif]
[Graphics:../Images/SecantMethodMod_gr_68.gif]
[Graphics:../Images/SecantMethodMod_gr_69.gif]
[Graphics:../Images/SecantMethodMod_gr_70.gif]
[Graphics:../Images/SecantMethodMod_gr_71.gif]
[Graphics:../Images/SecantMethodMod_gr_72.gif]
[Graphics:../Images/SecantMethodMod_gr_73.gif]
[Graphics:../Images/SecantMethodMod_gr_74.gif]
[Graphics:../Images/SecantMethodMod_gr_75.gif]

[Graphics:../Images/SecantMethodMod_gr_76.gif]
[Graphics:../Images/SecantMethodMod_gr_77.gif]
[Graphics:../Images/SecantMethodMod_gr_78.gif]

Use the starting values [Graphics:../Images/SecantMethodMod_gr_79.gif][Graphics:../Images/SecantMethodMod_gr_80.gif].  

[Graphics:../Images/SecantMethodMod_gr_81.gif]

[Graphics:../Images/SecantMethodMod_gr_82.gif]
[Graphics:../Images/SecantMethodMod_gr_83.gif]
[Graphics:../Images/SecantMethodMod_gr_84.gif]
[Graphics:../Images/SecantMethodMod_gr_85.gif]
[Graphics:../Images/SecantMethodMod_gr_86.gif]
[Graphics:../Images/SecantMethodMod_gr_87.gif]
[Graphics:../Images/SecantMethodMod_gr_88.gif]
[Graphics:../Images/SecantMethodMod_gr_89.gif]
[Graphics:../Images/SecantMethodMod_gr_90.gif]

[Graphics:../Images/SecantMethodMod_gr_91.gif]
[Graphics:../Images/SecantMethodMod_gr_92.gif]
[Graphics:../Images/SecantMethodMod_gr_93.gif]

Compare our result with Mathematica's built in numerical root finder.

[Graphics:../Images/SecantMethodMod_gr_94.gif]

[Graphics:../Images/SecantMethodMod_gr_95.gif]

[Graphics:../Images/SecantMethodMod_gr_96.gif]

[Graphics:../Images/SecantMethodMod_gr_97.gif]

Let's see how good they are.  

[Graphics:../Images/SecantMethodMod_gr_98.gif]

[Graphics:../Images/SecantMethodMod_gr_99.gif]
[Graphics:../Images/SecantMethodMod_gr_100.gif]

[Graphics:../Images/SecantMethodMod_gr_101.gif]

[Graphics:../Images/SecantMethodMod_gr_102.gif]
[Graphics:../Images/SecantMethodMod_gr_103.gif]

[Graphics:../Images/SecantMethodMod_gr_104.gif]

[Graphics:../Images/SecantMethodMod_gr_105.gif]
[Graphics:../Images/SecantMethodMod_gr_106.gif]

Mathematica can obtain better numerical answers, but the number of iterations needs to be increased.

Mathematica can also solve for the roots symbolically.

[Graphics:../Images/SecantMethodMod_gr_107.gif]

[Graphics:../Images/SecantMethodMod_gr_108.gif]

[Graphics:../Images/SecantMethodMod_gr_109.gif]

[Graphics:../Images/SecantMethodMod_gr_110.gif]

[Graphics:../Images/SecantMethodMod_gr_111.gif]

The answers can be manipulated into real expressions.

[Graphics:../Images/SecantMethodMod_gr_112.gif]

[Graphics:../Images/SecantMethodMod_gr_113.gif]

[Graphics:../Images/SecantMethodMod_gr_114.gif]

[Graphics:../Images/SecantMethodMod_gr_115.gif]

The answers can be expressed in decimal form.

[Graphics:../Images/SecantMethodMod_gr_116.gif]

[Graphics:../Images/SecantMethodMod_gr_117.gif]

[Graphics:../Images/SecantMethodMod_gr_118.gif]

[Graphics:../Images/SecantMethodMod_gr_119.gif]

These answers are in agreement with the ones we found with the secant method.  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004