In: Advanced Math
Set up a spreadsheet that implements the secant method and then solves each of the problems. Use the graph of each function to select an initial guess. Recall the iteration formula for the secant method: X^k+1=x^k-[f(x^k)/f(x^k)-f(x^k-1)](x^k-x^k-1)
Put the formula for the function under the heading f(xk-1) and f(xk). In the cell under xk+1, put the secant method iteration formula. In the second row, replace the previous xk-1 with xk and then xk with xk+1. Now copy the two formulas down one row. At this point, one iteration of the secant method is displayed. To see more iterations, just copy the second row down for as many iterations as desired. If too many iterations are copied and the function difference becomes exactly zero, a divide by zero error will appear.
a. f(x) x-x^1/3-2
b.f(x)=xtanx-1
c.f(x)=x^4-e^x+1
d.f(x)x^2e^x-1
SOl:
part(a):
Table of iterations using secant method for the solution of f(x) using initial guess
n | x | f(x) | |
0 | -0.5 | -1.7063 | |
1 | -1 | -2 | |
2 | 2.404829 | -0.93493 | |
3 | 5.393651 | 1.639928 | |
4 | 3.490072 | -0.02679 | |
5 | 3.520664 | -0.00061 | |
6 | 3.52138 | 3.07E-07 | |
7 | 3.52138 | -3.5E-12 | |
8 | 3.52138 | 0 | |
9 | 3.52138 | 0 |
Part(b):
Secant iteration table using initial guess
n | x | f(x) |
0 | 0 | -1 |
1 | 0.5 | -0.72685 |
2 | 1.830488 | -7.88953 |
3 | 0.364986 | -0.86054 |
4 | 0.185569 | -0.96516 |
5 | 1.840659 | -7.65433 |
6 | -0.05324 | -0.99716 |
7 | -0.33692 | -0.88198 |
8 | -2.50922 | -2.83865 |
9 | 0.642258 | -0.51955 |
10 | 1.348291 | 4.959273 |
11 | 0.70921 | -0.39139 |
12 | 0.755957 | -0.28729 |
13 | 0.884978 | 0.081444 |
14 | 0.856481 | -0.0122 |
15 | 0.860194 | -0.00044 |
16 | 0.860334 | 2.53E-06 |
17 | 0.860334 | -5.2E-10 |
18 | 0.860334 | -8.9E-16 |
19 | 0.860334 | 0 |
Part(c):
Secant method Table with initial guess
n | x | f(x) | |
0 | -1 | 1.632121 | |
1 | -2 | 16.86466 | |
2 | -0.89285 | 1.226021 | |
3 | -0.80606 | 0.975529 | |
4 | -0.46803 | 0.421749 | |
5 | -0.2106 | 0.191865 | |
6 | 0.004264 | -0.00427 | |
7 | -0.00042 | 0.000417 | |
8 | -8.9E-07 | 8.88E-07 | |
9 | 1.85E-10 | -1.9E-10 | |
10 | -1.3E-16 | 0 | |
Part(d):
Secant Method table to approximate the solution of f(x) with initial guess
n | x | f(x) |
0 | 0 | -1 |
1 | 1 | 1.718282 |
2 | 0.367879 | -0.80449 |
3 | 0.569456 | -0.4269 |
4 | 0.797357 | 0.411215 |
5 | 0.685539 | -0.0672 |
6 | 0.701245 | -0.00852 |
7 | 0.703524 | 0.000217 |
8 | 0.703467 | -6.7E-07 |
9 | 0.703467 | -5.3E-11 |
10 | 0.703467 | 0 |