Newton's Method

Using derivatives to find numerical solutions to equations

🎯 Newton's Method

What is Newton's Method?

Newton's Method (also called the Newton-Raphson Method) is a powerful technique for finding approximate solutions to equations of the form f(x)=0f(x) = 0.

💡 Key Idea: Start with a guess, use the tangent line to get a better guess, and repeat!


The Problem

We want to solve f(x)=0f(x) = 0, but:

  • Can't solve algebraically
  • Need a numerical approximation

Example: Solve x52x1=0x^5 - 2x - 1 = 0

No algebraic method exists! Newton's Method to the rescue! 🚀


The Method (How It Works)

The Recursive Formula

Start with an initial guess x0x_0, then generate better approximations:

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

Repeat this process until the values converge!

Geometric Interpretation

Step 1: Start at point (xn,f(xn))(x_n, f(x_n)) on the curve

Step 2: Draw the tangent line at that point

Step 3: Find where the tangent line crosses the xx-axis

Step 4: This xx-intercept becomes xn+1x_{n+1} (your next guess)

Step 5: Repeat!

The tangent line equation at (xn,f(xn))(x_n, f(x_n)) is: yf(xn)=f(xn)(xxn)y - f(x_n) = f'(x_n)(x - x_n)

Setting y=0y = 0 and solving for xx gives: x=xnf(xn)f(xn)x = x_n - \frac{f(x_n)}{f'(x_n)}

This is xn+1x_{n+1}!


Step-by-Step Process

Step 1: Make sure f(x)f'(x) exists and can be calculated

Step 2: Choose an initial guess x0x_0 (look at a graph if possible)

Step 3: Apply the formula: x1=x0f(x0)f(x0)x_1 = x_0 - \frac{f(x_0)}{f'(x_0)}

Step 4: Repeat with x1x_1 to get x2x_2: x2=x1f(x1)f(x1)x_2 = x_1 - \frac{f(x_1)}{f'(x_1)}

Step 5: Continue until:

  • xn+1xn|x_{n+1} - x_n| is very small, OR
  • f(xn)|f(x_n)| is very close to 0, OR
  • You've reached a specified number of iterations

Example 1: Finding a Square Root

Use Newton's Method to approximate 2\sqrt{2} (starting with x0=1x_0 = 1).

Step 1: Set up the equation

We want 2\sqrt{2}, so we need to solve x2=2x^2 = 2

Rewrite as: f(x)=x22=0f(x) = x^2 - 2 = 0


Step 2: Find f(x)f'(x)

f(x)=2xf'(x) = 2x


Step 3: Write Newton's formula

xn+1=xnxn222xnx_{n+1} = x_n - \frac{x_n^2 - 2}{2x_n}

Simplify: xn+1=xnxn222xn=2xn2(xn22)2xn=xn2+22xnx_{n+1} = x_n - \frac{x_n^2 - 2}{2x_n} = \frac{2x_n^2 - (x_n^2 - 2)}{2x_n} = \frac{x_n^2 + 2}{2x_n}

xn+1=12(xn+2xn)x_{n+1} = \frac{1}{2}\left(x_n + \frac{2}{x_n}\right)


Step 4: Iterate starting from x0=1x_0 = 1

x0=1x_0 = 1

x1=12(1+21)=12(3)=1.5x_1 = \frac{1}{2}\left(1 + \frac{2}{1}\right) = \frac{1}{2}(3) = 1.5

x2=12(1.5+21.5)=12(1.5+1.333...)=12(2.833...)1.4167x_2 = \frac{1}{2}\left(1.5 + \frac{2}{1.5}\right) = \frac{1}{2}(1.5 + 1.333...) = \frac{1}{2}(2.833...) \approx 1.4167

x3=12(1.4167+21.4167)12(1.4167+1.4118)1.4142x_3 = \frac{1}{2}\left(1.4167 + \frac{2}{1.4167}\right) \approx \frac{1}{2}(1.4167 + 1.4118) \approx 1.4142

x4=12(1.4142+21.4142)1.41421356...x_4 = \frac{1}{2}\left(1.4142 + \frac{2}{1.4142}\right) \approx 1.41421356...


Check: 21.41421356...\sqrt{2} \approx 1.41421356...

After just 4 iterations, we have 8 decimal places of accuracy!


Example 2: Solving a Polynomial

Find the root of f(x)=x3x1=0f(x) = x^3 - x - 1 = 0 near x=1x = 1.

Step 1: Find f(x)f'(x)

f(x)=3x21f'(x) = 3x^2 - 1


Step 2: Newton's formula

xn+1=xnxn3xn13xn21x_{n+1} = x_n - \frac{x_n^3 - x_n - 1}{3x_n^2 - 1}


Step 3: Iterate starting from x0=1x_0 = 1

x0=1x_0 = 1

x1=113113(1)21=112=1+0.5=1.5x_1 = 1 - \frac{1^3 - 1 - 1}{3(1)^2 - 1} = 1 - \frac{-1}{2} = 1 + 0.5 = 1.5

x2=1.5(1.5)31.513(1.5)21x_2 = 1.5 - \frac{(1.5)^3 - 1.5 - 1}{3(1.5)^2 - 1}

=1.53.3751.516.751= 1.5 - \frac{3.375 - 1.5 - 1}{6.75 - 1}

=1.50.8755.751.50.152=1.348= 1.5 - \frac{0.875}{5.75} \approx 1.5 - 0.152 = 1.348

x3=1.348(1.348)31.34813(1.348)21x_3 = 1.348 - \frac{(1.348)^3 - 1.348 - 1}{3(1.348)^2 - 1}

1.3480.04474.4521.3480.010=1.338\approx 1.348 - \frac{0.0447}{4.452} \approx 1.348 - 0.010 = 1.338

x41.3247x_4 \approx 1.3247

x51.32472x_5 \approx 1.32472 (converged!)


Answer: The root is approximately x1.32472x \approx 1.32472

Check: f(1.32472)=(1.32472)31.3247210.00001f(1.32472) = (1.32472)^3 - 1.32472 - 1 \approx 0.00001


Example 3: Finding Where Functions Intersect

Find where cosx=x\cos x = x (i.e., solve cosxx=0\cos x - x = 0).

Step 1: Set up

f(x)=cosxxf(x) = \cos x - x

f(x)=sinx1f'(x) = -\sin x - 1


Step 2: Choose initial guess

From a graph, the intersection is near x=1x = 1

Let x0=1x_0 = 1


Step 3: Newton's formula

xn+1=xncosxnxnsinxn1x_{n+1} = x_n - \frac{\cos x_n - x_n}{-\sin x_n - 1}


Step 4: Iterate

x0=1x_0 = 1

x1=1cos(1)1sin(1)1x_1 = 1 - \frac{\cos(1) - 1}{-\sin(1) - 1}

10.540310.84151\approx 1 - \frac{0.5403 - 1}{-0.8415 - 1}

10.45971.841510.2497=0.7503\approx 1 - \frac{-0.4597}{-1.8415} \approx 1 - 0.2497 = 0.7503

x20.7391x_2 \approx 0.7391

x30.7391x_3 \approx 0.7391 (converged!)


Answer: cosx=x\cos x = x at x0.739x \approx 0.739


When Newton's Method Works Best

Good Conditions

Newton's Method converges quickly when:

  1. f(x)0f'(x) \neq 0 near the root
  2. Good initial guess (close to actual root)
  3. ff is smooth (continuous, differentiable)
  4. ff' doesn't change sign near the root

Convergence Rate

When it works, Newton's Method has quadratic convergence:

  • The number of correct digits roughly doubles each iteration!
  • This is why we got 8 decimals in just 4 steps for 2\sqrt{2}

When Newton's Method Fails

Failure Case 1: Division by Zero

If f(xn)=0f'(x_n) = 0, the formula breaks down!

Example: Finding root of f(x)=x3f(x) = x^3 starting at x0=0x_0 = 0

f(0)=0f'(0) = 0 → Cannot compute x1x_1!

Failure Case 2: Cycles

Sometimes the iterates go in circles and never converge.

Example: f(x)=x32x+2f(x) = x^3 - 2x + 2 with x0=0x_0 = 0 creates a 2-cycle

Failure Case 3: Divergence

Poor initial guess can cause iterates to move away from the root.

Example: Finding 2\sqrt{2} but starting with x0=1x_0 = -1 can diverge

Failure Case 4: Multiple Roots

At a multiple root (where f(x)=f(x)=0f(x) = f'(x) = 0), convergence is much slower.

Example: f(x)=(x1)2f(x) = (x-1)^2 has a double root at x=1x = 1


Tips for Choosing x0x_0

Strategy 1: Use a Graph

Sketch or plot y=f(x)y = f(x) to see where it crosses the xx-axis

Strategy 2: Try Simple Values

Test x=0,1,1,2x = 0, 1, -1, 2, etc. and see which gives f(x)f(x) closest to 0

Strategy 3: Use Algebra

Simplify or factor f(x)f(x) as much as possible first

Strategy 4: Intermediate Value Theorem

Find aa and bb where f(a)f(a) and f(b)f(b) have opposite signs

The root is between aa and bb → use x0=a+b2x_0 = \frac{a+b}{2}


How Many Iterations?

Stopping Criteria

Stop when ONE of these is true:

  1. Relative error: xn+1xnxn<ϵ\left|\frac{x_{n+1} - x_n}{x_n}\right| < \epsilon (e.g., ϵ=0.0001\epsilon = 0.0001)

  2. Absolute error: xn+1xn<ϵ|x_{n+1} - x_n| < \epsilon

  3. Function value: f(xn)<ϵ|f(x_n)| < \epsilon

  4. Maximum iterations: Reached some limit (e.g., 50 iterations)


Applications of Newton's Method

Application 1: Square Roots

The formula for a\sqrt{a}: xn+1=12(xn+axn)x_{n+1} = \frac{1}{2}\left(x_n + \frac{a}{x_n}\right)

This was the ancient Babylonian method!

Application 2: Finding Reciprocals

To compute 1a\frac{1}{a}, solve f(x)=1xa=0f(x) = \frac{1}{x} - a = 0: xn+1=xn(2axn)x_{n+1} = x_n(2 - ax_n)

Used in calculators (avoids division!)

Application 3: Optimization

Newton's Method can optimize f(x)f(x) by finding where f(x)=0f'(x) = 0

Apply the method to g(x)=f(x)g(x) = f'(x)!

Application 4: Root-Finding in Engineering

Used in:

  • Solving nonlinear circuits
  • Finding equilibrium points
  • Solving transcendental equations
  • Computer graphics and animation

⚠️ Common Mistakes

Mistake 1: Wrong Sign

The formula is xn+1=xnf(xn)f(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} (MINUS, not plus!)

Mistake 2: Derivative of the Whole Expression

Calculate f(x)f(x) and f(x)f'(x) separately, don't mix them up!

Mistake 3: Stopping Too Early

Check that consecutive iterates are actually close before stopping

Mistake 4: Bad Initial Guess

If iterates jump around wildly, try a different x0x_0

Mistake 5: Not Checking the Answer

Always verify: plug your answer into f(x)f(x) to see if it's close to 0!


Comparison with Other Methods

Bisection Method

  • Pros: Always converges (if conditions met), simple
  • Cons: Slow (linear convergence)

Newton's Method

  • Pros: Very fast (quadratic convergence)
  • Cons: Requires derivative, can fail

Secant Method

  • Pros: No derivative needed, faster than bisection
  • Cons: Slower than Newton's, can still fail

Modified Newton's Method

For multiple roots (where f(x)=f(x)=0f(x) = f'(x) = 0), use:

xn+1=xnmf(xn)f(xn)x_{n+1} = x_n - m\frac{f(x_n)}{f'(x_n)}

where mm is the multiplicity of the root.

This restores quadratic convergence!


The Big Picture

Historical Significance

  • Discovered by Isaac Newton (1669) and Joseph Raphson (1690)
  • One of the first iterative numerical methods
  • Foundation for modern computational mathematics

Modern Importance

  • Built into calculators and computer software
  • Basis for more advanced methods
  • Essential in scientific computing

📝 Practice Strategy

  1. Write down f(x)f(x) and f(x)f'(x) clearly
  2. Set up the formula: xn+1=xnf(xn)f(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
  3. Choose a reasonable x0x_0 (use a graph or test values)
  4. Calculate systematically - make a table with columns for nn, xnx_n, f(xn)f(x_n), f(xn)f'(x_n), xn+1x_{n+1}
  5. Check convergence - are successive values getting closer?
  6. Verify your answer by substituting into f(x)f(x)
  7. Keep 6-8 decimal places during calculations to avoid rounding errors

📚 Practice Problems

1Problem 1medium

Question:

Use Newton's Method to approximate 103\sqrt[3]{10} with initial guess x0=2x_0 = 2. Perform 3 iterations.

💡 Show Solution

Step 1: Set up the equation

We want 103\sqrt[3]{10}, so we need to solve x3=10x^3 = 10

Let f(x)=x310=0f(x) = x^3 - 10 = 0


Step 2: Find f(x)f'(x)

f(x)=3x2f'(x) = 3x^2


Step 3: Newton's formula

xn+1=xnxn3103xn2x_{n+1} = x_n - \frac{x_n^3 - 10}{3x_n^2}

Simplify: xn+1=xnxn3103xn2=3xn3(xn310)3xn2=2xn3+103xn2x_{n+1} = x_n - \frac{x_n^3 - 10}{3x_n^2} = \frac{3x_n^3 - (x_n^3 - 10)}{3x_n^2} = \frac{2x_n^3 + 10}{3x_n^2}


Step 4: First iteration (n=0n = 0)

x0=2x_0 = 2

x1=2(2)3+103(2)2=2(8)+103(4)=16+1012=26122.1667x_1 = \frac{2(2)^3 + 10}{3(2)^2} = \frac{2(8) + 10}{3(4)} = \frac{16 + 10}{12} = \frac{26}{12} \approx 2.1667


Step 5: Second iteration (n=1n = 1)

x1=2.1667x_1 = 2.1667

x2=2(2.1667)3+103(2.1667)2x_2 = \frac{2(2.1667)^3 + 10}{3(2.1667)^2}

=2(10.1584)+103(4.6946)=20.3168+1014.0838=30.316814.08382.1544= \frac{2(10.1584) + 10}{3(4.6946)} = \frac{20.3168 + 10}{14.0838} = \frac{30.3168}{14.0838} \approx 2.1544


Step 6: Third iteration (n=2n = 2)

x2=2.1544x_2 = 2.1544

x3=2(2.1544)3+103(2.1544)2x_3 = \frac{2(2.1544)^3 + 10}{3(2.1544)^2}

=2(10.0008)+103(4.6414)=20.0016+1013.9242=30.001613.92422.1544= \frac{2(10.0008) + 10}{3(4.6414)} = \frac{20.0016 + 10}{13.9242} = \frac{30.0016}{13.9242} \approx 2.1544


Step 7: Verify convergence

x22.1544x_2 \approx 2.1544 and x32.1544x_3 \approx 2.1544 → Converged!

Check: (2.1544)310.00(2.1544)^3 \approx 10.00

Answer: 1032.1544\sqrt[3]{10} \approx 2.1544 (after 3 iterations)

Actual value: 1032.154434...\sqrt[3]{10} \approx 2.154434... (excellent match!)

2Problem 2hard

Question:

Find the positive solution to ex=3xe^x = 3x using Newton's Method. Start with x0=1x_0 = 1 and perform iterations until consecutive approximations differ by less than 0.001.

💡 Show Solution

Step 1: Rewrite as f(x)=0f(x) = 0

ex=3x    f(x)=ex3x=0e^x = 3x \implies f(x) = e^x - 3x = 0


Step 2: Find f(x)f'(x)

f(x)=ex3f'(x) = e^x - 3


Step 3: Newton's formula

xn+1=xnexn3xnexn3x_{n+1} = x_n - \frac{e^{x_n} - 3x_n}{e^{x_n} - 3}


Step 4: Iteration 0 → 1

x0=1x_0 = 1

f(1)=e13(1)=2.71833=0.2817f(1) = e^1 - 3(1) = 2.7183 - 3 = -0.2817

f(1)=e13=2.71833=0.2817f'(1) = e^1 - 3 = 2.7183 - 3 = -0.2817

x1=10.28170.2817=11=0x_1 = 1 - \frac{-0.2817}{-0.2817} = 1 - 1 = 0


Wait, this doesn't look right. Let me recalculate more carefully:

f(1)=e32.71833=0.2817f(1) = e - 3 \approx 2.7183 - 3 = -0.2817

f(1)=e30.2817f'(1) = e - 3 \approx -0.2817

x1=10.28170.2817=11.0=0x_1 = 1 - \frac{-0.2817}{-0.2817} = 1 - 1.0 = 0

This suggests our initial guess led to x1=0x_1 = 0, but e0=10e^0 = 1 \neq 0. Let me try x0=1.5x_0 = 1.5:


Restart with x0=1.5x_0 = 1.5

f(1.5)=e1.53(1.5)=4.48174.5=0.0183f(1.5) = e^{1.5} - 3(1.5) = 4.4817 - 4.5 = -0.0183

f(1.5)=e1.53=4.48173=1.4817f'(1.5) = e^{1.5} - 3 = 4.4817 - 3 = 1.4817

x1=1.50.01831.4817=1.5+0.0123=1.5123x_1 = 1.5 - \frac{-0.0183}{1.4817} = 1.5 + 0.0123 = 1.5123


Iteration 1 → 2

f(1.5123)=e1.51233(1.5123)4.53754.53690.0006f(1.5123) = e^{1.5123} - 3(1.5123) \approx 4.5375 - 4.5369 \approx 0.0006

f(1.5123)=e1.512331.5375f'(1.5123) = e^{1.5123} - 3 \approx 1.5375

x2=1.51230.00061.53751.51230.0004=1.5119x_2 = 1.5123 - \frac{0.0006}{1.5375} \approx 1.5123 - 0.0004 = 1.5119


Check convergence

x2x1=1.51191.5123=0.0004<0.001|x_2 - x_1| = |1.5119 - 1.5123| = 0.0004 < 0.001

Answer: x1.512x \approx 1.512

Verify: e1.5124.536e^{1.512} \approx 4.536 and 3(1.512)=4.5363(1.512) = 4.536

3Problem 3expert

Question:

Show what happens when Newton's Method is applied to f(x)=x1/3f(x) = x^{1/3} with initial guess x0=1x_0 = 1. Does it converge to the root at x=0x = 0?

💡 Show Solution

Step 1: Set up

f(x)=x1/3f(x) = x^{1/3}, and we're looking for the root at x=0x = 0


Step 2: Find f(x)f'(x)

f(x)=13x2/3=13x2/3f'(x) = \frac{1}{3}x^{-2/3} = \frac{1}{3x^{2/3}}


Step 3: Newton's formula

xn+1=xnxn1/313xn2/3=xnxn1/33xn2/31=xn3xn=2xnx_{n+1} = x_n - \frac{x_n^{1/3}}{\frac{1}{3x_n^{2/3}}} = x_n - \frac{x_n^{1/3} \cdot 3x_n^{2/3}}{1} = x_n - 3x_n = -2x_n


Step 4: Iterate from x0=1x_0 = 1

x0=1x_0 = 1

x1=2(1)=2x_1 = -2(1) = -2

x2=2(2)=4x_2 = -2(-2) = 4

x3=2(4)=8x_3 = -2(4) = -8

x4=2(8)=16x_4 = -2(-8) = 16

The iterates are: 1,2,4,8,16,32,...1, -2, 4, -8, 16, -32, ...


Step 5: Analysis

The sequence diverges! The values alternate in sign and grow in magnitude.

Why does this happen?

At the root x=0x = 0, we have f(0)=0f(0) = 0 but f(0)f'(0) is undefined (vertical tangent).

The tangent line at any point (xn,xn1/3)(x_n, x_n^{1/3}) is very steep, causing the next iterate to overshoot dramatically.


Answer: Newton's Method fails for this function. The iterates diverge because f(0)f'(0) doesn't exist and the function has a vertical tangent at the root.

Lesson: Newton's Method requires f(x)0f'(x) \neq 0 near the root!