Newton's Method Calculator
Enter a function and a starting guess and get the root of f(x) = 0 by Newton's method, with the full iteration table (xₙ, f(xₙ), f′(xₙ), xₙ₊₁), the observed order of convergence, a graph with each tangent step drawn, and the secant and bisection methods alongside for comparison. When a run fails — a zero derivative, a cycle, a runaway — it says why. Free, no sign-up.
Use + − * / ^ and brackets. To solve g(x) = h(x), enter g(x) − h(x). Functions: sin, cos, tan, exp, ln, log (base 10), sqrt, abs and more. Constants: pi and e.
Results
1.414213562
Root estimate
4.44E-16
|f(root)|
5
Iterations
the step fell below the tolerance
Stopped because
The formula
xₙ₊₁ = xₙ − f(xₙ) / f′(xₙ), with f′(x) = 2x
Iteration table
| n | xₙ | f(xₙ) | f′(xₙ) | xₙ₊₁ | |xₙ₊₁ − xₙ| |
|---|---|---|---|---|---|
| 0 | 1 | -1 | 2 | 1.5 | 5E-1 |
| 1 | 1.5 | 0.25 | 3 | 1.416666667 | 8.33E-2 |
| 2 | 1.416666667 | 0.006944444444 | 2.833333333 | 1.414215686 | 2.45E-3 |
| 3 | 1.414215686 | 0.000006007304883 | 2.828431373 | 1.414213562 | 2.12E-6 |
| 4 | 1.414213562 | 0.000000000004510614104 | 2.828427125 | 1.414213562 | 1.59E-12 |
Convergence
Observed order of convergence ≈ 2. Newton's method has order 2 at a simple root (the number of correct digits roughly doubles each step), the secant method about 1.62, and bisection 1 (one more bit per step).
The three methods side by side
| Method | Root | |f(root)| | Steps | Outcome |
|---|---|---|---|---|
| Newton's method | 1.414213562 | 4.44E-16 | 5 | the step fell below the tolerance |
| Secant method | — | — | 1 | f is not defined |
| Bisection | 1.414213562 | 2.32E-10 | 28 | the step fell below the tolerance |
Secant uses x₁ = 1.5; bisection uses the bracket [1.4, 1.425] (found near x₀ if you gave none).
Graph
- y = f(x)
How to Use the Newton's Method Calculator
- 1. Type f(x). The calculator solves f(x) = 0. To solve cos x = x, enter
cos(x) - x. Newton's method needs the derivative, and the calculator finds it symbolically. - 2. Choose a method and a starting guess. Newton's method needs one guess x₀ near the root, the secant method two guesses, and bisection a bracket [a, b] where f changes sign.
- 3. Set the tolerance. The run stops when the step is smaller than the tolerance (relative to the size of x).
- 4. Read the table, the notes and the graph. Each row is one iteration. The graph draws each tangent line that Newton's method follows to the x-axis.
The Three Methods
| Method | Update | Order | Needs |
|---|---|---|---|
| Newton | xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ) | 2 at a simple root | f′ and one guess |
| Secant | xₙ₊₁ = xₙ − f(xₙ)(xₙ − xₙ₋₁)/(f(xₙ) − f(xₙ₋₁)) | about 1.62 | two guesses |
| Bisection | keep the half of [a, b] where f changes sign | 1 (one bit per step) | a sign-changing bracket |
Newton's method replaces the curve by its tangent line at xₙ and takes the tangent's x-intercept as the next guess. Near a simple root the number of correct digits roughly doubles each step. The secant method does the same with a line through the last two points, needing no derivative. Bisection is slow but cannot fail once a root is bracketed. See Burden and Faires, Numerical Analysis, chapter 2, for the derivations and convergence proofs.
Worked Example: √2 as the Root of x² − 2
Here f(x) = x² − 2 and f′(x) = 2x. Starting at x₀ = 1:
| n | xₙ | f(xₙ) | f′(xₙ) | xₙ₊₁ |
|---|---|---|---|---|
| 0 | 1 | −1 | 2 | 1.5 |
| 1 | 1.5 | 0.25 | 3 | 1.416666667 |
| 2 | 1.416666667 | 0.006944444 | 2.833333333 | 1.414215686 |
| 3 | 1.414215686 | 0.000006007 | 2.828431373 | 1.414213562 |
| 4 | 1.414213562 | 4.5×10⁻¹² | 2.828427125 | 1.414213562 |
The error falls from 0.4 to 0.09 to 0.002 to 2×10⁻⁶ to 1.6×10⁻¹², roughly squaring each time, and the observed order comes out at 2.000. Run on the same problem, the secant method (from 1 and 2) needs 7 steps and bisection on [1, 2] needs 33 to reach the same tolerance of 10⁻¹⁰. Starting Newton's method from x₀ = 1 on cos x − x also finds the root 0.7390851332 in 5 steps.
When Newton's Method Fails
- Zero derivative. Starting x² − 2 at x₀ = 0 gives f′(0) = 0, so the tangent is horizontal and never meets the axis. Move the guess.
- A cycle. x³ − 2x + 2 from x₀ = 0 jumps 0 → 1 → 0 → 1 forever. Bisection cannot cycle.
- Runaway. arctan x from x₀ = 2 overshoots further every step and escapes to infinity.
- Leaving the domain. From x₀ = 5, ln x lands on a negative number after one step.
- A multiple root. For (x − 1)² the iterates converge, but only linearly, halving the error each time (34 steps for 10⁻¹⁰). The notes under the table report the ratio and the multiplicity it implies; applying Newton's method to f/f′ restores fast convergence.
Frequently Asked Questions
- How do you use Newton's method step by step?
- Pick a guess x₀ near the root, compute f(x₀) and f′(x₀), and set x₁ = x₀ − f(x₀)/f′(x₀). Repeat with x₁, and so on, until successive guesses agree to the accuracy you need. The iteration table shows each of these computations.
- How do I choose a good starting guess?
- Look at the graph and pick a point close to where the curve crosses the x-axis, on the side where the curve is steep and not near a flat spot (a point where f′ ≈ 0). A guess near a turning point sends the first step far away.
- Why does Newton's method sometimes not converge?
- Because it depends on the tangent line being a good stand-in for the curve. A flat tangent, a curve that bends sharply between the guess and the root, or a root that does not exist can send the iterates to the wrong place, round in a circle or off to infinity. The calculator names which of these happened.
- When should I use bisection or the secant method instead?
- Use bisection when you can bracket a sign change and need a guarantee: it always converges, though slowly. Use the secant method when f′ is awkward or expensive; it needs no derivative and still converges fast. The side-by-side table runs all three on your function.
- What does the order of convergence mean?
- If each error is about the previous error raised to the power p, the method has order p. Order 2 (Newton's, at a simple root) doubles the number of correct digits each step; order 1 (bisection, or Newton at a multiple root) gains a fixed amount per step. The tool estimates p from the last three steps.
- Can it find complex roots or all roots at once?
- No. It finds one real root near your starting guess. To find another root, change the starting guess; the graph helps you see where the curve crosses the axis. For the roots of a quadratic, the Quadratic Equation Solver gives them all exactly, including complex ones.