keisoku

Newton's Method Calculator (f(x) only, numerical derivative)

Solve f(x) = 0 with Newton's method. Just enter the equation, initial guess, tolerance, and max iterations - the derivative is approximated automatically by numerical differentiation. Shows the approximate root, f(root), iteration count, error, plus a step table and a graph.

Input

f(x)=

Allowed: + - * / ^ (power), (), x, pi/e, plus functions like sin cos tan exp log ln sqrt abs. Examples: x^2 - 2 / cos(x) - x / exp(x) - 3

iter.

Result

Approximate root x ≈

1.4142135624

Converged within the tolerance.

f(root)

4.5102e-12

Iterations

4

Final error |Δx|

2.1239e-6


-1.5-1-0.500.510.80.911.11.21.31.41.51.61.7x ≈ 1.414214

Iteration steps

nxₙf(xₙ)f'(xₙ)|Δx|
01-12
11.50.2520.5
21.416666670.00694430.083333
31.414215696.0073e-62.8333330.002451
41.414213564.5102e-122.8284312.1239e-6

How it works

  • Finds a root of f(x)=0 by iteration. Enter an expression (e.g. x^2 - 2, cos(x) - x, exp(x) - 3), an initial guess x₀, a tolerance, and the maximum number of iterations to get the approximate root.
  • You do not need to supply the derivative f'(x). A numerical derivative that estimates the slope from nearby values is used, so only the expression is required.
  • Supports the four arithmetic operations, powers (^), parentheses, the variable x, constants (pi, e), and functions such as sin/cos/tan, exp, log (natural log), ln, sqrt, and abs.
  • The result depends on your choice of initial guess. Setting x₀ near the root you want gives fast convergence; a distant guess may converge to a different root or diverge.
  • The iteration table shows xₙ, f(xₙ), the slope, and the change per step, while the graph lets you see the curve and the location of the approximate root at a glance.
  • A smaller tolerance increases precision, but due to rounding error values below a certain point may not be meaningful.