# Newton's Method: Formula, Steps and Worked Examples

> Learn Newton's method for approximating roots: the formula, why it works, how to iterate step by step, worked examples, and when the method fails.

Source: https://practicecalculus.com/blog/newtons-method
Updated: 2026-11-23

## Key takeaways

- Newton's method finds roots by repeatedly following tangent lines: $x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$.
- Each step replaces the curve with its tangent line and uses where that line crosses the x-axis as the next guess.
- Near a simple root the method converges very fast, roughly doubling the number of correct digits each step.
- It can fail if $f'(x_n) = 0$, if the starting guess is poor, or if the iterates bounce around or run away.

Some equations simply cannot be solved with algebra. Try isolating $x$ in $\cos x = x$ or $x^3 - 2x - 5 = 0$ and you will get nowhere fast. **Newton's method** turns derivatives into a root-finding machine: start with a reasonable guess, follow a tangent line, and within a few steps you have an answer accurate to six or more decimal places.

This guide explains the Newton's method formula, where it comes from, how to run it step by step, and when it breaks down.

## What is Newton's method?

Newton's method (also called the **Newton-Raphson method**) is a procedure for approximating a root of a function, that is, a number $r$ with $f(r) = 0$.

The idea in plain language: near a point, a smooth curve looks almost like its tangent line. Finding where a curve hits the x-axis is hard, but finding where a straight line hits the x-axis is easy. So you swap the curve for its tangent line, solve the easy problem, and use that answer as a better guess. Then you repeat.

If this sounds familiar, it should. It is the same tangent line idea behind [linear approximation](/blog/linear-approximation), used over and over.

## The Newton's method formula

Starting from a guess $x_0$, each new approximation is

$$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$$

You need two things to use it: the function $f$ and its derivative $f'$. Every step uses only the current guess $x_n$.

### Where the formula comes from

The tangent line to $y = f(x)$ at $x = x_n$ is

$$y = f(x_n) + f'(x_n)(x - x_n)$$

Set $y = 0$ to find where this line crosses the x-axis:

$$0 = f(x_n) + f'(x_n)(x - x_n)$$

