A continuous graph can't jump over the x-axis without crossing it — a simple fact that pins a root down to an interval.
8 min read4 worked examples
The sign-change principle
Many equations, like $x^3-4x-2=0$, have no neat algebraic solution — no formula produces an exact root. Numerical methods instead locate roots approximately, to any required accuracy. The starting point is a simple but powerful observation:
Sign-change principle
If $f(x)$ is continuous on the interval $[a,b]$, and $f(a)$ and $f(b)$ have opposite signs, then there is at least one root of $f(x)=0$ somewhere in the interval $(a,b)$.
The idea is geometric: a continuous curve that starts below the x-axis and ends above it (or vice versa) has no way to get from one side to the other without crossing the axis somewhere in between — and every crossing point is a root of $f(x)=0$.
Narrowing an interval by bisection
Once a root is known to lie in some interval $[a,b]$, the interval can be narrowed by testing the sign of $f(x)$ at the midpoint. Whichever half has a sign change at its endpoints contains the root, and the process repeats — halving the interval's width each time, and squeezing in on the root to any desired accuracy.
When the method can fail
The sign-change test is a one-way implication: a sign change guarantees a root exists somewhere inside, but the absence of a sign change doesn't guarantee there is no root — and even where a sign change occurs, care is needed.
Failure 1 — an even number of roots inside a large interval
If the chosen interval $[a,b]$ is too wide, $f(x)$ might cross the x-axis an even number of times inside it — dipping down and coming back up, say. Since each crossing flips the sign, an even number of crossings leaves $f(a)$ and $f(b)$ with the same sign, even though roots exist inside. The sign-change test alone would wrongly suggest no root is present.
Failure 2 — a discontinuity mimicking a sign change
If $f(x)$ has a discontinuity in $[a,b]$ — for example an asymptote, as in $f(x)=\dfrac{1}{x-2}$ — the function's sign can flip across the discontinuity without $f(x)$ ever actually equalling zero. Here $f(1)=-1$ and $f(3)=1$ have opposite signs, but there is no root in $(1,3)$: the function simply jumps from $-\infty$ to $+\infty$ across the asymptote at $x=2$ rather than passing through zero.
Because of both failure modes, the sign-change test should always be backed up by a sketch of the function, or by narrowing the interval enough to be confident only one root (and no discontinuity) lies inside.
Worked example 1
Showing a root lies in a given interval
Show that $f(x)=x^3-4x-2$ has a root in the interval $[2,3]$.
MethodEvaluate f at both endpoints and check for a sign change
1
$f(2)=(2)^3-4(2)-2=8-8-2=-2$.
Evaluate at the left endpoint.
2
$f(3)=(3)^3-4(3)-2=27-12-2=13$.
Evaluate at the right endpoint.
3
$f(2)=-2<0$ and $f(3)=13>0$: a change of sign.
Compare the signs of the two values.
4
Since $f$ is a polynomial (continuous everywhere) and changes sign on $[2,3]$, there is a root of $f(x)=0$ in $(2,3)$.
Apply the sign-change principle — polynomials are always continuous, so the theorem applies directly.
▪ shown
Worked example 2
Narrowing an interval by bisection
Using the interval $[2,3]$ from Example 1, use one step of bisection to find a narrower interval of width $0.5$ containing the root of $f(x)=x^3-4x-2$.
MethodTest the sign of f at the midpoint
1
Midpoint of $[2,3]$ is $x=2.5$.
Bisection always tests the interval's midpoint.
2
$f(2.5)=(2.5)^3-4(2.5)-2=15.625-10-2=3.625$.
Evaluate f at the midpoint.
3
$f(2)=-2<0$ and $f(2.5)=3.625>0$: a sign change occurs on $[2,2.5]$, not $[2.5,3]$ (where both $f(2.5)$ and $f(3)$ are positive).
Identify which half retains the sign change.
4
The root lies in the narrower interval $[2,2.5]$.
This halves the width of the interval containing the root, from 1 to 0.5.
▪ solved
Repeat to converge further
Applying bisection again to $[2,2.5]$ would test $f(2.25)$ and halve the interval again, to width $0.25$. Repeating enough times traps the root to any required number of decimal places.
Worked example 3
An interval too wide — an even number of roots
Explain why testing $f(x)=(x-1)(x-2)$ on the interval $[0,3]$ using only the sign-change test at the endpoints fails to indicate that roots exist.
MethodEvaluate the endpoints and compare with the known roots
1
$f(0)=(0-1)(0-2)=(-1)(-2)=2$.
Evaluate at the left endpoint.
2
$f(3)=(3-1)(3-2)=(2)(1)=2$.
Evaluate at the right endpoint.
3
$f(0)=2$ and $f(3)=2$: both positive, no sign change.
Compare signs — they match, so a naive sign-change test suggests no root.
4
But $f(x)=(x-1)(x-2)$ clearly has roots at $x=1$ and $x=2$, both inside $[0,3]$.
Factored form shows the true roots directly.
5
The interval $[0,3]$ contains an even number of roots ($2$): the curve dips negative between $x=1$ and $x=2$, then returns positive, so the endpoint signs match despite two roots existing inside.
This is exactly the "even number of roots" failure mode — an overly wide interval hides sign changes that cancel out.
▪ explained
The fix
Testing a narrower interval, such as $[0,1.5]$, would reveal $f(0)=2>0$ and $f(1.5)=(0.5)(-0.5)=-0.25<0$ — a genuine sign change correctly flagging the root at $x=1$. Choosing sensible, narrower sub-intervals (often guided by a sketch) avoids this failure mode.
Worked example 4
A discontinuity masquerading as a root · Challenge
Show that $f(x)=\dfrac{1}{x-2}+x-5$ has a sign change on $[1,3]$, but explain why this does not guarantee a root of $f(x)=0$ lies in $(1,3)$.
MethodEvaluate the endpoints, then identify the discontinuity
Both $f(1)=-5$ and $f(3)=-1$ are negative — no sign change here, so this particular pair doesn't illustrate the issue directly; check nearer the asymptote instead. Take $f(1.9)=\dfrac{1}{-0.1}+1.9-5=-10-3.1=-13.1$ and $f(2.1)=\dfrac{1}{0.1}+2.1-5=10-2.9=7.1$.
Test points either side of the suspected discontinuity at x = 2, where the function is undefined.
4
$f(1.9)=-13.1<0$ and $f(2.1)=7.1>0$: a sign change on $[1.9,2.1]$.
A genuine sign change is observed across this narrower interval.
5
But $f(x)=\dfrac{1}{x-2}+x-5$ is undefined at $x=2$ (division by zero) — $f$ is discontinuous on $[1.9,2.1]$, so the sign-change principle (which requires continuity) does not apply.
The theorem's hypothesis — continuity on the interval — fails here, so its conclusion cannot be relied on.
6
Indeed, as $x\to2^-$, $f(x)\to-\infty$, and as $x\to2^+$, $f(x)\to+\infty$: the function jumps across the vertical asymptote at $x=2$ without ever passing through $f(x)=0$ near there.
The sign change is caused entirely by the asymptote, not by a genuine root.
▪ explained
Look deeper
This is exactly why the sign-change principle explicitly requires $f$ to be continuous on $[a,b]$: a rational function like this one is continuous everywhere except at its vertical asymptote, and testing an interval that straddles the asymptote can produce a misleading sign change with no actual root nearby. Always check the domain of $f$ for discontinuities before trusting a sign change.
Common mistake
Concluding "no sign change, so no root" — the sign-change test can only confirm a root exists when the sign does change; it says nothing when the interval happens to contain an even number of roots. Equally common: trusting a sign change without checking $f$ is continuous throughout the interval, which can wrongly suggest a root exists near an asymptote or other discontinuity.
Check yourself
Show that $g(x)=e^x-3x-1$ has a root in the interval $[1,2]$, and explain what property of $g$ makes the sign-change test valid here. (Hint: evaluate g(1) and g(2), and consider whether g is continuous everywhere.)
Method
1
$g(1)=e^1-3(1)-1=e-4\approx-1.28$.
Evaluate at the left endpoint.
2
$g(2)=e^2-3(2)-1=e^2-7\approx0.39$.
Evaluate at the right endpoint.
3
$g(1)\approx-1.28<0$ and $g(2)\approx0.39>0$: a sign change, so there is a root in $(1,2)$.
Apply the sign-change principle.
4
$g(x)=e^x-3x-1$ is a combination of an exponential and a polynomial, both continuous everywhere — so $g$ has no discontinuities, and the sign-change test applies validly with no risk of a masked asymptote.
Confirms the theorem's continuity requirement is satisfied.