Home > Numerical methods calculators > Secant method example

5. Secant method example ( Enter your problem )
  1. Algorithm & Example-1 `f(x)=x^3-x-1`
  2. Example-2 `f(x)=2x^3-2x-5`
  3. Example-3 `x=sqrt(12)`
  4. Example-4 `x=root(3)(48)`
  5. Example-5 `f(x)=x^3+2x^2+x-1`
Other related methods
  1. Bisection method
  2. False Position method (regula falsi method)
  3. Newton Raphson method
  4. Fixed Point Iteration method
  5. Secant method
  6. Muller method
  7. Halley's method
  8. Steffensen's method
  9. Ridder's method

4. Fixed Point Iteration method
(Previous method)
2. Example-2 `f(x)=2x^3-2x-5`
(Next example)

1. Algorithm & Example-1 `f(x)=x^3-x-1`





Algorithm
Secant method Steps (Rule)
Step-1: Find points `x_0` and `x_1` such that `x_0 < x_1` and `f(x_0) * f(x_1) < 0`.
Step-2: find next value using
Formula-1 : `x_2=x_0-f(x_0)*(x_1-x_0)/(f(x_1)-f(x_0))`
or Formula-2 : `x_2=(x_0*f(x_1)-x_1*f(x_0))/(f(x_1)-f(x_0))`
or Formula-3 : `x_2=x_1-f(x_1)*(x_1-x_0)/(f(x_1)-f(x_0))`
(Using any of the formula, you will get same x2 value)
Step-3: If `f(x_2) = 0` then `x_2` is an exact root,
else `x_0 = x_1` and `x_1 = x_2`
Step-4: Repeat steps 2 & 3 until `f(x_i) = 0` or `|f(x_i)| <= "Accuracy"`

Example-1
Find a root of an equation `f(x)=x^3-x-1` using Secant method

Solution:
Here `x^3-x-1=0`

Let `f(x) = x^3-x-1`

Here
`x`012
`f(x)`-1-15



`1^(st)` iteration :

`x_0 = 1` and `x_1 = 2`

`f(x_0) = f(1) = -1` and `f(x_1) = f(2) = 5`

`:. x_2 = x_0 - f(x_0) * (x_1 - x_0) / (f(x_1) - f(x_0))`

`x_2 = 1 - (-1) xx (2 - 1)/(5 - (-1))`

`x_2 = 1.16667`

`:. f(x_2) = f(1.16667) = -0.5787`


`2^(nd)` iteration :

`x_1 = 2` and `x_2 = 1.16667`

`f(x_1) = f(2) = 5` and `f(x_2) = f(1.16667) = -0.5787`

`:. x_3 = x_1 - f(x_1) * (x_2 - x_1) / (f(x_2) - f(x_1))`

`x_3 = 2 - 5 xx (1.16667 - 2)/(-0.5787 - 5)`

`x_3 = 1.25311`

`:. f(x_3) = f(1.25311) = -0.28536`


`3^(rd)` iteration :

`x_2 = 1.16667` and `x_3 = 1.25311`

`f(x_2) = f(1.16667) = -0.5787` and `f(x_3) = f(1.25311) = -0.28536`

`:. x_4 = x_2 - f(x_2) * (x_3 - x_2) / (f(x_3) - f(x_2))`

`x_4 = 1.16667 - (-0.5787) xx (1.25311 - 1.16667)/(-0.28536 - (-0.5787))`

`x_4 = 1.33721`

`:. f(x_4) = f(1.33721) = 0.05388`


`4^(th)` iteration :

`x_3 = 1.25311` and `x_4 = 1.33721`

`f(x_3) = f(1.25311) = -0.28536` and `f(x_4) = f(1.33721) = 0.05388`

`:. x_5 = x_3 - f(x_3) * (x_4 - x_3) / (f(x_4) - f(x_3))`

`x_5 = 1.25311 - (-0.28536) xx (1.33721 - 1.25311)/(0.05388 - (-0.28536))`

`x_5 = 1.32385`

`:. f(x_5) = f(1.32385) = -0.0037`


`5^(th)` iteration :

`x_4 = 1.33721` and `x_5 = 1.32385`

`f(x_4) = f(1.33721) = 0.05388` and `f(x_5) = f(1.32385) = -0.0037`

`:. x_6 = x_4 - f(x_4) * (x_5 - x_4) / (f(x_5) - f(x_4))`

`x_6 = 1.33721 - 0.05388 xx (1.32385 - 1.33721)/(-0.0037 - 0.05388)`

`x_6 = 1.32471`

`:. f(x_6) = f(1.32471) = -0.00004`


Approximate root of the equation `x^3-x-1=0` using Secant method is `1.32471`

`n``x_0``f(x_0)``x_1``f(x_1)``x_2``f(x_2)`Update
11-1251.16667-0.5787`x_0 = x_1`
`x_1 = x_2`
2251.16667-0.57871.25311-0.28536`x_0 = x_1`
`x_1 = x_2`
31.16667-0.57871.25311-0.285361.337210.05388`x_0 = x_1`
`x_1 = x_2`
41.25311-0.285361.337210.053881.32385-0.0037`x_0 = x_1`
`x_1 = x_2`
51.337210.053881.32385-0.00371.32471-0.00004`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 Submit Here



4. Fixed Point Iteration method
(Previous method)
2. Example-2 `f(x)=2x^3-2x-5`
(Next example)





Share this solution or page with your friends.


 
Copyright © 2023. All rights reserved. Terms, Privacy
 
 

.