Find `sqrt(12)` using Secant method
Solution:
Let `x=sqrt(12)`
`:.x^2=12`
`:.x^2-12=0`
i.e. `f(x)=x^2-12`
Here
`x` | 0 | 1 | 2 | 3 | 4 |
---|
`f(x)` | -12 | -11 | -8 | -3 | 4 |
---|
`1^(st)` iteration :
`x_0 = 3` and `x_1 = 4`
`f(x_0) = f(3) = -3` and `f(x_1) = f(4) = 4`
`:. x_2 = x_0 - f(x_0) * (x_1 - x_0)/(f(x_1) - f(x_0))`
`x_2 = 3 - (-3) * (4 - 3)/(4 - (-3))`
`x_2 = 3.4286`
`:. f(x_2)=f(3.4286)=3.4286^2-12=-0.2449`
`2^(nd)` iteration :
`x_1 = 4` and `x_2 = 3.4286`
`f(x_1) = f(4) = 4` and `f(x_2) = f(3.4286) = -0.2449`
`:. x_3 = x_1 - f(x_1) * (x_2 - x_1)/(f(x_2) - f(x_1))`
`x_3 = 4 - 4 * (3.4286 - 4)/(-0.2449 - 4)`
`x_3 = 3.4615`
`:. f(x_3)=f(3.4615)=3.4615^2-12=-0.0178`
`3^(rd)` iteration :
`x_2 = 3.4286` and `x_3 = 3.4615`
`f(x_2) = f(3.4286) = -0.2449` and `f(x_3) = f(3.4615) = -0.0178`
`:. x_4 = x_2 - f(x_2) * (x_3 - x_2)/(f(x_3) - f(x_2))`
`x_4 = 3.4286 - (-0.2449) * (3.4615 - 3.4286)/(-0.0178 - (-0.2449))`
`x_4 = 3.4641`
`:. f(x_4)=f(3.4641)=3.4641^2-12=0.0001`
Approximate root of the equation `x^2-12=0` using Secant method is `3.4641` (After 3 iterations)
`n` | `x_0` | `f(x_0)` | `x_1` | `f(x_1)` | `x_2` | `f(x_2)` | Update |
1 | 3 | -3 | 4 | 4 | 3.4286 | -0.2449 | `x_0 = x_1` `x_1 = x_2` |
2 | 4 | 4 | 3.4286 | -0.2449 | 3.4615 | -0.0178 | `x_0 = x_1` `x_1 = x_2` |
3 | 3.4286 | -0.2449 | 3.4615 | -0.0178 | 3.4641 | 0.0001 | `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