Leave lesson

Pure · Numerical methods

1 / 11

Locating roots by change of sign

Trapping a root of f(x) = 0 in an interval using the change-of-sign rule — why continuity is essential, what a sign change does and doesn't guarantee, and refining a root to a given number of decimal places.

Pure · Numerical methods

Locating roots by change of sign

Trapping a root of f(x) = 0 in an interval using the change-of-sign rule — why continuity is essential, what a sign change does and doesn't guarantee, and refining a root to a given number of decimal places.

Why it works

Most equations cannot be solved exactly. There is no neat formula for the root of x32x5=0x^3 - 2x - 5 = 0, and an equation like ex=3xe^x = 3 - x mixes a curve and a line in a way no rearrangement untangles. So instead of solving, you locate the root: first trap it in an interval, then squeeze that interval down.

A root of f(x)=0f(x) = 0 is exactly where the graph y=f(x)y = f(x) crosses the xx-axis — where yy changes from negative to positive (or back). That is the whole idea behind the change-of-sign rule:If ff is continuous on [a,b][a, b] and f(a)f(a) and f(b)f(b) have opposite signs, then f(x)=0f(x) = 0 has a root somewhere between aa and bb.The reasoning is simple: to travel from a value below the axis to a value above it without lifting your pen, the graph has no choice but to cross zero on the way. So to show a root lies in an interval you just evaluate ff at each end and check the signs differ — a quick, certain test.11.522.53-551015(2, -1)xyContinuity is not optional — always state it. The "no lifting your pen" picture breaks if the graph jumps. Take f(x)=1xf(x) = \dfrac{1}{x} on [1,1][-1, 1]: f(1)=1f(-1) = -1 and f(1)=1f(1) = 1 have opposite signs, yet the equation 1x=0\frac1x = 0 has no root at all. The rule fails because ff is discontinuous at x=0x = 0 (an asymptote, not a crossing). For polynomials, exe^x, lnx\ln x and the like there is no such trouble — but you should still say "ff is continuous on this interval" as part of the argument.

What a sign change does and doesn't tell you. A change of sign guarantees an odd number of roots in the interval — at least one. But no sign change does not guarantee no root: a curve can touch the axis without crossing (a repeated root such as (x2)2(x-2)^2), or dip across and back, giving an even number of roots with the same sign at both ends. So sign change ⇒ root; same sign ⇒ inconclusive.

Refining to decimal places. Once a root is trapped, shrink the interval. To show a root is 2.12.1 to 1 decimal place, test the half-interval [2.05,2.15][2.05, 2.15]: a sign change there pins the root between 2.052.05 and 2.152.15, so it rounds to 2.12.1. Repeating this halving is interval bisection; the iteration and Newton–Raphson methods that follow refine far faster.