PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Math Visualization

Other simulators in this category — or see all 61.

View category →
NewUniversity / research

Rössler Attractor

RK4 integration of ẋ=−y−z, ẏ=x+ay, ż=b+z(x−c); period-doubling cascade as c grows.

Launch Simulator
NewSchool

L-Systems (Turtle)

Lindenmayer string rewriting + turtle: Koch, Sierpinski, Hilbert, Heighway dragon, plant.

Launch Simulator
NewSchool

Bézier & de Casteljau

Drag control points; live recursive linear-interpolation scaffolding evaluates B(t).

Launch Simulator
NewSchool

Convex Hull (Graham & QuickHull)

Click to add points, drag to move; Graham scan with step playback or QuickHull divide-by-farthest; compare vertex sets.

Launch Simulator
NewSchool

Delaunay & Voronoi

Bowyer–Watson triangulation and dual Voronoi tessellation; click to add seeds, drag to move.

Launch Simulator
NewUniversity / research

Physarum Slime (Agents)

~4500 agents follow a deposited chemoattractant: deposit + diffusion + decay + 3-sensor steering grow path networks.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Math Visualization/Newton's Method (1D)

Newton's Method (1D)

Newton's method locates a root of a smooth scalar equation f(x) = 0 by linearizing the graph of f at the current iterate xₙ and taking the x-intercept of the tangent line as the next iterate xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ). Geometrically, one lifts vertically from the x-axis to (xₙ, f(xₙ)), then follows the tangent down to where it meets the axis again. This simulator plots y = f(x) from a mathjs expression, lets you choose x₀ by clicking the graph (a small drag still counts as panning), and draws the full broken-line Newton path in pink. The derivative f′ is obtained by a symmetric finite difference, so you can experiment with any expression that evaluates reliably on the window—no hand-derived derivative is required. Controls include presets, a horizontal zoom slider, pan by dragging, a slider for x₀, and a cap on iterations with a compact iteration log. Stopping rules cover small |f| (approximate root), tiny step |Δx| (slow progress), near-zero derivative (singular Jacobian in 1D), non-finite values, and divergence if iterates blow up. This complements the site's Newton fractal lab, which visualizes complex basins for polynomials on ℂ rather than the real tangent picture on ℝ.

Who it's for: Introductory calculus and numerical analysis students learning root-finding, linearization, and sensitivity to initial guesses; instructors contrasting real 1D geometry with complex basin plots.

Key terms

  • Newton's method
  • Tangent line
  • Linearization
  • Root finding
  • Finite-difference derivative
  • Quadratic convergence (local)
  • Basin of attraction (1D intuition)

f(x)

Use x, ^, sin, cos, exp, log, sqrt, abs, pi, e. Roots of f(x)=0.

Iteration

18
1.2

View

1 ×

Drag on the plot to pan along x.

Shortcuts

  • •Click the graph (without dragging) to choose initial x₀
  • •Drag on the plot to pan horizontally
  • •Space — reset x window; R — randomize x₀ slightly

Measured values

StatusConverged
Iterations used4
Last x1.4142136
f(last x)4.4409e-16
#xfΔx
11.2000-0.5600-0.2333
21.43330.054440.01899
31.41430.00036070.0001275
41.41421.626e-85.749e-9

How it works

Plot y = f(x) (mathjs), pick x₀ by clicking the horizontal axis region, and watch Newton iterations: vertical lift to the graph, then step along the tangent to the next x-intercept. f′(x) is approximated by a symmetric finite difference. For basins in the complex plane, see the separate Newton fractal lab.

Frequently asked questions

Why use a finite difference instead of a symbolic derivative?
Symbolic differentiation is elegant when available, but this demo prioritizes flexibility: any mathjs expression you can plot can be iterated immediately. The cost is numerical error in f′ and slower convergence near noisy regions; for production solvers you would combine automatic differentiation or analytic derivatives with line searches or trust regions.
Why does the method fail or stall for some starting points?
Newton's method is not globally convergent. If f′(x) is near zero while f(x) is not, the tangent is nearly horizontal and the next iterate can jump far away. If the initial guess lies in a flat region of f, you may hit the zero derivative guard. Oscillatory functions can also trap the iteration in cycles unless damped.
How is this different from the Newton fractal simulator?
The fractal page colors the complex plane by which root of a polynomial attracts each starting z₀ under z − p(z)/p′(z). Here the emphasis is the real 1D picture: the graph of f, tangents, and how a real initial value chases a real root along ℝ.
Does quadratic convergence show up visually?
Only qualitatively: near a simple root with a good guess, the vertical segments |f(xₙ)| shrink much faster than linearly. The simulator does not overlay an error curve; use the iteration table to see Δx and f magnitudes collapse when the iterate is already close.