Newton-Raphson Root Finder

Iteratively solve f(x) = 0 using tangent-line updates

Parameters

ⓘ
ⓘ
ⓘ
Show Trail

Controls

xⓘ

Calculated Values

Root x:
1.41;1.41;
f(x) at root:
0.00;0.00;
Iterations used:
3.00;3.00;
Reference root:
1.41;1.41;

Examples

√2 from x² − 2

Classic demo with x₀ = 1.5.

  • Root: 1.411.41

Transcendental root

sin(x) = x/2 near x ≈ 1.9.

  • Root: 1.411.41

Visualization

Newton-Raphson in Physics

Equilibrium points, resonance conditions, and implicit relations in physics often reduce to f(x) = 0 with no closed-form solution. Newton-Raphson (Newton’s method) refines an initial guess using the local linear approximation of f.

Each iteration uses x_{n+1} = x_n − f(x_n)/f′(x_n). Geometrically, follow the tangent at (x_n, f(x_n)) to its intercept with the x-axis. Quadratic convergence near a simple root makes it very fast when started close enough.

Examples: solving Kepler’s equation for orbital position, finding wavelengths from dispersion relations, or locating zeros of overlap integrals. The animation shows successive iterates approaching the x-axis crossing.

Failure modes include zero derivative (horizontal tangent), oscillation, or divergence if x₀ is poor. Bisection is slower but only needs a sign-changing bracket.

Always verify |f(x)| is small and compare to a plot or independent method. Link numerical uncertainty to Error Propagation when f depends on measured inputs.

Key Concepts

  • Requires differentiable f and f′(x) ≠ 0
  • Quadratic convergence near a simple root
  • Sensitive to initial guess x₀
  • One root at a time — depends on starting point
  • Combine with graphing to pick x₀

Real-World Applications

  • Implicit time-step constraints in simulations
  • Finding equilibrium angles in statics
  • Solving transcendental lens or wave equations
  • Calibration fits requiring nonlinear root conditions

Explore Further

More computational physics tools

  • Gradient Descent

    Iteratively minimize f(x) by following the negative gradient with animated path visualization.

  • 1D Heat Equation

    Finite-difference FTCS solution to the diffusion equation with animated temperature profiles.

  • 1D Wave Equation

    Leapfrog finite-difference solution to the wave equation with animated wave propagation.

  • Numerical Integration

    Trapezoidal and Simpson rules to approximate definite integrals with error vs exact solutions.

  • ODE Solver

    Euler and Runge-Kutta 4 methods for first-order ODEs with comparison to analytic solutions.

  • Monte Carlo Intro

    Estimate π and integrals by random sampling — introduction to stochastic computational physics.

Physics Equations

Update:
xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
Stop when:
∣f(xn)∣<ε|f(x_n)| < \varepsilon

Step-by-Step Solution

See how the main results are calculated.

1

Step 1: Nonlinear equation

Solve x² − 2 = 0 numerically.

Equation:

f(x)=0f(x) = 0

Result:

Initialguessx0=1.5Initial guess x₀ = 1.5
2

Step 2: Newton–Raphson update

Linearize f near the current iterate using the tangent slope f′(x).

Equation:

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

Explanation:

Requires f′(xₙ) ≠ 0 and a starting guess close enough to the root.

3

Step 3: First iteration

Evaluate f and f′ at x₀.

Calculation:

f(x0)=0.250000,f′(x0)=3.000000f(x_0) = 0.250000,\quad f'(x_0) = 3.000000

Result:

x1=1.5−0.25003.0000=1.416667x_1 = 1.5 - \frac{0.2500}{3.0000} = 1.416667
4

Step 4: Converged root

Stopped after 3 updates (max 12).

Calculation:

xNR=1.41421356x_{\text{NR}} = 1.41421356

Result:

f(x)=4.511e−12f(x) = 4.511e-12

Explanation:

Reference root ≈ 1.41421356, error = 1.595e-12

Frequently Asked Questions (FAQ)

Why did Newton diverge?

Poor x₀, zero derivative, or a inflection point near the root. Try another guess or use bisection first.

How is this related to optimization?

Finding minima of g(x) uses Newton on g′(x) = 0 — same iteration structure.

Does it find all roots?

No — only the root in the basin of attraction of your starting guess.

Practice MCQs

  1. Newton-Raphson typically converges ______ near a simple root.
  2. The method fails outright when:
  3. x² − 2 = 0 with x₀ = 1.5 converges to:
  4. Compared to bisection, Newton usually needs:
  5. Each step uses: