Newton's Method Calculator

Type a function and a starting guess to find a root.

Use x. Type powers with ^, and functions with brackets: sin(x), e^(2x), ln(x), sqrt(x).

Starting valuex0x_0

A first guess close to the root you want.

Up to 50; it stops early once two guesses agree.

Try

Result

You enteredf(x)=cos⁡x−x=0,x0=1f(x) = \cos x - x = 0,\quad x_0 = 1

x≈0.739085\displaystyle x \approx 0.739085
Show the work
  1. Newton's method

    Each step replaces the graph by its tangent line at the current guess and moves to where that line crosses the x-axis.

    Using xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}

    f′(x)=−sin⁡x−1f'(x) = -\sin x - 1
  2. The first step

    Start at x0=1x_0 = 1.

    x1=1−−0.459698−1.841471=0.750364\begin{aligned} x_1 &= 1 - \frac{-0.459698}{-1.841471} \\ &= 0.750364 \end{aligned}
  3. Table of the iterations

    The iteration stops when two guesses agree to 12 decimal places.

    nxnf(xn)01−0.45969810.750364−0.01892320.739113−0.00004630.739085−2.847×10−1040.739085050.7390850\begin{array}{c|c|c} n & x_n & f(x_n) \\ \hline 0 & 1 & -0.459698 \\ 1 & 0.750364 & -0.018923 \\ 2 & 0.739113 & -0.000046 \\ 3 & 0.739085 & -2.847\times 10^{-10} \\ 4 & 0.739085 & 0 \\ 5 & 0.739085 & 0 \end{array}
  4. Result

    The estimate of the root is x≈0.739085x \approx 0.739085.

Drag to pan. Scroll or pinch to zoom. Arrow keys pan and + / − zoom when the graph has focus.
  • y = cos(x) - x

Points on the graph

  • y = cos(x) - x: zero (0.739085, 0)

Worked examples