keisoku

Newton's Method (specify f(x) and f'(x))

Enter f(x) and its derivative f'(x) as expressions and use Newton's method to find an approximate root of f(x)=0. Includes an iteration table and a convergence chart.

Input

Supported syntax: + - * / ^ (power), functions like sin / cos / tan / exp / log (natural log) / log10 / sqrt / abs, constants pi and e, and the variable x. Examples: x^3 - x - 2, cos(x) - x

Result

Approximate root x

1.414213562

Converged within the tolerance

f(root)

4.440892e-16

Iterations

5

Final error |Δx|

1.594724e-12


Convergence of the estimate xₙ (dashed line: approximate root)

1.41.421.441.461.481.512345Iteration n

Iteration steps

nxₙf(xₙ)f'(xₙ)xₙ₊₁|Δx|
11-121.50.5
21.50.2531.4166666670.0833333333
31.4166666670.00694444442.8333333331.4142156860.0024509804
41.4142156866.007305e-62.8284313731.4142135622.123900e-6
51.4142135624.510614e-122.8284271251.4142135621.594724e-12

How it works

  • Rewrite the equation you want to solve in the form f(x)=0 and enter the left-hand side in the "f(x)" field. For example, for the square root of 2 you would enter x^2 - 2.
  • Enter the derivative of f(x) in the "f'(x)" field. For example, the derivative of x^2 - 2 is 2*x. Providing the derivative makes convergence fast and stable.
  • For the initial value x0, use a value you expect to be close to the root. If it is far from a root the method may fail to converge or head toward a different root, so try different values.
  • The tolerance is the threshold for stopping: the calculation ends once the change in x per step, |Δx|, drops to this value or below. A smaller value gives more accuracy but takes more iterations.
  • Besides the approximate root, the result shows the value of f(root), the number of iterations, and the final error, and lets you review how x and f(x) change at each step in a table and chart.
  • Expressions support arithmetic, powers (^), functions such as sin/cos/tan, exp, log (natural log), log10, sqrt, and abs, the constants pi and e, and the variable x.