Bisection Method

Enter a function to find its roots
\frac{\sin(x)}{x}
Lower bound of the interval
Upper bound of the interval
Tolerance of the method
Maximum number of iterations

False Position Method

Enter a function to find its roots
\frac{\sin(x)}{x}
Lower bound of the interval
Upper bound of the interval
Tolerance of the method
Maximum number of iterations

Newton-Raphson Method

Enter a function to find its roots
x^2-2
Initial guess: x0
Tolerance of the method
Maximum number of iterations

Secant Method

Enter a function to find its roots
x^2-2
First initial guess: x0
Second initial guess: x1
Tolerance of the method
Maximum number of iterations

Summary

  • Function x^2 - 2
  • Python Function x**2 - 2
  • Lower Bound None
  • Upper Bound None
  • Initial Guess 6
  • Second Initial Guess 10
  • Tolerance 0.0001
  • Iteration Limit 100
  • Root 1.4142274330132922
  • Iteration Count 7
  • Error 3.9232287365909e-05
  • Condition True
  • Final X 1.4406991249382324
  • Final X 1.4157094798532652
  • Final X 1.4142274330132922
  • Final F(X ) 0.07561396859778835
  • Final F(X ) 0.004233331346402913
  • Final F(X) 3.9232287365909e-05

Iterations

  • Find the secant line of the function at the initial guesses

Iteration 1 of 7 with (6.0, 10.0)

x0 = 6.0
x1 = 10.0
f(x0) = f(6.0) = 34.0
f(x1) = f(10.0) = 98.0
x2 = x1 - f(x1) × (x1 - x0) / [f(x1) - f(x0)]
x2 = 10.0 - 98.0 × (10.0 - 6.0) / [98.0 - 34.0]
x2 = 3.875

|f(x2)| = |13.015625| > 0.0001 = Tolerance
|x2 - x1| = |3.875 - 10.0| > 0.0001 = Tolerance


Iteration 2 of 7 with (10.0, 3.875)

x1 = 10.0
x2 = 3.875
f(x1) = f(10.0) = 98.0
f(x2) = f(3.875) = 13.015625
x3 = x2 - f(x2) × (x2 - x1) / [f(x2) - f(x1)]
x3 = 3.875 - 13.015625 × (3.875 - 10.0) / [13.015625 - 98.0]
x3 = 2.936937

|f(x3)| = |6.625599| > 0.0001 = Tolerance
|x3 - x2| = |2.936937 - 3.875| > 0.0001 = Tolerance


Iteration 3 of 7 with (3.875, 2.936937)

x2 = 3.875
x3 = 2.936937
f(x2) = f(3.875) = 13.015625
f(x3) = f(2.936937) = 6.625599
x4 = x3 - f(x3) × (x3 - x2) / [f(x3) - f(x2)]
x4 = 2.936937 - 6.625599 × (2.936937 - 3.875) / [6.625599 - 13.015625]
x4 = 1.964292

|f(x4)| = |1.858442| > 0.0001 = Tolerance
|x4 - x3| = |1.964292 - 2.936937| > 0.0001 = Tolerance


Iteration 4 of 7 with (2.936937, 1.964292)

x3 = 2.936937
x4 = 1.964292
f(x3) = f(2.936937) = 6.625599
f(x4) = f(1.964292) = 1.858442
x5 = x4 - f(x4) × (x4 - x3) / [f(x4) - f(x3)]
x5 = 1.964292 - 1.858442 × (1.964292 - 2.936937) / [1.858442 - 6.625599]
x5 = 1.585113

|f(x5)| = |0.512583| > 0.0001 = Tolerance
|x5 - x4| = |1.585113 - 1.964292| > 0.0001 = Tolerance


Iteration 5 of 7 with (1.964292, 1.585113)

x4 = 1.964292
x5 = 1.585113
f(x4) = f(1.964292) = 1.858442
f(x5) = f(1.585113) = 0.512583
x6 = x5 - f(x5) × (x5 - x4) / [f(x5) - f(x4)]
x6 = 1.585113 - 0.512583 × (1.585113 - 1.964292) / [0.512583 - 1.858442]
x6 = 1.440699

|f(x6)| = |0.075614| > 0.0001 = Tolerance
|x6 - x5| = |1.440699 - 1.585113| > 0.0001 = Tolerance


Iteration 6 of 7 with (1.585113, 1.440699)

x5 = 1.585113
x6 = 1.440699
f(x5) = f(1.585113) = 0.512583
f(x6) = f(1.440699) = 0.075614
x7 = x6 - f(x6) × (x6 - x5) / [f(x6) - f(x5)]
x7 = 1.440699 - 0.075614 × (1.440699 - 1.585113) / [0.075614 - 0.512583]
x7 = 1.415709

|f(x7)| = |0.004233| > 0.0001 = Tolerance
|x7 - x6| = |1.415709 - 1.440699| > 0.0001 = Tolerance


Iteration 7 of 7 with (1.440699, 1.415709)

x6 = 1.440699
x7 = 1.415709
f(x6) = f(1.440699) = 0.075614
f(x7) = f(1.415709) = 0.004233
x8 = x7 - f(x7) × (x7 - x6) / [f(x7) - f(x6)]
x8 = 1.415709 - 0.004233 × (1.415709 - 1.440699) / [0.004233 - 0.075614]
x8 = 1.414227

|f(x8)| = |3.9e-05| ≤ 0.0001 = Tolerance
|x8 - x7| = |1.414227 - 1.415709| ≤ 0.0001 = Tolerance