Hersi Maths WhatsApp me

Understand · explore · practise

Newton–Raphson method

Derive and use the Newton–Raphson formula with learner-controlled tangent steps. Work through polynomial, exponential, logarithmic and trigonometric equations, retain working precision and verify root accuracy.

Before you startDifferentiation; equations of tangents; root accuracy

01 / Replace a small part of the curve by its tangent

The tangent gives a new estimate of a root.

xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ), provided f′(xₙ) ≠ 0.

Newton–Raphson tries to solve f(x) = 0. At the current estimate xₙ, find the point on the curve and its tangent. The point where that tangent meets the horizontal axis is the next estimate.

A good tangent can give a much closer estimate quickly. Convergence is not guaranteed for every function or starting value; check the domain and the results.

Use a tangent to choose the next estimateExplore
Newton tangent step for x² − 3The gold tangent at the blue curve point meets the horizontal axis at the next estimate. Choose a start and an iteration number to inspect each step.f(x) = x² − 3xf(x)Blue: current point · gold: next estimatex from 0 to 3.4 · axes use different scales

x0 = 2; f(x0) = 1; f′(x0) = 4.

x1 = 2 − 1/4 = 1.75.

Distance from √3: current ≈ 0.267949192431; next ≈ 0.0179491924311.

Current and previous estimates: 2.

The tangent is drawn through (xₙ, f(xₙ)); its horizontal-axis intercept supplies xₙ₊₁. Each selection is manual. Internal values are retained before display rounding; the known root √3 lets us compare errors here. At very late steps, a displayed zero error means agreement at machine precision, not an exact value for this irrational root.

02 / Derive the update from the tangent equation

Set the tangent height equal to zero.

At x = xₙ, the point is (xₙ, f(xₙ)).Worked example

The tangent gradient is f′(xₙ)

Differentiate the function whose root is sought.

y − f(xₙ) = f′(xₙ)(x − xₙ)

Use the point-gradient equation.

At the tangent’s x-intercept, y = 0

This point supplies the next estimate xₙ₊₁.

−f(xₙ) = f′(xₙ)(xₙ₊₁ − xₙ)

Substitute and rearrange.

xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ)

Division requires a nonzero derivative.

Follow successive tangent intercepts

Pause, replay or seek freely. The notes explain the same idea and stay in view.

01 · One tangent intercept

A current estimate is x₀ = 4, with f(4) = 6 and f′(4) = 3. Find x₁.

Hint

Subtract function value divided by derivative.

Worked solution

x₁ = 4 − 6/3 = 2.

02 · Keep the signs

If x₀ = 1, f(1) = −2 and f′(1) = 4, find x₁.

Hint

Subtracting a negative quotient increases the estimate.

Worked solution

x₁ = 1 − (−2)/4 = 1.5.

03 / Write the formula for the chosen equation

Differentiate f, not the iteration formula.

Solve x² − 3 = 0 from x₀ = 2.Worked example

f(x) = x² − 3; f′(x) = 2x

The derivative vanishes at zero, which must be avoided.

xₙ₊₁ = xₙ − (xₙ² − 3)/(2xₙ)

Substitute into Newton’s formula.

Equivalently xₙ₊₁ = (xₙ + 3/xₙ)/2

This simplification is valid for xₙ ≠ 0.

x₁ = 7/4 = 1.75; x₂ = 97/56 ≈ 1.73214285714

Retain unrounded values.

x₃ ≈ 1.73205081002

Compare with √3 ≈ 1.73205080757.

03 · Form a cubic update

Write the Newton update for f(x) = x³ + 2x − 7.

Hint

First find f′(x).

Worked solution

xₙ₊₁ = xₙ − (xₙ³ + 2xₙ − 7)/(3xₙ² + 2). The denominator is positive for every real xₙ.

04 · Use it once

For that cubic, calculate x₁ from x₀ = 1.

Hint

f(1) = −4 and f′(1) = 5.

Worked solution

x₁ = 1 − (−4)/5 = 1.8.

04 / Count the requested number of substitutions

A labelled table avoids an extra or missing iteration.

Use f(x) = x³ − x − 2 with x₀ = 1.5.Worked example

f′(x) = 3x² − 1

