The equation x³ − x − 2 = 0 has a root between 1 and 2, but no simple formula will find it. In practice, calculators and computers find roots like this by numerical methods: they make a guess, improve it, and repeat until the answer is accurate enough. This lesson covers how to locate a root by a change of sign, the bisection method, and the much faster Newton-Raphson method.
In this lesson you will learn
- How a change of sign shows that a root lies in an interval
- How the bisection method halves the interval each step
- The Newton-Raphson formula and where it comes from
- How to set out iterations in a clear table
- When each method can fail
You should know differentiation, the equation of a straight line and roots of polynomial equations.
Locating a Root
If f is continuous and f(a) and f(b) have opposite signs, the graph must cross the x-axis between a and b. So there is at least one root in the interval.
f(x) = x³ − x − 2
f(1) = 1 − 1 − 2 = −2 (negative)
f(2) = 8 − 2 − 2 = 4 (positive)
Change of sign, so a root lies between 1 and 2.
The function must be continuous. f(x) = 1/x changes sign between −1 and 1, but it has no root there; the graph jumps at x = 0 instead of crossing.
The Bisection Method
Bisect means cut in half. Each step:
- Find the midpoint m of the interval [a, b].
- Work out f(m).
- Keep the half where the sign still changes.
step interval midpoint m f(m)
1 [1, 2] 1.5 −0.1250
2 [1.5, 2] 1.75 1.6094
3 [1.5, 1.75] 1.625 0.6660
4 [1.5, 1.625] 1.5625 0.2522
5 [1.5, 1.5625] 1.53125 0.0591
6 [1.5, 1.53125] 1.515625 −0.0341
7 [1.515625, 1.53125] 1.5234375 0.0123
8 [1.515625, 1.5234375] ...
After 7 steps the root is between 1.5156 and 1.5234.
Bisection is slow but certain. Each step halves the width, so 10 steps shrink it by a factor of 1024. It always works once you have a sign change.
The Newton-Raphson Method
Start at a guess x₀. Draw the tangent to the curve there and see where it meets the x-axis. That point is usually much closer to the root. Repeat.
The tangent at (xₙ, f(xₙ)) has slope f′(xₙ). Setting y = 0 in its equation gives the next guess:
Newton-Raphson formula
xₙ₊₁ = xₙ − f(xₙ) / f′(xₙ)
f(x) = x³ − x − 2, f′(x) = 3x² − 1, x₀ = 1.5
n xₙ f(xₙ) xₙ₊₁
0 1.500000 −0.125000 1.521739
1 1.521739 0.002137 1.521380
2 1.521380 0.000001 1.521380
Root ≈ 1.52138 (to 5 decimal places)
Newton-Raphson reached five decimal places in 3 steps. Bisection would need about 17 steps for the same accuracy. Near a root, the number of correct digits roughly doubles with each Newton step.
Your calculator’s square root key often uses this idea. Applying the formula to f(x) = x² − 2 from x₀ = 1 gives 1.5, 1.41667, 1.414216, 1.4142136: the value of √2.
Comparing the Methods
| Bisection | Newton-Raphson | |
|---|---|---|
| Needs | An interval with a sign change | One starting value and f′(x) |
| Speed | Slow: one binary digit per step | Very fast near the root |
| Always works? | Yes, for a continuous f | No |
| Fails when | There is no sign change (for example, a double root) | f′(xₙ) is zero or very small, or the start is poor |
A common plan is to use a few bisection steps to get close, then switch to Newton-Raphson to finish quickly.
Common Mistakes
- Keeping the wrong half. Keep the half where f still has opposite signs at the two ends.
- Using a starting value where f′(x) = 0. The tangent is flat and never meets the x-axis. For our f, avoid x = ±0.577.
- Rounding between steps. Keep full values in the calculator; round only the final answer.
- Stopping too early. Stop when two answers agree to the accuracy you need, then check with a sign change.
Practice Exercises
Exercise 1. Show that x³ + 2x − 5 = 0 has a root between 1 and 2.
Show answer
f(1) = 1 + 2 − 5 = −2 and f(2) = 8 + 4 − 5 = 7. f is a polynomial, so it is continuous, and the change of sign shows a root lies between 1 and 2.
Exercise 2. Use one Newton-Raphson step from x₀ = 1 for the equation in Exercise 1.
Show answer
f′(x) = 3x² + 2, so f′(1) = 5. x₁ = 1 − (−2)/5 = 1.4. (The root is about 1.3283.)
Frequently Asked Questions
How do I prove my answer is correct to 3 decimal places?
Check the sign of f just below and just above the rounding boundaries. For 1.521, work out f(1.5205) and f(1.5215). Opposite signs prove the root lies between them, so it rounds to 1.521.
Can Newton-Raphson find the wrong root?
Yes. If an equation has several roots, the method may jump to one you did not expect, especially from a poor start. Sketch the graph first and start close to the root you want.
Summary
- A sign change of a continuous function shows a root in the interval.
- Bisection halves the interval each step: slow but reliable.
- Newton-Raphson uses xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ): fast but can fail.
- Check the final answer with a sign change at the rounding limits.
Next: The Poisson Distribution.
