Find a root of an equation `f(x)=x^3+2x^2+x-1` using Secant method
Solution:
Here `x^3+2x^2+x-1=0`
Let `f(x) = x^3+2x^2+x-1`
Here
`1^(st)` iteration :
`x_0 = 0` and `x_1 = 1`
`f(x_0) = f(0) = -1` and `f(x_1) = f(1) = 3`
`:. x_2 = x_0 - f(x_0) * (x_1 - x_0)/(f(x_1) - f(x_0))`
`x_2 = 0 - (-1) * (1 - 0)/(3 - (-1))`
`x_2 = 0.25`
`:. f(x_2)=f(0.25)=0.25^3+2*0.25^2+0.25-1=-0.6094`
`2^(nd)` iteration :
`x_1 = 1` and `x_2 = 0.25`
`f(x_1) = f(1) = 3` and `f(x_2) = f(0.25) = -0.6094`
`:. x_3 = x_1 - f(x_1) * (x_2 - x_1)/(f(x_2) - f(x_1))`
`x_3 = 1 - 3 * (0.25 - 1)/(-0.6094 - 3)`
`x_3 = 0.3766`
`:. f(x_3)=f(0.3766)=0.3766^3+2*0.3766^2+0.3766-1=-0.2863`
`3^(rd)` iteration :
`x_2 = 0.25` and `x_3 = 0.3766`
`f(x_2) = f(0.25) = -0.6094` and `f(x_3) = f(0.3766) = -0.2863`
`:. x_4 = x_2 - f(x_2) * (x_3 - x_2)/(f(x_3) - f(x_2))`
`x_4 = 0.25 - (-0.6094) * (0.3766 - 0.25)/(-0.2863 - (-0.6094))`
`x_4 = 0.4888`
`:. f(x_4)=f(0.4888)=0.4888^3+2*0.4888^2+0.4888-1=0.0835`
`4^(th)` iteration :
`x_3 = 0.3766` and `x_4 = 0.4888`
`f(x_3) = f(0.3766) = -0.2863` and `f(x_4) = f(0.4888) = 0.0835`
`:. x_5 = x_3 - f(x_3) * (x_4 - x_3)/(f(x_4) - f(x_3))`
`x_5 = 0.3766 - (-0.2863) * (0.4888 - 0.3766)/(0.0835 - (-0.2863))`
`x_5 = 0.4635`
`:. f(x_5)=f(0.4635)=0.4635^3+2*0.4635^2+0.4635-1=-0.0073`
`5^(th)` iteration :
`x_4 = 0.4888` and `x_5 = 0.4635`
`f(x_4) = f(0.4888) = 0.0835` and `f(x_5) = f(0.4635) = -0.0073`
`:. x_6 = x_4 - f(x_4) * (x_5 - x_4)/(f(x_5) - f(x_4))`
`x_6 = 0.4888 - 0.0835 * (0.4635 - 0.4888)/(-0.0073 - 0.0835)`
`x_6 = 0.4655`
`:. f(x_6)=f(0.4655)=0.4655^3+2*0.4655^2+0.4655-1=-0.0002`
Approximate root of the equation `x^3+2x^2+x-1=0` using Secant method is `0.4655` (After 5 iterations)
`n` | `x_0` | `f(x_0)` | `x_1` | `f(x_1)` | `x_2` | `f(x_2)` | Update |
1 | 0 | -1 | 1 | 3 | 0.25 | -0.6094 | `x_0 = x_1` `x_1 = x_2` |
2 | 1 | 3 | 0.25 | -0.6094 | 0.3766 | -0.2863 | `x_0 = x_1` `x_1 = x_2` |
3 | 0.25 | -0.6094 | 0.3766 | -0.2863 | 0.4888 | 0.0835 | `x_0 = x_1` `x_1 = x_2` |
4 | 0.3766 | -0.2863 | 0.4888 | 0.0835 | 0.4635 | -0.0073 | `x_0 = x_1` `x_1 = x_2` |
5 | 0.4888 | 0.0835 | 0.4635 | -0.0073 | 0.4655 | -0.0002 | `x_0 = x_1` `x_1 = x_2` |
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then