Newton-Raphson Method: Formula, Derivation, Examples & Steps
Learn how tangent lines turn a difficult equation into a sequence of better root estimates. Follow the Newton-Raphson formula, a complete derivation, verified calculations, convergence behavior, and practical limits.
Why numerical root finding matters
Equations describe unknown quantities in nearly every technical subject. An engineer may need the operating point where two nonlinear system curves meet. A physicist may need the value that makes a model agree with a measured condition. A programmer may need to solve an equation inside a simulation. Some equations have exact algebraic solutions, but many nonlinear equations do not have a convenient closed form. Even when an exact expression exists, a decimal approximation may be more useful for an engineering calculation.
The Newton-Raphson method is an iterative numerical technique for finding an approximate root. It is also called Newton’s method or Newton’s iterative method. A root is a value r that makes the function equal zero:
Instead of solving the equation in one algebraic step, Newton-Raphson repeatedly improves an initial estimate until it is accurate enough for the task.
The method is attractive because the update is short and can converge very quickly near a well-behaved simple root. It is not a universal solver: the initial guess matters, the derivative must be usable, and each step must be checked. This guide develops the Newton-Raphson formula from both a tangent-line picture and a Taylor expansion, then works through calculations you can audit.
CalculatorGoat’s Derivative Calculator can help you check a symbolic derivative used in a Newton iteration. You can also browse the calculus tools while applying the method by hand.
The Newton-Raphson Formula
Write the equation as . The Newton-Raphson iteration is
Each symbol has a specific role:
- is the current approximation to a root at iteration n.
- is the updated approximation produced by the current step.
- is the residual at the current value: how far the function output is from zero.
- is the derivative, or tangent slope, at the current value.
- labels the iteration; x₀ is the starting estimate.
The quotient is the horizontal correction suggested by the tangent line. If the residual is large compared with the slope, the correction is large. If the tangent is steep, the same vertical residual corresponds to a smaller horizontal correction. The formula requires . In computation, a derivative close to zero also deserves caution because it can create a huge and unreliable update.
Be careful with parentheses and the minus sign: the entire quotient is subtracted from xₙ. For example, for , the derivative is , so
This is an iteration formula, not a direct exact root formula. Every new x value is calculated from the previous one.
Geometric meaning: tangent lines find the next estimate
Imagine the graph of y = f(x). Choose a starting value x₀ and locate the point (x₀, f(x₀)) on the curve. Draw the tangent line there and extend it until it reaches the x-axis. The x-coordinate of that intercept is x₁. Repeat the construction at (x₁, f(x₁)) to obtain x₂.
- Plot the curve y = f(x) and select an initial x₀.
- Locate the point (x₀, f(x₀)) on the curve.
- Draw the tangent line using slope f′(x₀).
- Read the tangent’s x-axis intercept as x₁.
- Use x₁ to draw a new tangent and repeat.
For the diagram, f(x) = x² − 2 has a positive root √2. From x₀ = 2.2, the first tangent intercept is x₁ ≈ 1.5545; the next is x₂ ≈ 1.4219. The sequence moves toward √2 ≈ 1.4142. A different function or starting point can produce a different path. A tangent may miss the desired root, jump away, or become nearly horizontal.
Newton-Raphson Method Derivation from Taylor’s Theorem
To derive the update, approximate f near the current estimate xₙ. Taylor’s expansion begins
The full expansion contains quadratic and higher-order terms. Newton’s method uses only the first-order terms, which form the tangent-line approximation. If the next estimate xₙ₊₁ is intended to be a root, set this linear approximation equal to zero:
Now isolate the change in x. First subtract f(xₙ) from both sides:
Then divide by f′(xₙ), assuming it is nonzero:
Finally add xₙ to both sides:
The iteration formula follows by treating the first-order model as the local equation to solve. The same algebra comes directly from the tangent line. At xₙ, the tangent has equation y = f(xₙ) + f′(xₙ)(x − xₙ). Its x-intercept satisfies y = 0. Solving that linear equation yields the same update. The approximation is useful when the curve is well represented by its tangent near the root; the neglected Taylor terms explain why the result is not guaranteed to improve at every step.
Newton-Raphson Method Steps and Stopping Rules
A reliable Newton method calculation is more than repeated substitution. Record the equation, derivative, starting estimate, and a stopping rule before iterating. The following algorithm works for hand calculations and gives a sensible structure for a Newton-Raphson method calculator.
- Write the equation as a root problem. Rearrange it into f(x) = 0. For example, x³ = 2x + 5 becomes f(x) = x³ − 2x − 5.
- Differentiate. Find f′(x) and simplify it. Check the derivative independently if the expression is complicated.
- Choose an initial estimate x₀. Use a graph, a sign change, physical context, or a previous approximation to choose a plausible starting value.
- Evaluate the function and derivative. Calculate f(xₙ) and f′(xₙ) at the current estimate, using adequate precision.
- Apply the Newton-Raphson formula. Compute xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ). Do not divide if the derivative is zero or numerically too small.
- Check the new step and residual. Compare the change between estimates and evaluate the new function residual.
- Repeat or stop. Stop when the stated tolerance is met and the result is plausible; otherwise set xₙ to xₙ₊₁ and continue, subject to a maximum iteration count.
- Report the result honestly. Give the approximate root, units if applicable, tolerance, residual, and convergence status.
A common step-size test is
It checks whether consecutive estimates are close. Also check the residual:
The step-size test alone can be misleading: an algorithm can stagnate because of limited precision even when the residual is not small. A small residual alone can also be misleading if the function is very flat or poorly scaled. Using both gives a more informative stopping decision. Tolerances should reflect the problem’s scale and required accuracy; there is no single tolerance that is right for every application.
Practical implementations also set a maximum number of iterations, detect non-finite values, and check for a small derivative before dividing. A solver should label a result as converged only when its criteria pass, rather than treating “the loop ended” as proof that a root was found.
Newton Method Examples with Verified Iterations
The tables below use the same columns so you can compare the function residual, derivative, update, and absolute change. Values are rounded for display; calculations were carried out with extra precision before rounding. The displayed final root should be read as an approximation.
Example 1: Solve x³ − 2x − 5 = 0 from x₀ = 2
Let f(x) = x³ − 2x − 5, so f′(x) = 3x² − 2. The update is xₙ₊₁ = xₙ − (xₙ³ − 2xₙ − 5)/(3xₙ² − 2). Since f(2) = −1 and f′(2) = 10, the first estimate is 2.1.
| n | Current xₙ | f(xₙ) | f′(xₙ) | Next xₙ₊₁ | |xₙ₊₁ − xₙ| |
|---|---|---|---|---|---|
| 0 | 2.0000000000 | −1.0000000000 | 10.0000000000 | 2.1000000000 | 0.1000000000 |
| 1 | 2.1000000000 | 0.0610000000 | 11.2300000000 | 2.0945681211 | 0.0054318789 |
| 2 | 2.0945681211 | 0.0001857232 | 11.1616468418 | 2.0945514817 | 0.0000166394 |
| 3 | 2.0945514817 | 0.0000000017 | 11.1614377285 | 2.0945514815 | 0.0000000002 |
The estimates stabilize at approximately 2.0945514815, matching the expected root to the shown decimal places. Substitution gives a residual close to zero: f(2.0945514815) ≈ −4.7 × 10⁻¹⁰ (the precise rounded residual depends on the number of digits retained). This verifies the approximation numerically, not algebraically. A bracket such as [2, 2.1] also contains a root because the endpoint function values have opposite signs.
Example 2: Solve x² − 9 = 0 from x₀ = 2
Here f(x) = x² − 9 and f′(x) = 2x. The Newton update is xₙ₊₁ = xₙ − (xₙ² − 9)/(2xₙ). Starting from 2, the iterates approach the positive root 3:
- x₀ = 2, so x₁ = 2 − (4 − 9)/4 = 3.25.
- x₁ = 3.25, so x₂ = 3.25 − (3.25² − 9)/6.5 ≈ 3.0096153846.
- Next x₃ ≈ 3.0000153600, then x₄ ≈ 3.0000000000.
The equation also has the root −3. Starting from a suitable negative estimate, such as x₀ = −2, the method approaches −3. This illustrates why the initial approximation affects which root is found.
Example 3: Solve cos(x) − x = 0 from x₀ = 0.5
Use radians. Let f(x) = cos(x) − x and f′(x) = −sin(x) − 1. Iterating gives:
| n | Current xₙ | f(xₙ) | f′(xₙ) | Next xₙ₊₁ | |xₙ₊₁ − xₙ| |
|---|---|---|---|---|---|
| 0 | 0.5000000000 | 0.3775825619 | −1.4794255386 | 0.7552224171 | 0.2552224171 |
| 1 | 0.7552224171 | −0.0271033119 | −1.6854506318 | 0.7391416662 | 0.0160807510 |
| 2 | 0.7391416662 | −0.0000946154 | −1.6736538108 | 0.7390851339 | 0.0000565322 |
| 3 | 0.7390851339 | −0.0000000012 | −1.6736120297 | 0.7390851332 | 0.0000000007 |
The root is approximately 0.7390851332. This equation is a useful example because the unknown appears both inside cosine and outside it, so ordinary algebra does not isolate x.
Example 4: Solve eˣ − 3 = 0 from x₀ = 1
Set f(x) = eˣ − 3, so f′(x) = eˣ. The Newton update is xₙ₊₁ = xₙ − (eˣⁿ − 3)/eˣⁿ. The estimates are 1.1036383235, 1.0986248980, 1.0986122887, and then approximately 1.0986122887 again. The exact solution is x = ln(3), whose decimal value is 1.0986122887. The numerical method approaches this exact value; it does not replace the exact logarithmic identity.
How to read an iteration table
The current approximation is the input to one Newton step. The function column is the residual before that update; the derivative column gives the tangent slope. The next approximation is obtained from the formula, and the absolute-error column records the change between consecutive estimates. In the cubic example, that change drops from 0.1 to about 0.00543, then to about 0.0000166. Rapid shrinkage is evidence of convergence for this run, but one table cannot establish that every starting value will converge.
Convergence, Accuracy, and Starting Values
Convergence means the sequence of approximations approaches a limit that is a root of the equation. Newton-Raphson is usually discussed as a locally convergent method: when the initial estimate is sufficiently close to a simple root and the function is sufficiently smooth, the sequence often converges rapidly. “Local” matters. It says nothing about every possible starting value.
For a simple root r, where f(r) = 0 and f′(r) ≠ 0, the error eₙ = xₙ − r often follows the asymptotic relation
for a suitable local constant C, under standard regularity conditions. This is called quadratic convergence. Once an iterate is close enough, squaring a small error can make the next error much smaller. This is a local asymptotic property, not a promise that the first steps improve or that an arbitrary initial value will reach the root.
A multiple root behaves differently. If r is a root of multiplicity greater than one, then f′(r) = 0. The ordinary Newton iteration commonly loses its quadratic rate and may converge only linearly. Modified Newton schemes can account for known multiplicity, but they are a different algorithm. A zero derivative at an iterate also makes the standard update undefined, whether or not that iterate is a multiple root.
For a better starting value, graph the function or find an interval where it changes sign. A sign-changing interval helps identify a root when the function is continuous, but plain Newton-Raphson does not preserve that bracket. It may jump outside the interval. If guaranteed bracket retention is important, a bisection method or a safeguarded hybrid can be more appropriate. Inspect the derivative near the guess: a very small slope can produce a large jump. When multiple roots exist, compare the intended root’s location with the trajectory rather than assuming the nearest-looking answer is the desired one.
Floating-point arithmetic introduces another practical limit. Repeated computations store only a finite number of digits. Round-off can cause the displayed iterates to stop changing even though the exact error is not zero. Keep guard digits during calculation, round only for presentation, and report a residual with the approximation. If units or scales vary substantially, consider rescaling the equation or variable before interpreting tolerances.
Advantages and Limitations
Why it is useful
- It often converges very quickly near a simple root with a suitable starting value.
- The update is straightforward to implement and repeat.
- It applies to many nonlinear equations that are difficult to solve by elementary algebra.
- Derivative information can provide a more direct correction than methods using only function values.
- The same idea extends to systems of equations through Jacobian matrices.
What to watch
- A differentiable function and a usable derivative are required for the standard formula.
- A poor initial estimate can lead to divergence, oscillation, or an unintended root.
- A zero derivative stops the update; a tiny derivative can create a very large step.
- Multiple roots can reduce the convergence speed.
- Numerical precision, function scaling, and stopping criteria affect the reported result.
For these reasons, a good numerical workflow combines Newton’s fast local updates with safeguards such as iteration limits, residual checks, derivative checks, and—when needed—a bracketing method.
Applications of Newton-Raphson in Science and Computing
Newton’s method appears wherever a model can be written as an equation whose root represents a desired state. The specific function and acceptable error come from the application; the iteration itself does not decide whether a model is physically realistic.
- Engineering calculations: nonlinear design equations can encode balance conditions, material response, or operating constraints. A root may identify the load, temperature, or dimension that satisfies the model.
- Electrical circuits: diode and transistor current-voltage relationships are nonlinear. Circuit solvers use Newton-like updates on a system of residual equations to find node voltages and branch currents.
- Fluid mechanics: implicit flow relations, friction-factor correlations, and nonlinear constitutive models can require numerical roots. The selected root must still satisfy physical constraints.
- Physics: transcendental equations arise in wave modes, energy levels, and equilibrium models. Newton-Raphson can refine a candidate solution once a reasonable starting value is known.
- Financial mathematics: an internal rate of return can be formulated as the rate that makes a net-present-value function zero. Cash-flow patterns may create multiple roots, so a starting value and root interpretation matter.
- Optimization: a stationary point of a differentiable objective satisfies f′(x) = 0. Newton’s method can solve this derivative equation, although optimization also requires checking whether the point is a minimum, maximum, or saddle point and whether curvature is suitable.
- Computer graphics and simulation: intersection and constraint equations may be solved iteratively inside rendering or physical simulation. Stable derivatives and iteration caps help keep computation predictable.
- Scientific computing: many algorithms solve nonlinear equations as subproblems. For a system F(x) = 0, the scalar derivative generalizes to the Jacobian matrix, leading to a linear system for the update.
These are examples of where root finding is useful, not claims that plain scalar Newton-Raphson is always the correct solver. Real applications often require scaling, bounds, derivative approximations, line searches, or domain-specific safeguards.
Newton-Raphson vs. Bisection, Secant, and Regula Falsi
There is no single best root-finding method for every equation. The right choice depends on whether a derivative is available, whether a root can be bracketed, how costly function evaluations are, and whether convergence must be guaranteed.
| Method | Derivative needed? | Starting information | Typical behavior | Good fit | Limitation |
|---|---|---|---|---|---|
| Newton-Raphson | Yes | One initial estimate | Often very fast near a simple root | Derivative is available and a good guess is known | Can diverge or encounter a small / zero derivative |
| Bisection | No | Interval with a sign change | Reliable, predictable interval halving | A bracket and dependable convergence matter | Usually slower; requires a valid bracket |
| Secant | No explicit derivative | Two initial estimates | Often faster than bisection, sometimes near Newton speed | Derivative is costly or unavailable | Not guaranteed; may take unstable steps |
| Regula Falsi | No | Bracket with opposite signs | Uses a secant line while retaining a bracket | Bracket safety with interpolation is useful | One endpoint may remain fixed, slowing progress |
Use bisection when reliability and a root bracket are more important than speed. Use Newton-Raphson when you can differentiate the function and have a reasonable starting value. Choose secant when derivative evaluation is unavailable or expensive and you can tolerate less predictable convergence. Regula Falsi keeps the root bracket but can stagnate on one side. Safeguarded hybrids combine a fast method with a reliable bracket check.
Common Newton-Raphson Mistakes
- Choosing an arbitrary start. A guess far from the root can send the tangent to an unhelpful region. Use a graph or interval evidence where possible.
- Differentiating incorrectly. A sign or chain-rule error changes every later iterate. Check f′ before calculating.
- Using the wrong sign. The update is xₙ minus the quotient f(xₙ)/f′(xₙ), not plus.
- Forgetting parentheses. Evaluate the complete function value and complete derivative before dividing.
- Dividing by zero or a tiny derivative. Check the denominator before applying the update and stop with an explanation if it is unsafe.
- Stopping too early. A few stable-looking digits do not necessarily mean the residual is small enough for the task.
- Ignoring the residual. A small step can happen because of stagnation. Also inspect |f(x)|.
- Calling an approximation exact. Decimal output is approximate unless a separate argument establishes an exact root.
- Assuming convergence is automatic. Newton-Raphson does not guarantee convergence for every function and starting estimate.
Practice Problems with Answers
Try each problem before opening its answer. The iteration values are rounded; the stated root values are approximations unless an exact factorization or identity is given.
1. Solve x² − 16 = 0 from x₀ = 5
f′(x) = 2x. The iterates are x₁ = 4.1, x₂ ≈ 4.0012195122, x₃ ≈ 4.0000001858, and x₄ ≈ 4. The positive root is 4.
2. Solve x³ − x − 1 = 0 from x₀ = 1.5
f′(x) = 3x² − 1. The iterates are 1.3478260870, 1.3252003990, 1.3247181740, and 1.3247179572. The real root is approximately 1.3247179572.
3. Solve eˣ − 5 = 0 from x₀ = 1.5
f′(x) = eˣ. The iterates are 1.6156508007, 1.6094571725, 1.6094379126, and 1.6094379124. The exact root is ln(5), approximately 1.6094379124.
4. Solve cos(x) − x = 0 from x₀ = 0.5
In radians, f′(x) = −sin(x) − 1. The iterates are 0.7552224171, 0.7391416662, 0.7390851339, and 0.7390851332. The root is approximately 0.7390851332.
5. Solve x² + x − 6 = 0 from x₀ = −2.5
f′(x) = 2x + 1. The iterates are −3.0625, −3.0007621951, −3.0000001162, and approximately −3. The exact factorization is (x + 3)(x − 2) = 0, so the chosen start approaches the root −3. A different starting value can approach 2.
These problems demonstrate different function types and root locations. Before accepting any computed answer, substitute it into the original function and inspect the residual. If the result conflicts with a known factorization or exact value, check the derivative, arithmetic, and starting value.
Newton-Raphson Method FAQ
What is the Newton-Raphson method?
It is an iterative numerical method for approximating a root of f(x) = 0. Starting from x₀, each step uses xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ), provided the derivative is defined and nonzero at the current estimate.
What is the Newton-Raphson formula?
The iteration formula is xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ). It comes from setting the first-order Taylor approximation, or equivalently the tangent line at xₙ, equal to zero.
How do I calculate Newton-Raphson iterations?
Define f and f′, select an initial estimate, evaluate both at that estimate, substitute into the iteration formula, and repeat with the newly calculated value. Stop only after checking both the step size and the residual against a chosen tolerance.
Why is the derivative used in Newton’s method?
The derivative gives the slope of the tangent line. That slope determines where the tangent intersects the x-axis, which becomes the next root estimate.
What is the initial approximation?
The initial approximation x₀ is the starting value for the iteration. Its location can determine whether the method converges, how quickly it converges, or which root it approaches.
How do you determine convergence?
A small change |xₙ₊₁ − xₙ| suggests that estimates have stabilized, while a small residual |f(xₙ₊₁)| indicates the candidate nearly satisfies the equation. Checking both is safer than relying on either alone.
What happens when the derivative is zero?
The Newton update divides by f′(xₙ), so it is undefined when that derivative is zero. If the derivative is merely very small, the update can be extremely large and numerically unstable.
Is Newton-Raphson always convergent?
No. Convergence depends on the function, the starting value, and derivative behavior. Iterates can diverge, oscillate, encounter a zero derivative, or converge to a different root than intended.
What is quadratic convergence?
Near a sufficiently regular simple root, the error often satisfies |eₙ₊₁| ≈ C|eₙ|² for some local constant C. Once the iterates are close enough, the number of correct digits can grow rapidly. This is a local result, not a global guarantee.
What is the difference between Newton’s method and the Newton-Raphson method?
In elementary root-finding contexts, these names refer to the same tangent-based iterative method. Newton-Raphson is the common combined name.
Can Newton-Raphson solve polynomial equations?
Yes. It is often used to approximate polynomial roots, including roots that are difficult to express exactly. It can also be applied to many differentiable non-polynomial equations.
How accurate is Newton-Raphson?
Accuracy depends on the equation, the root, the starting value, floating-point precision, and stopping tolerances. A small residual and a small step provide useful numerical evidence, but the result remains an approximation unless an exact value is independently known.
Related Calculus Tools
Use a derivative tool to check f′(x), then apply the Newton iteration with your chosen initial estimate and tolerance. The method’s numerical answer still needs an independent residual check.