Example 1. Use the
secant method to find the three roots of the cubic
polynomial
.
Show details of the computations for the starting
value
.
Solution 1.
Enter the function.
The secant iteration formula
is
![[Graphics:../Images/BrentMethodMod_gr_23.gif]](../Images/BrentMethodMod_gr_23.gif)
Hopefully, the iteration
will
converge to a root of
.
Graph the function
.
![[Graphics:../Images/BrentMethodMod_gr_28.gif]](../Images/BrentMethodMod_gr_28.gif)
There are three real root.
Root (i) Starting
with the values
.
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.
Now use the subroutine.
![[Graphics:../Images/BrentMethodMod_gr_45.gif]](../Images/BrentMethodMod_gr_45.gif)
![[Graphics:../Images/BrentMethodMod_gr_46.gif]](../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_48.gif]](../Images/BrentMethodMod_gr_48.gif)
![[Graphics:../Images/BrentMethodMod_gr_49.gif]](../Images/BrentMethodMod_gr_49.gif)
Root (iii) Use the
starting values ![]()
.
![[Graphics:../Images/BrentMethodMod_gr_52.gif]](../Images/BrentMethodMod_gr_52.gif)
![[Graphics:../Images/BrentMethodMod_gr_53.gif]](../Images/BrentMethodMod_gr_53.gif)
Compare our result with Mathematica's built in numerical root finder.
![]()
Let's see how good they are.
![[Graphics:../Images/BrentMethodMod_gr_56.gif]](../Images/BrentMethodMod_gr_56.gif)
![]()
![[Graphics:../Images/BrentMethodMod_gr_58.gif]](../Images/BrentMethodMod_gr_58.gif)
![]()
![[Graphics:../Images/BrentMethodMod_gr_60.gif]](../Images/BrentMethodMod_gr_60.gif)
![]()
Mathematica can also solve for the roots symbolically.
![[Graphics:../Images/BrentMethodMod_gr_63.gif]](../Images/BrentMethodMod_gr_63.gif)
The answers can be manipulated into real expressions.
![[Graphics:../Images/BrentMethodMod_gr_65.gif]](../Images/BrentMethodMod_gr_65.gif)
The answers can be expressed in decimal form.
![[Graphics:../Images/BrentMethodMod_gr_66.gif]](../Images/BrentMethodMod_gr_66.gif)
![]()
These answers are in agreement with the ones we found with the secant method.
(c) John H. Mathews 2005