Use this derivative in every step.

x₁ ≈ 1.521739130435

First substitution.

x₂ ≈ 1.521379805965

Second substitution.

x₃ ≈ 1.521379706805

Third substitution.

If asked for x₂, report x₂ with the requested rounding

Do not silently replace it by a later iterate.

05 · Index from x₁

A question supplies x₁ = 2 for xₙ₊₁ = (xₙ + 3/xₙ)/2. Find x₃.

Hint

Only two substitutions are needed from x₁.

Worked solution

x₂ = 1.75, then x₃ = 97/56 ≈ 1.73214285714.

05 / Include the whole equation in f

Move the target to the left before differentiating.

Solve eˣ = 3 from x₀ = 1.Worked example

Choose f(x) = eˣ − 3

We need a zero of this difference.

f′(x) = eˣ

The constant disappears when differentiated.

xₙ₊₁ = xₙ − [exp(xₙ) − 3]/exp(xₙ)

Use the exponential function at the current input.

x₁ ≈ 1.103638323514; x₂ ≈ 1.098624898047

Store full values between steps.

The exact answer is ln3 ≈ 1.098612288668

An exact comparison is available in this example.

06 · An exponential plus a linear term

Write the update for eˣ + x − 4 = 0.

Hint

The derivative includes the derivative of x.

Worked solution

xₙ₊₁ = xₙ − (exp(xₙ) + xₙ − 4)/(exp(xₙ) + 1).

06 / Keep logarithmic iterates in the real domain

Each evaluated input must stay positive.

Solve ln x + x − 2 = 0, starting at x₀ = 1.Worked example

f(x) = ln x + x − 2, with x > 0

The domain belongs to the original equation.

f′(x) = 1/x + 1

Both terms contribute.

xₙ₊₁ = xₙ − (ln xₙ + xₙ − 2)/(1/xₙ + 1)

Check every next value before using it.

x₁ = 1.5; x₂ ≈ 1.556720935135

These values remain positive.

x₃ ≈ 1.557145576347

This is a numerical estimate, requiring a separate accuracy check.

07 · Logarithm domain

Can you start this Newton calculation at x₀ = −1?

Hint

Check f(x₀) before calculating a quotient.

Worked solution

No. ln(−1) is not real, so f(−1) is undefined in this real-valued problem.

08 · A rational function

For f(x) = 1/x − 2, show that Newton’s update simplifies to xₙ₊₁ = 2xₙ − 2xₙ². State the domain restriction inherited from f.

Hint

f′(x) = −1/x².

Worked solution

x − (1/x − 2)/(−1/x²) = x + x − 2x² = 2x − 2x². The Newton calculation still requires xₙ ≠ 0, even though the simplified polynomial is defined there.

07 / Use radians with standard trig derivatives

The derivative and calculator angle unit must match.

Solve cos x = x from x₀ = 1, in radians.Worked example

f(x) = cos x − x

Move x to the left.

f′(x) = −sin x − 1

The standard derivative assumes radians.

xₙ₊₁ = xₙ − (cos xₙ − xₙ)/(−sin xₙ − 1)

Use radians for both trigonometric evaluations.

x₁ ≈ 0.750363867840; x₂ ≈ 0.739112890911

Keep stored precision.

x₃ ≈ 0.739085133385

A useful estimate of the fixed intersection.

09 · A trigonometric derivative

Write the Newton update for sin(2x) − x/2 = 0, using radians.

Hint

Apply the chain rule to sin(2x).

Worked solution

xₙ₊₁ = xₙ − [sin(2xₙ) − xₙ/2]/[2cos(2xₙ) − 1/2], provided the denominator is nonzero.

08 / Differentiate xˣ before substituting

A variable base and exponent need logarithmic differentiation.

Form Newton’s method for xˣ = 3, with x > 0.Worked example

Write xˣ = exp(x ln x)

This real expression uses x > 0.

d(xˣ)/dx = xˣ(ln x + 1)

Use the chain rule.

Set f(x) = xˣ − 3

Then f′(x) = xˣ(ln x + 1).

xₙ₊₁ = xₙ − (xₙxₙ − 3)/[xₙxₙ(ln xₙ + 1)]

