The Central Idea
A root, or zero, of a function \(f\) is a value \(r\) satisfying
\[ \boxed{f(r)=0}. \]Root-finding asks us to approximate \(r\) numerically when an exact formula is unavailable, inconvenient, or unstable.
Equations Become Root Problems
Any equation
\[ g(x)=h(x) \]can be rewritten as
\[ g(x)-h(x)=0. \]Define
\[ f(x)=g(x)-h(x). \]Then solving the original equation is equivalent to finding roots of \(f\).
Example: Converting an Equation
Solve
\[ e^{-x}=x. \]Rewrite as
\[ e^{-x}-x=0. \]Define
\[ f(x)=e^{-x}-x. \]Numerical root-finding can now be applied directly to \(f\).
Why Numerical Root-Finding Is Needed
Exact algebraic solutions are not always practical.
Examples include:
- transcendental equations;
- high-degree polynomial equations;
- equations arising from simulation or measurement;
- implicit models;
- equations whose exact solutions exist but are cumbersome to use.
Two Broad Families of Methods
Root-finding methods can be organized into two broad families.
- Bracketing methods: maintain an interval known to contain a root.
- Open methods: generate approximations without always preserving a bracket.
Bracketing methods emphasize robustness. Open methods often emphasize speed.
Bracketing a Root
Suppose \(f\) is continuous on \([a,b]\) and
\[ f(a)f(b)<0. \]Then \(f(a)\) and \(f(b)\) have opposite signs.
By the Intermediate Value Theorem, there is at least one root in
\[ \boxed{(a,b)}. \]Why a Sign Change Matters
If a continuous function changes sign between two points, its graph must cross the horizontal axis somewhere between them.
For example, if
\[ f(1)<0 \]and
\[ f(2)>0, \]continuity guarantees at least one root in \((1,2)\).
A Sign Change Does Not Guarantee a Unique Root
The Intermediate Value Theorem guarantees at least one root, not exactly one.
A function may cross the axis several times inside the interval.
Additional information, such as monotonicity, may be needed to establish uniqueness.
A Root May Exist Without a Sign Change
Consider
\[ f(x)=x^2. \]The root \(x=0\) has even multiplicity.
The function touches the axis but does not change sign.
Therefore, sign-change bracketing is powerful but does not detect every possible root.
The Bisection Method
Bisection begins with a continuous function and a bracket
\[ [a,b] \]satisfying
\[ f(a)f(b)<0. \]Compute the midpoint
\[ \boxed{m=\frac{a+b}{2}}. \]Then retain the half-interval that still contains a sign change.
Bisection Step by Step
- Start with \(a\) and \(b\) such that \(f(a)f(b)<0\).
- Compute \(m=(a+b)/2\).
- Evaluate \(f(m)\).
- If \(f(m)=0\), stop.
- If \(f(a)f(m)<0\), replace \(b\) by \(m\).
- Otherwise, replace \(a\) by \(m\).
- Repeat.
Example: Bisection Setup
Find a root of
\[ f(x)=x^2-2. \]Since
\[ f(1)=-1 \]and
\[ f(2)=2, \]there is a root in
\[ [1,2]. \]First Bisection Step
The midpoint is
\[ m_1=\frac{1+2}{2}=1.5. \]Evaluate:
\[ f(1.5)=1.5^2-2=0.25. \]Since
\[ f(1)<0 \]and
\[ f(1.5)>0, \]the root lies in
\[ [1,1.5]. \]Second Bisection Step
The new midpoint is
\[ m_2=\frac{1+1.5}{2}=1.25. \]Then
\[ f(1.25)=1.5625-2=-0.4375. \]The root therefore lies in
\[ [1.25,1.5]. \]Bisection Error Bound
Each bisection step cuts the interval length in half.
If the initial interval length is
\[ b-a, \]then after \(n\) bisections the interval length is
\[ \frac{b-a}{2^n}. \]If the midpoint is used as the approximation, the root error is bounded by half that width:
\[ \boxed{ |r-m_n| \le \frac{b-a}{2^{n+1}} }. \]How Many Bisection Steps Are Needed?
Suppose we require
\[ |r-m_n|\le\varepsilon. \]It is sufficient to choose \(n\) so that
\[ \frac{b-a}{2^{n+1}}\le\varepsilon. \]Solving for \(n\) gives a predictable computational budget.
Strengths of Bisection
- simple to understand and implement;
- guaranteed to converge under the bracketing assumptions;
- maintains a certified root interval;
- has a clear error bound;
- requires only function evaluations.
Limitations of Bisection
- convergence is relatively slow;
- a sign-changing bracket is required;
- even-multiplicity roots may not be detected by sign change;
- the method does not use derivative information.
Linear Convergence
Bisection reduces the interval error by a factor of approximately
\[ \frac12 \]each step.
This is an example of linear convergence.
Linear convergence is reliable but generally slower than quadratic convergence.
Fixed-Point Iteration
Instead of solving
\[ f(x)=0, \]we may rewrite the equation as
\[ x=g(x). \]A root becomes a fixed point of \(g\).
Starting from \(x_0\), define
\[ \boxed{x_{n+1}=g(x_n)}. \]What Is a Fixed Point?
A value \(r\) is a fixed point of \(g\) if
\[ g(r)=r. \]If the iteration converges,
\[ x_n\to r, \]then under appropriate continuity assumptions,
\[ r=g(r). \]Not Every Rearrangement Converges
An equation can often be rewritten as \(x=g(x)\) in many different ways.
These rearrangements are algebraically equivalent but can have very different numerical behavior.
Some fixed-point iterations converge rapidly, some slowly, and some diverge.
Local Fixed-Point Convergence
Suppose \(r\) is a fixed point:
\[ g(r)=r. \]If
\[ |g'(r)|<1, \]then nearby errors tend to contract:
\[ e_{n+1}\approx g'(r)e_n. \]This supports local convergence.
When Fixed-Point Iteration Can Diverge
If
\[ |g'(r)|>1, \]then nearby perturbations are locally amplified.
The iteration may move away from the fixed point rather than toward it.
Example: Fixed-Point Form
Consider
\[ x=\cos x. \]Define
\[ g(x)=\cos x. \]Then
\[ x_{n+1}=\cos x_n. \]Starting from a suitable \(x_0\), this iteration converges to the familiar fixed point near \(0.739\).
Newton's Method
Newton's method uses the tangent line to approximate the root of
\[ f(x)=0. \]Starting from \(x_n\), linearize:
\[ f(x) \approx f(x_n)+f'(x_n)(x-x_n). \]Set the tangent-line approximation equal to zero and solve for \(x\).
Deriving Newton's Formula
From
\[ 0 = f(x_n)+f'(x_n)(x_{n+1}-x_n), \]solve for \(x_{n+1}\):
\[ f'(x_n)(x_{n+1}-x_n) = -f(x_n). \]Therefore,
\[ \boxed{ x_{n+1} = x_n-\frac{f(x_n)}{f'(x_n)} }. \]Geometric Interpretation of Newton's Method
At \(x_n\), draw the tangent line to the graph of \(y=f(x)\).
The next approximation \(x_{n+1}\) is where that tangent line intersects the \(x\)-axis.
Each step replaces the nonlinear function locally with a linear model.
Example: Newton's Method for \(\sqrt{2}\)
Solve
\[ x^2-2=0. \]Here,
\[ f(x)=x^2-2 \]and
\[ f'(x)=2x. \]Newton's formula becomes
\[ x_{n+1} = x_n-\frac{x_n^2-2}{2x_n}. \]Simplifying the Newton Iteration
The iteration can be rewritten as
\[ x_{n+1} = \frac12 \left( x_n+\frac{2}{x_n} \right). \]Thus,
\[ \boxed{ x_{n+1} = \frac12 \left( x_n+\frac{2}{x_n} \right) }. \]This is also known as the Babylonian or Heron iteration for square roots.
Newton Iteration from \(x_0=1.5\)
Start with
\[ x_0=1.5. \]Then
\[ x_1 = \frac12 \left( 1.5+\frac{2}{1.5} \right) \approx 1.4166667. \]The next iteration gives approximately
\[ x_2\approx1.4142157. \]The root is approached rapidly.
Quadratic Convergence
Near a simple root and under appropriate smoothness assumptions, Newton's method often satisfies
\[ |e_{n+1}| \approx C|e_n|^2. \]This is quadratic convergence.
Once sufficiently close to the root, the number of correct digits can roughly double from one iteration to the next.
Simple Roots
A root \(r\) is simple when
\[ f(r)=0 \]and
\[ f'(r)\neq0. \]Newton's strongest local convergence behavior is associated with simple roots.
Multiple Roots
If
\[ f(r)=0 \]and
\[ f'(r)=0, \]the root may have multiplicity greater than one.
Ordinary Newton iteration can then converge more slowly than in the simple-root case.
Modified Newton Method for Known Multiplicity
If a root has known multiplicity \(m\), a modified iteration is
\[ \boxed{ x_{n+1} = x_n - m\frac{f(x_n)}{f'(x_n)} }. \]Under suitable assumptions, this can restore faster local convergence.
Newton's Method Can Fail
Newton's method is powerful but not automatically reliable from every starting point.
Failure modes include:
- \(f'(x_n)=0\);
- a derivative that is extremely small;
- iterations leaving the useful domain;
- cycling between points;
- convergence to an unintended root;
- divergence from a poor starting value.
Small Derivatives Are Dangerous
Newton's correction is
\[ -\frac{f(x_n)}{f'(x_n)}. \]If \(f'(x_n)\) is very small, the correction can become extremely large.
This can launch the next iterate far away from the desired root.
Starting Values Matter
Newton's method is generally a local method.
Fast convergence is most reliable when the starting value is already within a suitable neighborhood of the desired root.
Bracketing or graphical inspection can help produce a better initial estimate.
The Secant Method
Newton's method requires \(f'(x)\).
The secant method avoids explicit derivatives by approximating the derivative with a difference quotient:
\[ f'(x_n) \approx \frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}. \]Secant Formula
Substitute the difference quotient into Newton's formula:
\[ \boxed{ x_{n+1} = x_n - f(x_n) \frac{x_n-x_{n-1}} {f(x_n)-f(x_{n-1})} }. \]The method requires two starting values rather than one.
Geometric Interpretation of the Secant Method
Instead of using the tangent line at one point, the secant method uses the line through
\[ (x_{n-1},f(x_{n-1})) \]and
\[ (x_n,f(x_n)). \]The next iterate is where that secant line crosses the \(x\)-axis.
Secant Convergence
Under suitable conditions, the secant method converges faster than linearly but slower than quadratically.
Its convergence order is approximately
\[ \boxed{ \frac{1+\sqrt5}{2} \approx1.618 }. \]This number is the golden ratio.
Strengths of the Secant Method
- does not require analytic derivatives;
- often converges faster than bisection;
- uses only function evaluations;
- is easy to adapt to many nonlinear equations.
Limitations of the Secant Method
- convergence is not guaranteed from arbitrary starting points;
- the denominator can become very small;
- the method may leave a desired interval;
- it does not preserve a root bracket automatically.
False Position
The false-position, or regula falsi, method combines a sign-changing bracket with a secant-line estimate.
It computes the secant intercept but retains the subinterval that preserves the sign change.
This gives some of the speed intuition of secant methods while maintaining a bracket.
Hybrid Methods
Practical root-finding software often combines multiple methods.
A hybrid strategy may:
- begin with a reliable bracket;
- attempt a faster Newton or secant step;
- accept the fast step when it remains safe;
- fall back to bisection when necessary.
Hybrid methods balance robustness and speed.
Residual as a Stopping Measure
For an approximation \(x_n\), the residual is
\[ \boxed{r_n=f(x_n)}. \]A natural stopping condition is
\[ |f(x_n)|\le\tau_f. \]But conditioning determines whether a small residual implies a small root error.
Step Size as a Stopping Measure
Another common criterion is
\[ |x_{n+1}-x_n| \le \tau_x. \]A small step suggests the iterates have stabilized.
However, a small step alone does not prove the correct root has been reached.
Relative Step Criterion
When the scale of the root varies, use a relative criterion such as
\[ \frac{|x_{n+1}-x_n|} {\max(1,|x_{n+1}|)} \le \tau_{\text{rel}}. \]This avoids demanding the same absolute accuracy at every magnitude.
Bracket Width as a Stopping Measure
Bracketing methods provide a direct interval-based criterion:
\[ b_n-a_n\le\tau. \]If the root remains inside the bracket, the interval width provides a certified uncertainty measure.
Maximum Iteration Safeguard
Every iterative method should have a maximum iteration limit.
This prevents an algorithm from running indefinitely when:
- convergence fails;
- the tolerance is unrealistic;
- the method cycles;
- rounding prevents further improvement.
Use More Than One Stopping Test
Reliable root-finding often combines:
- residual size;
- step size;
- bracket width;
- maximum iteration count;
- domain and finite-value checks.
No single test answers every reliability question.
Forward Error and Root-Finding
If \(r\) is the exact root and \(x_n\) is an approximation, the forward error is
\[ \boxed{|x_n-r|}. \]The difficulty is that \(r\) is usually unknown.
Root-finding methods therefore rely on computable estimates and bounds.
Residual-to-Error Estimate
Near a simple root \(r\),
\[ f(x_n) \approx f'(r)(x_n-r). \]Therefore,
\[ \boxed{ x_n-r \approx \frac{f(x_n)}{f'(r)} }. \]If the derivative near the root is small, a small residual may correspond to a larger root error.
Root Conditioning
For a simple root, sensitivity is strongly connected to
\[ \frac{1}{|f'(r)|}. \]If
\[ |f'(r)| \]is small, the root location can be sensitive to perturbations in the function.
Multiple Roots Are More Sensitive
At a multiple root,
\[ f'(r)=0. \]The graph is flatter at the axis, and small function perturbations can move the apparent root significantly.
This is one reason repeated roots are numerically more delicate.
Convergence Rate
Suppose
\[ e_n=x_n-r. \]A method has convergence order \(p\) when, approximately,
\[ |e_{n+1}| \approx C|e_n|^p \]for some constant \(C\) and sufficiently large \(n\).
Common Convergence Orders
- bisection: linear;
- many fixed-point iterations: linear;
- secant method: approximately order \(1.618\);
- Newton's method near a simple root: quadratic.
Faster asymptotic order does not automatically mean a method is best in every practical situation.
Cost per Iteration Matters
Newton's method may use fewer iterations but require both
\[ f(x_n) \]and
\[ f'(x_n). \]The secant method avoids derivative evaluation but uses two recent points.
Bisection requires only one new function evaluation per step after initialization.
Convergence Speed Is Not the Only Goal
A numerical method should be judged by:
- robustness;
- cost per iteration;
- convergence rate;
- availability of derivatives;
- quality of initial guesses;
- conditioning of the root;
- required error guarantees.
Graphical Preprocessing
Before iterating, it can be valuable to inspect the graph or sample the function.
This can help identify:
- possible root intervals;
- multiple roots;
- singularities;
- flat regions;
- poor starting values.
Tabulation as a Bracketing Strategy
Evaluate
\[ f(x_0),f(x_1),\ldots,f(x_n) \]on a coarse grid.
Whenever consecutive values have opposite signs,
\[ f(x_k)f(x_{k+1})<0, \]a continuous function has at least one root in that subinterval.
Root-Finding with Discontinuities
A sign change alone is not enough if continuity fails.
For example,
\[ f(x)=\frac1x \]changes sign across \(x=0\), but it has no root there.
Continuity must be checked before using a sign-change theorem.
Domain Restrictions Matter
Root iterations can leave the domain of the function.
Examples include:
- square roots of negative numbers in real arithmetic;
- logarithms of nonpositive values;
- division by zero;
- model parameters leaving physically meaningful ranges.
A practical solver should guard against invalid iterates.
Detecting Stagnation
Floating-point rounding can eventually produce
\[ x_{n+1}=x_n \]even when the mathematical method could continue in exact arithmetic.
This is numerical stagnation.
Further iterations then provide no improvement.
Detecting Divergence
Indicators of divergence include:
- rapidly growing \(|x_n|\);
- rapidly growing residuals;
- oscillation without contraction;
- repeated invalid values;
- failure to improve after many steps.
A Reliable Bisection Workflow
- Verify continuity on the interval.
- Confirm \(f(a)f(b)<0\).
- Compute the midpoint.
- Evaluate the midpoint sign.
- Retain the sign-changing half.
- Track the bracket width.
- Stop when the error target is met.
A Reliable Newton Workflow
- Define \(f(x)\) and \(f'(x)\).
- Choose a reasonable starting value.
- Evaluate \(f(x_n)\) and \(f'(x_n)\).
- Reject or safeguard steps with very small derivatives.
- Compute the Newton correction.
- Check the new iterate for domain validity.
- Monitor residual and step size.
- Stop when tolerances are satisfied or a safeguard triggers.
A Reliable Secant Workflow
- Choose two starting values.
- Evaluate the function at both points.
- Form the secant slope.
- Check that the slope denominator is not too small.
- Compute the new intercept.
- Shift the two-point history forward.
- Monitor residual and step size.
- Stop according to the required tolerance and safeguards.
Common Error: Using Bisection Without Continuity
Opposite signs at two endpoints do not guarantee a root if the function is discontinuous between them.
Always verify the continuity assumption before invoking the Intermediate Value Theorem.
Common Error: Assuming a Sign Change Means One Root
A sign change guarantees at least one root, not uniqueness.
Multiple crossings may occur inside the bracket.
Common Error: Assuming No Sign Change Means No Root
Even-multiplicity roots can touch the axis without changing sign.
Root searches should therefore use more than sign-change detection when repeated roots are possible.
Common Error: Using Newton's Method Blindly
Newton's method is not guaranteed to converge from every initial value.
Inspect derivatives, domain restrictions, and the local graph before trusting a long iteration.
Common Error: Dividing by a Tiny Derivative
If
\[ |f'(x_n)| \]is very small, the Newton step may become enormous.
A robust implementation should detect and handle this situation.
Common Error: Stopping Only Because Two Iterates Match
A small step can result from stagnation or a poorly conditioned update.
Check the residual as well as the change in the iterate.
Common Error: Using Only the Residual
A small residual is not sufficient when the root is ill-conditioned.
A flat function near the root can make \(f(x_n)\) small while \(x_n\) remains noticeably displaced from the exact root.
Common Error: Ignoring Multiple Roots
Newton's method can lose quadratic convergence at repeated roots.
If multiplicity is known or suspected, adjust expectations and consider a modified method.
Common Error: Chasing More Digits Than the Data Support
A highly accurate numerical root of an uncertain model is not necessarily a highly accurate estimate of the real-world quantity.
Root-finding error should be interpreted alongside measurement, modeling, and conditioning error.
Example: Bisection Error Budget
Suppose a root is bracketed in
\[ [2,3]. \]The initial interval length is \(1\).
After \(10\) bisections, the midpoint error is bounded by
\[ \frac{1}{2^{11}}. \]Therefore,
\[ \boxed{ |r-m_{10}| \le \frac{1}{2048} \approx4.88\times10^{-4} }. \]Example: Newton Step
Let
\[ f(x)=x^3-2x-5. \]Then
\[ f'(x)=3x^2-2. \]Starting from \(x_0=2\),
\[ f(2)=-1 \]and
\[ f'(2)=10. \]Therefore,
\[ x_1 = 2-\frac{-1}{10} = \boxed{2.1}. \]Example: Secant Step
Suppose
\[ f(1)=-1 \]and
\[ f(2)=2. \]The secant estimate is
\[ x_2 = 2 - 2\frac{2-1}{2-(-1)}. \]Thus,
\[ x_2 = 2-\frac23 = \boxed{\frac43}. \]Practice 1: Identify a Bracket
For
\[ f(x)=x^2-3, \]show that \([1,2]\) brackets a root.
Practice 2: First Bisection Step
Using
\[ f(x)=x^2-3 \]on \([1,2]\), compute the first midpoint and identify the new bracket.
Practice 3: Bisection Error Bound
An initial interval has length \(4\).
What is the midpoint error bound after \(8\) bisections?
Practice 4: Newton Formula
Derive the Newton iteration for
\[ f(x)=x^2-5. \]Practice 5: One Newton Step
Using
\[ f(x)=x^2-5 \]and
\[ x_0=2, \]compute \(x_1\).
Practice 6: Fixed-Point Convergence Test
Suppose \(r\) is a fixed point of \(g\) and
\[ |g'(r)|=0.4. \]What does this suggest about local convergence?
Practice 7: Secant Formula Concept
What derivative approximation does the secant method use in place of \(f'(x_n)\)?
Practice 8: Residual
For
\[ f(x)=x^2-2, \]compute the residual at
\[ x=1.41. \]Practice 9: Method Selection
Which method is the most natural choice when:
- a guaranteed sign-changing bracket is available and robustness is the priority;
- a good starting point and derivative are available and rapid local convergence is desired?
Practice 10: Explain the Risk
Why can Newton's method behave poorly when \(f'(x_n)\) is close to zero?
Practice Answers
Practice 1
Evaluate the endpoints:
\[ f(1)=1-3=-2 \]and
\[ f(2)=4-3=1. \]Since
\[ f(1)f(2)<0, \]the interval
\[ \boxed{[1,2]} \]brackets at least one root.
Practice 2
The midpoint is
\[ m=\frac{1+2}{2}=1.5. \]Then
\[ f(1.5)=2.25-3=-0.75. \]Since \(f(1.5)<0\) and \(f(2)>0\), the new bracket is
\[ \boxed{[1.5,2]}. \]Practice 3
The midpoint error bound is
\[ \frac{4}{2^{8+1}} = \frac{4}{512} = \boxed{\frac{1}{128}} \]or approximately
\[ \boxed{0.0078125}. \]Practice 4
Since
\[ f(x)=x^2-5 \]and
\[ f'(x)=2x, \]Newton's method gives
\[ \boxed{ x_{n+1} = x_n-\frac{x_n^2-5}{2x_n} }. \]Practice 5
\[ x_1 = 2-\frac{4-5}{4} = 2+\frac14 = \boxed{2.25}. \]Practice 6
Since
\[ |g'(r)|=0.4<1, \]nearby perturbations contract locally. This suggests local convergence to the fixed point from sufficiently close starting values.
Practice 7
The secant method uses
\[ \boxed{ f'(x_n) \approx \frac{f(x_n)-f(x_{n-1})} {x_n-x_{n-1}} }. \]Practice 8
\[ f(1.41) = 1.41^2-2 = 1.9881-2 = \boxed{-0.0119}. \]Practice 9
- Bisection is the natural robust choice.
- Newton's method is the natural fast local choice.
Practice 10
Newton's correction contains division by \(f'(x_n)\). If that derivative is close to zero, the correction can become extremely large, sending the next iterate far from the desired root or outside the valid domain.
What to Remember
Root-finding solves
\[ \boxed{f(x)=0} \]by constructing successive approximations to a zero of \(f\).
- bisection uses a sign-changing bracket and provides guaranteed interval reduction;
- fixed-point iteration rewrites the problem as \(x=g(x)\);
- local fixed-point convergence is supported when \(|g'(r)|<1\);
- Newton's method uses tangent-line linearization;
- Newton's method is often quadratically convergent near a simple root;
- the secant method approximates derivatives with recent function values;
- multiple roots and small derivatives can reduce reliability;
- residual, step size, bracket width, and iteration limits should be used together;
- conditioning determines how residual error relates to root error;
- hybrid methods combine bracketing reliability with faster open steps.
The most important practical principle is to match the method to the structure of the problem rather than treating one root-finding algorithm as universally superior.
Where We Go Next
Root-finding addresses one-dimensional nonlinear equations. Many scientific and engineering computations require the solution of much larger systems involving vectors and matrices.
The next lesson, Numerical Linear Algebra, develops the computational treatment of linear systems, matrix factorizations, pivoting, conditioning, iterative methods, and the numerical issues that arise when matrix problems are solved in finite precision.