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 \sin(x) / x
  • Python Function sin(x)/x
  • Lower Bound 1
  • Upper Bound 4
  • Initial Guess None
  • Second Initial Guess None
  • Tolerance 0.0001
  • Iteration Limit 100
  • Root 3.1417012368116004
  • Iteration Count 6
  • Error 3.456191833950232e-05
  • Condition True

Condition

  • The interval must contain a root
  • The function must be continuous
  • The function must change sign over the interval
  • The maximum number of iterations must be enough to find the root

f(1.0) = 0.841471

f(4.0) = -0.189201

(0.841471) x (-0.189201) < 0

Iterations

  • If f(c) = 0, then c is the root
  • If f(a) * f(c) < 0, then the root is in the interval [a, c]
  • If f(b) * f(c) < 0, then the root is in the interval [c, b]
  • Repeat until the root is found

Iteration 1 of 6 with (1.0, 4.0)

c = 4.0 - f(4.0) x (4.0 - 1.0) / [f(4.0) - f(1.0)] = 3.449289
f(a) = f(1.0) = 0.841471
f(b) = f(4.0) = -0.189201
f(c) = f(3.449289) = -0.087805

|f(c)| = |-0.087805| > 0.0001 = Tolerance

(a', b') = (1.0, 3.449289)


Iteration 2 of 6 with (1.0, 3.449289)

c = 3.449289 - f(3.449289) x (3.449289 - 1.0) / [f(3.449289) - f(1.0)] = 3.217862
f(a) = f(1.0) = 0.841471
f(b) = f(3.449289) = -0.087805
f(c) = f(3.217862) = -0.023679

|f(c)| = |-0.023679| > 0.0001 = Tolerance

(a', b') = (1.0, 3.217862)


Iteration 3 of 6 with (1.0, 3.217862)

c = 3.217862 - f(3.217862) x (3.217862 - 1.0) / [f(3.217862) - f(1.0)] = 3.15716
f(a) = f(1.0) = 0.841471
f(b) = f(3.217862) = -0.023679
f(c) = f(3.15716) = -0.004931

|f(c)| = |-0.004931| > 0.0001 = Tolerance

(a', b') = (1.0, 3.15716)


Iteration 4 of 6 with (1.0, 3.15716)

c = 3.15716 - f(3.15716) x (3.15716 - 1.0) / [f(3.15716) - f(1.0)] = 3.144594
f(a) = f(1.0) = 0.841471
f(b) = f(3.15716) = -0.004931
f(c) = f(3.144594) = -0.000954

|f(c)| = |-0.000954| > 0.0001 = Tolerance

(a', b') = (1.0, 3.144594)


Iteration 5 of 6 with (1.0, 3.144594)

c = 3.144594 - f(3.144594) x (3.144594 - 1.0) / [f(3.144594) - f(1.0)] = 3.142164
f(a) = f(1.0) = 0.841471
f(b) = f(3.144594) = -0.000954
f(c) = f(3.142164) = -0.000182

|f(c)| = |-0.000182| > 0.0001 = Tolerance

(a', b') = (1.0, 3.142164)


Iteration 6 of 6 with (1.0, 3.142164)

c = (1.0 + 3.142164) / 2 = 3.141701
f(a) = f(1.0) = 0.841471
f(b) = f(3.142164) = -0.000182
f(c) = f(3.141701) = -3.5e-05

|f(c)| = |-3.5e-05| ≤ 0.0001 = Tolerance

Root = 3.1417012368116004
Error = ± 3.456191833950232e-05