Solve for $x$ (assuming $f'(x_n) \neq 0$):

$$x - x_n = -\frac{f(x_n)}{f'(x_n)} \quad\Longrightarrow\quad x = x_n - \frac{f(x_n)}{f'(x_n)}$$

That crossing point is $x_{n+1}$. The whole method is just this one derivation, repeated.

## How to use Newton's method, step by step

1. **Rewrite the equation as $f(x) = 0$.** For example, $\cos x = x$ becomes $f(x) = \cos x - x$.
2. **Find $f'(x)$.**
3. **Choose a starting guess $x_0$** close to the root. A quick sketch or a sign change helps.
4. **Apply the formula** to get $x_1$, then $x_2$, and so on.
5. **Stop** when successive values agree to the accuracy you need.

> **Tip:** Write a simplified iteration formula first. Combining $x - \frac{f(x)}{f'(x)}$ into one fraction often makes the arithmetic much cleaner and less error prone.

## Worked example 1: approximating the square root of 2

The number $\sqrt{2}$ is a root of $f(x) = x^2 - 2$. Let's approximate it with $x_0 = 1$.

**Step 1. Derivative.** $f'(x) = 2x$.

**Step 2. Simplify the iteration.**

$$x_{n+1} = x_n - \frac{x_n^2 - 2}{2x_n} = \frac{2x_n^2 - x_n^2 + 2}{2x_n} = \frac{1}{2}\left(x_n + \frac{2}{x_n}\right)$$

This says: average your guess with $2$ divided by your guess. (This is the ancient Babylonian square root method, which turns out to be Newton's method in disguise.)

**Step 3. Iterate.**

$$x_1 = \frac{1}{2}\left(1 + \frac{2}{1}\right) = \frac{3}{2} = 1.5$$

$$x_2 = \frac{1}{2}\left(\frac{3}{2} + \frac{4}{3}\right) = \frac{1}{2}\cdot\frac{17}{6} = \frac{17}{12} \approx 1.416667$$

$$x_3 = \frac{1}{2}\left(\frac{17}{12} + \frac{24}{17}\right) = \frac{1}{2}\cdot\frac{289 + 288}{204} = \frac{577}{408} \approx 1.414216$$

The true value is $\sqrt{2} \approx 1.4142136$. After only three steps we are off by about $0.000002$.

| Step | $x_n$ | Correct digits |
| ---- | ----- | -------------- |
| $x_0$ | $1$ | 1 |
| $x_1$ | $1.5$ | 1 |
| $x_2$ | $1.416667$ | 3 |
| $x_3$ | $1.414216$ | 6 |

```graph
title: 'Newton''s method on y = x² − 2 starting at x = 1'
caption: 'The tangent at $x_0 = 1$ hits the axis at $x_1 = 1.5$. The tangent at $x_1$ hits the axis at $x_2 \approx 1.4167$, already close to $\sqrt{2}$.'
x: [0, 2.5]
y: [-2.5, 3]
functions:
  - expr: x^2 - 2
    label: y = x² − 2
  - expr: 2x - 3
    label: tangent at x = 1
    dashed: true
  - expr: 3x - 4.25
    label: tangent at x = 1.5
    dashed: true
points:
  - [1, -1, '(1, −1)']
  - [1.5, 0.25, '(1.5, 0.25)']
  - [1.4167, 0, 'x₂']
```

Notice the pattern in the table: the number of correct digits roughly doubles each step. That is called **quadratic convergence**, and it is why Newton's method is so popular.

## Worked example 2: solving cos x = x

No algebra trick isolates $x$ here, so this is a perfect job for Newton's method.

**Step 1. Set up.** $f(x) = \cos x - x$, so $f'(x) = -\sin x - 1$ (see the [derivative of cos x](/derivatives/cos-x)).

**Step 2. Choose $x_0$.** Since $f(0) = 1 > 0$ and $f(1) = \cos 1 - 1 \approx -0.4597 < 0$, the [Intermediate Value Theorem](/theorems/intermediate-value-theorem) guarantees a root between 0 and 1. Take $x_0 = 1$. Use radians throughout.

**Step 3. First iteration.**

$$f(1) = \cos 1 - 1 \approx 0.540302 - 1 = -0.459698$$

$$f'(1) = -\sin 1 - 1 \approx -0.841471 - 1 = -1.841471$$

$$x_1 = 1 - \frac{-0.459698}{-1.841471} \approx 1 - 0.249636 = 0.750364$$

**Step 4. Second iteration.**

$$f(0.750364) \approx 0.731441 - 0.750364 = -0.018923$$

$$f'(0.750364) \approx -0.681905 - 1 = -1.681905$$

$$x_2 \approx 0.750364 - \frac{-0.018923}{-1.681905} \approx 0.750364 - 0.011251 = 0.739113$$

**Step 5. Third iteration.**

$$f(0.739113) \approx -0.000047, \qquad f'(0.739113) \approx -1.673623$$

$$x_3 \approx 0.739113 - 0.000028 = 0.739085$$

So the solution of $\cos x = x$ is $x \approx 0.739085$. A fourth step would not change any of these six decimal places.

```graph
title: 'The curves y = cos x and y = x cross near x = 0.739'
caption: 'The solution of $\cos x = x$ is where the two graphs meet, at $x \approx 0.739085$.'
x: [-0.5, 2]
y: [-0.5, 1.5]
functions:
  - expr: cos(x)
    label: y = cos x
  - expr: x
    label: y = x
    dashed: true
points:
  - [0.739085, 0.739085, '(0.739, 0.739)']
```

## Worked example 3: a cubic equation

Newton himself tested his method on $x^3 - 2x - 5 = 0$. Let's do the same.

**Step 1. Set up.** $f(x) = x^3 - 2x - 5$ and $f'(x) = 3x^2 - 2$.

**Step 2. Choose $x_0$.** $f(2) = 8 - 4 - 5 = -1$ and $f(3) = 27 - 6 - 5 = 16$, so a root lies between 2 and 3, much closer to 2. Take $x_0 = 2$.

**Step 3. First iteration.**

$$f(2) = -1, \qquad f'(2) = 3(4) - 2 = 10$$

$$x_1 = 2 - \frac{-1}{10} = 2.1$$

**Step 4. Second iteration.**

$$f(2.1) = 9.261 - 4.2 - 5 = 0.061$$

$$f'(2.1) = 3(4.41) - 2 = 11.23$$

$$x_2 = 2.1 - \frac{0.061}{11.23} \approx 2.1 - 0.005432 = 2.094568$$

**Step 5. Third iteration.**

$$f(2.094568) \approx 0.000184, \qquad f'(2.094568) \approx 11.161645$$

$$x_3 \approx 2.094568 - 0.000017 = 2.094551$$

The root is $x \approx 2.094551$. Check: $f(2.094551)$ is within about $0.000001$ of zero.

## Worked example 4: when Newton's method fails

Newton's method is powerful, but it is not foolproof. Take $f(x) = \sqrt[3]{x} = x^{1/3}$, whose only root is obviously $x = 0$.

The derivative is $f'(x) = \frac{1}{3}x^{-2/3}$, so

$$x_{n+1} = x_n - \frac{x_n^{1/3}}{\frac{1}{3}x_n^{-2/3}} = x_n - 3x_n = -2x_n$$

Start at $x_0 = 1$ and you get $-2, 4, -8, 16, \ldots$ Each step doubles the distance from the root and flips sides. The method diverges no matter how close (but not equal to zero) your starting guess is. The culprit is that the cube root graph has a vertical tangent at its root, so the tangent lines are too steep in the wrong way and overshoot badly.

## When does Newton's method fail?

Watch for these situations:

- **Horizontal tangent.** If $f'(x_n) = 0$, the tangent line never crosses the x-axis and the formula divides by zero. For $f(x) = x^2 - 2$, starting at $x_0 = 0$ fails immediately.
- **Nearly horizontal tangent.** If $f'(x_n)$ is tiny, the next guess shoots far away, possibly toward a different root or off to infinity.
- **Bad starting guess.** The method can converge to a root you did not want, or cycle. For $f(x) = x^3 - 2x + 2$ with $x_0 = 0$, you get $x_1 = 1$, then $x_2 = 0$, and it bounces between 0 and 1 forever.
- **Shape of the function.** Functions like $\sqrt[3]{x}$ near their root can push iterates away every time.

The cure is usually a better $x_0$. Sketch the graph, look for a sign change, and start close to the root on a stretch where the curve is not flat.

## Common mistakes with Newton's method

1. **Forgetting to rewrite as $f(x) = 0$.** For $\cos x = x$ you must use $f(x) = \cos x - x$, not $f(x) = \cos x$.
2. **Adding instead of subtracting.** The formula is $x_n - \frac{f(x_n)}{f'(x_n)}$. A plus sign sends you the wrong way.
3. **Using degrees.** Calculus with trig functions assumes radians. In degree mode, example 2 produces nonsense.
4. **Rounding too early.** Carry at least two more decimal places than you need in the final answer. Rounding $x_1$ to one decimal place can cost you the fast convergence.
5. **Mixing up $f$ and $f'$.** Write both formulas clearly before you start plugging in numbers. A wrong derivative still gives numbers, just not the right ones. Our [derivatives of trig functions](/blog/derivatives-of-trig-functions) guide is a good refresher if trig derivatives trip you up.
6. **Ignoring the question's iteration count.** If an exam asks for $x_2$, give $x_2$, not the fully converged root.

## Newton's method quick reference

| Goal | Function $f(x)$ | Iteration $x_{n+1}$ |
| ---- | --------------- | ------------------- |
| General root | $f(x)$ | $x_n - \frac{f(x_n)}{f'(x_n)}$ |
| $\sqrt{a}$ | $x^2 - a$ | $\frac{1}{2}\left(x_n + \frac{a}{x_n}\right)$ |
| $\sqrt[3]{a}$ | $x^3 - a$ | $\frac{1}{3}\left(2x_n + \frac{a}{x_n^2}\right)$ |
| $\frac{1}{a}$ | $\frac{1}{x} - a$ | $x_n(2 - a x_n)$ |
| Solve $g(x) = h(x)$ | $g(x) - h(x)$ | $x_n - \frac{g(x_n) - h(x_n)}{g'(x_n) - h'(x_n)}$ |

The reciprocal row is a nice curiosity: it computes $\frac{1}{a}$ using only multiplication and subtraction, which is how some computer chips actually perform division.

## Why Newton's method converges so fast

Near a simple root (one where $f'(r) \neq 0$), the error after a step is roughly proportional to the square of the error before it. If you are off by $0.01$, the next step is off by something on the order of $0.0001$, then $0.00000001$. That is exactly the doubling of correct digits you saw with $\sqrt{2}$.

The reason is that the tangent line matches the function's value and slope at $x_n$, so the only error comes from curvature, the second-order term. This connects directly to [linear approximation](/blog/linear-approximation): Newton's method is linear approximation used as a search tool.

## Practice Newton's method until it feels routine

Newton's method rewards careful, organized work: set up $f$ and $f'$, pick a sensible start, and iterate without rounding too soon. The best way to get fast and accurate is to run through a few iterations on different functions and see the convergence happen for yourself. Try the interactive lesson below, where every tangent line question gives instant feedback and shows you exactly where a calculation went wrong.

## Frequently asked questions

### What is Newton's method in calculus?

Newton's method is an iterative way to approximate a solution of $f(x) = 0$. You start with a guess $x_0$, draw the tangent line there, and use where the tangent crosses the x-axis as your next guess. Repeating this usually homes in on a root very quickly.

### What is the formula for Newton's method?

The formula is $x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$. It comes from setting the tangent line $y = f(x_n) + f'(x_n)(x - x_n)$ equal to zero and solving for $x$.

### How do you choose the starting value for Newton's method?

Pick a point close to the root, ideally found from a graph or from a sign change. If $f(a)$ and $f(b)$ have opposite signs, the Intermediate Value Theorem guarantees a root between $a$ and $b$, so a value in that interval is a good start. Avoid points where $f'(x)$ is zero or nearly zero.

### When does Newton's method fail?

It fails when the derivative is zero at an iterate, since you would divide by zero. It can also diverge or oscillate when the starting guess is far from the root or the function has an unusual shape, such as $f(x) = \sqrt[3]{x}$, where every step doubles the distance from the root.

### Is Newton's method the same as the Newton-Raphson method?

Yes. Newton-Raphson is just another name for the same algorithm, honoring Joseph Raphson, who published a simplified version of Newton's idea. Both names refer to the iteration $x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}$.

### How do you know when to stop iterating?

Stop when two consecutive approximations agree to the number of decimal places you need. On exams, you are often told exactly how many iterations to perform, such as finding $x_2$ or $x_3$.
