Newton's method
About this app
Root finding via tangent linearization: xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ). Step by step to quadratic convergence — including a divergence example that shows when the method fails.
How Newton’s method works
Newton’s method looks for a root of a function f. At the current point xₖ it replaces f with its tangent, a local linearisation, and takes the tangent’s root as the next value: xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ). Geometrically, you follow the tangent from (xₖ, f(xₖ)) down to the x-axis. If the start is close to a simple root, the method converges quadratically: the number of correct digits roughly doubles each step. If f′(xₖ) is near zero or the start is poor, it can jump around or diverge.
What the app shows
The app draws f, the tangent at the current point and its intersection with the x-axis. Four functions are available: x² − 2, x³ − x − 2, cos x − x and a divergence example with f(x) = arctan x. A slider sets the start value x₀. The values panel shows the iteration k, xₖ, f(xₖ), f′(xₖ), xₖ₊₁ and the step size |xₖ₊₁ − xₖ|. The derivative is computed numerically with a central difference.
Try it yourself
Pick x² − 2 and press “Step”: after a few iterations xₖ matches √2 to many digits and |Δ| shrinks faster and faster. Then switch to the divergence example. For arctan x the method only converges for start values near zero; if |x₀| is above about 1.39, the tangents throw the iterates further and further out. Try start values on both sides of that threshold.
Frequently asked questions
- What is the formula for Newton’s method?
- xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ). Start with a guess x₀ and apply the formula repeatedly. Each step is where the tangent at xₖ crosses the x-axis.
- What does quadratic convergence mean for Newton’s method?
- The error in the next step is roughly proportional to the square of the current error. In practice the number of correct decimal places doubles per iteration. This holds near a simple root when f is twice continuously differentiable.
- When does Newton’s method fail?
- If f′(xₖ) is zero or very small, the tangent shoots far away. With a poor start the sequence can diverge or oscillate between values. At multiple roots convergence drops to linear.
- Which functions can I test in the app?
- x² − 2, x³ − x − 2, cos x − x and arctan x as a divergence example. You choose the start value and advance step by step or as a continuous run.
Subject: Numerics
More from Numerics
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps