Example 1.  Use the secant method to find the three roots of the cubic polynomial  [Graphics:Images/BrentMethodMod_gr_17.gif].  
Show details of the computations for the starting value  [Graphics:Images/BrentMethodMod_gr_18.gif].

Solution 1.

Enter the function.  

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


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

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

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


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

 

 

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

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

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


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

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

There are three real root.

Root (i)  Starting with the values  [Graphics:../Images/BrentMethodMod_gr_30.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/BrentMethodMod_gr_31.gif]
[Graphics:../Images/BrentMethodMod_gr_32.gif]

[Graphics:../Images/BrentMethodMod_gr_33.gif]
[Graphics:../Images/BrentMethodMod_gr_34.gif]

[Graphics:../Images/BrentMethodMod_gr_35.gif]
[Graphics:../Images/BrentMethodMod_gr_36.gif]

[Graphics:../Images/BrentMethodMod_gr_37.gif]
[Graphics:../Images/BrentMethodMod_gr_38.gif]

[Graphics:../Images/BrentMethodMod_gr_39.gif]
[Graphics:../Images/BrentMethodMod_gr_40.gif]

[Graphics:../Images/BrentMethodMod_gr_41.gif]
[Graphics:../Images/BrentMethodMod_gr_42.gif]

[Graphics:../Images/BrentMethodMod_gr_43.gif]
[Graphics:../Images/BrentMethodMod_gr_44.gif]

Now use the subroutine.

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

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

 

 

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

Root (ii)  Use the starting values  [Graphics:../Images/BrentMethodMod_gr_47.gif].  

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

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

 

 

Root (iii)  Use the starting values [Graphics:../Images/BrentMethodMod_gr_50.gif][Graphics:../Images/BrentMethodMod_gr_51.gif].  

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

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

 

 

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

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

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

 

Let's see how good they are.  

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

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

 

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

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

 

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

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

 

Mathematica can also solve for the roots symbolically.

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


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

 

The answers can be manipulated into real expressions.

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

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

 

The answers can be expressed in decimal form.

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

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

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2005