In this formula xₙxₙ means the current input raised to itself.

From x₀ = 1.5: x₁ ≈ 1.950379848069; x₂ ≈ 1.839606335555

The first step overshoots; improvement need not be monotone from the start.

10 · Find the zero derivative

For f(x) = xˣ − 3 on x > 0, at what input is f′(x) zero?

Hint

The factor xˣ is positive.

Worked solution

ln x + 1 = 0, so x = e⁻¹. Newton’s quotient cannot be evaluated there. That input does not solve xˣ = 3.

09 / Prove the requested decimal accuracy separately

Stable iterates do not replace a sign bracket.

Verify the positive root of x² − 3 is 1.732 to 3 d.p.Worked example

Test the halfway values 1.7315 and 1.7325

These are the rounding boundaries.

f(1.7315) = −0.00190775

The lower sign is negative.

f(1.7325) = 0.00155625

The upper sign is positive.

f is continuous and increasing on this interval

There is a unique root between the boundaries.

Hence the root rounds to 1.732 at 3 d.p.

This verifies the root, independently of how it was approximated.

11 · Stable display

Two Newton iterates both display 0.7391. Does that alone prove the true root is 0.7391 to 4 d.p.?

Hint

Distinguish numerical agreement from a root bracket.

Worked solution

No. A suitable sign-change proof would test the continuous target function at 0.73905 and 0.73915, or establish a smaller valid bracket within them.

12 · Residual versus input error

Does a small |f(xₙ)| always mean xₙ is close to a root?

Hint

The scale of f can make every output small.

Worked solution

No. Multiplying a function by a tiny nonzero constant makes its residuals small without changing its roots. Use a justified root bracket or other valid error estimate.

10 / A nonzero constant factor cancels from Newton’s method

The exact update depends on f/f′.

Replace f(x) by h(x) = 7f(x).Worked example

h′(x) = 7f′(x)

Differentiate the constant multiple.

h(x)/h′(x) = f(x)/f′(x)

The nonzero factor cancels wherever the quotient is defined.

The exact Newton updates are identical

This concerns exact mathematics; finite-precision computations can still be affected by extreme scaling.

13 · Equivalent target

Do x² − 3 and 5x² − 15 produce the same Newton update from the same nonzero start?

Hint

The second function is five times the first.

Worked solution

Yes. (5x² − 15)/(10x) = (x² − 3)/(2x), so the updates match.

14 · A nonlinear change is different

If h(x) = [f(x)]³ and f and f′ are nonzero at the current input, compare h/h′ with f/f′.

Hint

Use the chain rule.

Worked solution

h′ = 3f²f′, so h/h′ = f/(3f′). The step is one third as large. Having the same roots does not always give the same Newton iteration.

11 / Check the prerequisites for the next tangent

An estimate must give a defined function value and usable slope.

If the current point is already an exact root, stop. Otherwise Newton’s formula needs a defined f and a nonzero derivative at that input. Check that the next estimate remains in the domain and in any physical interval relevant to the problem.

A horizontal tangent at a nonroot gives no finite intercept. A near-horizontal tangent can make a large step when the ratio f/f′ is large. More detailed failure cases belong to the next lesson.

15 · Already at a root

For f(x) = x², the current input is zero. Both f and f′ are zero. What should you report?

Hint

Check whether the problem has already been solved.

Worked solution

Zero is an exact root. Stop; do not try to evaluate the undefined quotient 0/0.

12 / Present a Newton calculation so it can be checked

Give the function, derivative, labels and accuracy evidence.

  • Write the original equation as f(x) = 0.
  • Differentiate f correctly, including chain-rule factors.
  • Substitute into xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ).
  • Use the supplied starting index and count each substitution.
  • Keep internal precision and use radians for standard trig formulas.
  • Check domains and nonzero derivatives.
  • Verify final rounding with an independent bracket.

16 · One rational step

For f(x) = 1/x − 2, use x₀ = 0.25 to find x₁.

Hint

Use f(0.25) = 2 and f′(0.25) = −16.

Worked solution

x₁ = 0.25 − 2/(−16) = 0.375. Both inputs are nonzero.

Section 1 of 12 · Replace a small part of the curve by its tangent