Brent’s Algorithm Example
Operate the secant method to get the three roots with the cubic polynomial f[x] = 4x2 –16x2+17x-4.
Show information on the actual computations for that beginning value p0=3 and p1= 2.8
Solution:
Enter the function.
F[x_] = 4x3 -16x2 +17x -4
Print[{"f[x]="}, f[x]];
F[x] = -4+17x-16x2+4x2
The formula of secant iteration: g[x0, x1]
![Brent’s Algorithm Example 1](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-1.png)
The formula of second iteration is,
![Brent’s Algorithm Example 2](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-2.png)
Hopefully, this iteration pn+1 = g[pn-1, pn] will probably converge into a root of f[x]. Graph this function y=f[x]
![Brent’s Algorithm Example 3](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-3.png)
Y=f[x] = -4+17x-16x2+4x2
There are three kind real root.
Root(1) this root with starting the values p0=3.0 as well as p1=2.8.
Utilize the secant method to find a numerical approximation for the root Initial, do the iteration one step at the same time.
Kind each one of the subsequent commands inside an individual cell and execute these one-by-one.
![Brent’s Algorithm Example 4](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-4.png)
Now use the subroutine.
![Brent’s Algorithm Example 5](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-5.png)
In the graph we find that two other real roots.
Root(2) Use the starting values p0=0.6 and p1=0.5
![Brent’s Algorithm Example 6](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-6.png)
Root(3) Use the starting values p0=1.0 and p1=1.1
![Brent’s Algorithm Example 7](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-7.png)
Evaluate the outcome along with Mathematica's built in numerical root finder.
![Brent’s Algorithm Example 8](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-8.png)
How they are good:
![Brent’s Algorithm Example 9](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-9.png)
Mathematica may also solve for that roots symbolically.
![Brent’s Algorithm Example 10](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-10.png)
The actual solutions could be manipulated in to actual expressions.
![Brent’s Algorithm Example 11](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-11.png)
The answers can be expressed in decimal form.
![Brent’s Algorithm Example 12](https://www.assignmenthelp.net/webimg/ahp/images/brents-algorithm-example-12.png)
These answers are in agreement with the ones we found with the secant method.