๐ŸŽฏ Locating Roots

A Level Maths Year 2 ยท Numerical Methods

Level 3 · Ages 17–18

← Back to topic overview
1 Equations You Cannot Solve Exactly

Most equations that come out of real problems โ€” $x^3 - 3x - 1 = 0$, $\mathrm{e}^{-x} = x$, $x\sin x = 1$ โ€” have no neat algebraic solution. We can still pin the answer down as accurately as we like. The first step is always to trap the root inside a small interval.

A root of the equation $\mathrm{f}(x) = 0$ is a value of $x$ where the graph of $y = \mathrm{f}(x)$ meets the $x$-axis. We usually call an unknown root $\alpha$ (alpha).
The change of sign principle
If $\mathrm{f}$ is continuous for $a \leqslant x \leqslant b$ and $\mathrm{f}(a)$ and $\mathrm{f}(b)$ have opposite signs,
then $\mathrm{f}(x) = 0$ has at least one root $\alpha$ with $a < \alpha < b$

The reason is visual: a continuous graph has no gaps or jumps, so to get from below the axis to above it the curve must cross the axis somewhere in between.

x y โˆ’2 โˆ’1 1 2 โˆ’3 โˆ’1 1 3 f(1) = โˆ’3 < 0 f(2) = 1 > 0 root ฮฑ y = xยณ โˆ’ 3x โˆ’ 1
Always use radians when the function involves $\sin$, $\cos$ or $\tan$. Set your calculator to radian mode before you start; a sign check in degrees is worthless.
2 Showing That a Root Lies in an Interval

Exam questions say "Show that the equation โ€ฆ has a root between $a$ and $b$". A full answer has three parts, and the third is the one people forget.

  1. Rearrange the equation into the form $\mathrm{f}(x) = 0$ and define $\mathrm{f}(x)$.
  2. Calculate $\mathrm{f}(a)$ and $\mathrm{f}(b)$ and write down their values (a sign alone is not enough).
  3. Conclude: "There is a change of sign and $\mathrm{f}$ is continuous for $a \leqslant x \leqslant b$, so there is a root between $a$ and $b$."
Worked Example 1 โ€” A cubic

Show that $x^3 - 3x - 1 = 0$ has a root $\alpha$ with $1 < \alpha < 2$.

โ‘ Let $\mathrm{f}(x) = x^3 - 3x - 1$.
โ‘ก$\mathrm{f}(1) = 1 - 3 - 1 = -3 < 0$
โ‘ข$\mathrm{f}(2) = 8 - 6 - 1 = 1 > 0$
โ‘ฃThere is a change of sign, and $\mathrm{f}$ is a polynomial so it is continuous. Therefore there is a root between $1$ and $2$.
Worked Example 2 โ€” Rearranging first

Show that the equation $x \sin x = 1$ has a root between $x = 1$ and $x = 1.2$.

โ‘ Rearrange: $\mathrm{f}(x) = x\sin x - 1$, so roots of $\mathrm{f}(x) = 0$ are solutions of the equation.
โ‘กIn radians: $\mathrm{f}(1) = \sin 1 - 1 = -0.1585\ldots < 0$
โ‘ข$\mathrm{f}(1.2) = 1.2\sin 1.2 - 1 = 0.1184\ldots > 0$
โ‘ฃChange of sign, and $\mathrm{f}$ is continuous, so there is a root with $1 < x < 1.2$.
You cannot test "$x\sin x = 1$" for a sign change directly โ€” the equation has no sign. Always make one side zero first.
Worked Example 3 โ€” Counting roots with a sketch

By sketching $y = 2^x$ and $y = 3x$, explain why $2^x = 3x$ has exactly two roots, and locate each between consecutive integers.

โ‘ $y = 3x$ is a straight line through the origin; $y = 2^x$ starts above it at $(0, 1)$ but eventually grows faster than any line. The exponential is below the line in the middle and above it at both ends, so the graphs cross twice.
โ‘กLet $\mathrm{f}(x) = 2^x - 3x$. Then $\mathrm{f}(0) = 1$, $\mathrm{f}(1) = -1$: a root with $0 < x < 1$.
โ‘ข$\mathrm{f}(3) = 8 - 9 = -1$, $\mathrm{f}(4) = 16 - 12 = 4$: a root with $3 < x < 4$.
Sketching the two sides of an equation is the quickest way to know how many roots to look for, before you start hunting with signs.
3 Narrowing Down: Roots to a Given Accuracy

Once a root is trapped, you can shrink the interval by testing values in between โ€” a decimal search. Each new sign check tells you which half of the interval the root is in.

Worked Example 4 โ€” A decimal search

Find the root of $x^3 - 3x - 1 = 0$ between $1$ and $2$ correct to $2$ decimal places.

$x$$1.8$$1.9$$1.87$$1.88$$1.875$
$\mathrm{f}(x)$$-0.568$$0.159$$-0.0708$$0.00467$$-0.0332$
โ‘ Sign change between $1.8$ and $1.9$, so $1.8 < \alpha < 1.9$.
โ‘กSign change between $1.87$ and $1.88$, so $1.87 < \alpha < 1.88$.
โ‘ขCheck the midpoint: $\mathrm{f}(1.875) < 0$, so $1.875 < \alpha < 1.88$.
โ‘ฃEvery number in that interval rounds to $1.88$, so $\alpha = 1.88$ to $2$ d.p.
Proving a root is correct to a given accuracy
To show $\alpha = 1.796$ to $3$ d.p., test the bounds $1.7955$ and $1.7965$ and find a change of sign
Worked Example 5 โ€” Using the bounds

Show that $1.796$ is a root of $x^3 - x - 4 = 0$ correct to $3$ decimal places.

โ‘ Let $\mathrm{f}(x) = x^3 - x - 4$. The bounds for $1.796$ to $3$ d.p. are $1.7955$ and $1.7965$.
โ‘ก$\mathrm{f}(1.7955) = -0.00713\ldots < 0$
โ‘ข$\mathrm{f}(1.7965) = 0.00155\ldots > 0$
โ‘ฃChange of sign and $\mathrm{f}$ continuous, so $1.7955 < \alpha < 1.7965$, and hence $\alpha = 1.796$ to $3$ d.p.
Testing $1.795$ and $1.797$ is not enough: a root at $1.7952$ would lie between them but round to $1.795$. Only the half-way bounds prove the rounding.
Worked Example 6 โ€” A transcendental equation

Show that the equation $\mathrm{e}^{-x} = x$ has a root $\alpha = 0.567$ correct to $3$ decimal places.

โ‘ Let $\mathrm{f}(x) = \mathrm{e}^{-x} - x$.
โ‘ก$\mathrm{f}(0.5665) = 0.00101\ldots > 0$ and $\mathrm{f}(0.5675) = -0.00056\ldots < 0$
โ‘ขChange of sign and $\mathrm{f}$ is continuous, so $0.5665 < \alpha < 0.5675$ and $\alpha = 0.567$ to $3$ d.p.
The sign may go from positive to negative โ€” that is still a change of sign.
4 When the Change of Sign Method Fails

The principle has two halves: a sign change with continuity guarantees a root, and no sign change guarantees nothing. Both halves can trip you up.

SituationWhat goes wrongExample
Vertical asymptoteSign changes but there is no root โ€” the function is not continuous.$\dfrac{1}{x-2}$ for $1 \leqslant x \leqslant 3$
Repeated rootThe curve touches the axis without crossing, so there is no sign change.$(x-1)^2(x+2)$ for $0.5 \leqslant x \leqslant 1.5$
Two (or an even number of) roots close togetherThe sign changes twice, so the end values have the same sign.$(x-0.3)(x-0.7)$ for $0 \leqslant x \leqslant 1$
Interval too wideA sign change may hide three roots, not one.$x^3 - 3x - 1$ for $-2 \leqslant x \leqslant 2$
x y 1 2 3 โˆ’2 2 y = 1/(x โˆ’ 2) asymptote x = 2
Worked Example 7 โ€” A false root

$\mathrm{f}(x) = \dfrac{1}{x - 2}$. Show that $\mathrm{f}(1)$ and $\mathrm{f}(3)$ have opposite signs, and explain why $\mathrm{f}(x) = 0$ has no root with $1 \leqslant x \leqslant 3$.

โ‘ $\mathrm{f}(1) = -1$ and $\mathrm{f}(3) = 1$: opposite signs.
โ‘กBut $\dfrac{1}{x-2}$ is never zero โ€” a fraction is only zero when its numerator is.
โ‘ขThe sign change happens because $\mathrm{f}$ is undefined at $x = 2$: there is a vertical asymptote. $\mathrm{f}$ is not continuous for $1 \leqslant x \leqslant 3$, so the principle does not apply.
x y โˆ’2 1 2 2 4 y = (x โˆ’ 1)ยฒ(x + 2) touches at x = 1
Worked Example 8 โ€” A root with no sign change

$\mathrm{f}(x) = x^3 - 3x + 2$. Find $\mathrm{f}(0.5)$ and $\mathrm{f}(1.5)$, and comment.

โ‘ $\mathrm{f}(0.5) = 0.125 - 1.5 + 2 = 0.625$ and $\mathrm{f}(1.5) = 3.375 - 4.5 + 2 = 0.875$. Both positive.
โ‘กYet $\mathrm{f}(1) = 1 - 3 + 2 = 0$: there is a root in the interval.
โ‘ข$\mathrm{f}(x) = (x-1)^2(x+2)$. The squared factor means the curve touches the axis at $x = 1$ and turns back, so the sign never changes.
No sign change does not mean no root. Repeated roots are exactly where change of sign methods are blind โ€” a sketch or factorising will reveal them.
5 Quick Reference

The principle

$\mathrm{f}$ continuous for $a \leqslant x \leqslant b$ and $\mathrm{f}(a)\mathrm{f}(b) < 0$ $\Rightarrow$ a root with $a < x < b$.

Set up

Rearrange to $\mathrm{f}(x) = 0$ before testing signs.

Show the values

Write $\mathrm{f}(a)$ and $\mathrm{f}(b)$ as numbers, then conclude.

Conclusion

"Change of sign, $\mathrm{f}$ continuous, so a root lies in the interval."

Accuracy

For $\alpha = 1.796$ (3 d.p.), test $1.7955$ and $1.7965$.

Radians

Always, for trigonometric functions.

Asymptote

Sign change but no root โ€” discontinuity.

Repeated root

Root but no sign change โ€” the curve touches.

Sketch first

Tells you how many roots to look for.

6 Practice Questions
Question 1

Show that $x^3 - 5x + 1 = 0$ has a root between $x = 2$ and $x = 3$.

โ–ถ Show solution

Let $\mathrm{f}(x) = x^3 - 5x + 1$.

$\mathrm{f}(2) = 8 - 10 + 1 = -1 < 0$ and $\mathrm{f}(3) = 27 - 15 + 1 = 13 > 0$.

There is a change of sign and $\mathrm{f}$ is continuous, so there is a root between $2$ and $3$.

Question 2

Show that the equation $\mathrm{e}^x = 4 - x$ has a root with $1 < x < 1.1$.

โ–ถ Show solution

Let $\mathrm{f}(x) = \mathrm{e}^x + x - 4$.

$\mathrm{f}(1) = \mathrm{e} - 3 = -0.2817\ldots < 0$

$\mathrm{f}(1.1) = \mathrm{e}^{1.1} - 2.9 = 0.1042\ldots > 0$

Change of sign and $\mathrm{f}$ is continuous, so there is a root with $1 < x < 1.1$.

Question 3

Show that the equation $\ln x = 3 - x$ has a root between $2$ and $3$.

โ–ถ Show solution

Let $\mathrm{f}(x) = \ln x + x - 3$, which is continuous for $x > 0$.

$\mathrm{f}(2) = \ln 2 - 1 = -0.3068\ldots < 0$ and $\mathrm{f}(3) = \ln 3 = 1.0986\ldots > 0$.

Change of sign, so there is a root with $2 < x < 3$.

Question 4

Show that the equation $x\sin x = 1$ has a root $\alpha = 1.11$ correct to $2$ decimal places.

โ–ถ Show solution

Let $\mathrm{f}(x) = x\sin x - 1$ (radians). Test the bounds $1.105$ and $1.115$.

$\mathrm{f}(1.105) = -0.0127\ldots < 0$ and $\mathrm{f}(1.115) = 0.00117\ldots > 0$.

Change of sign and $\mathrm{f}$ is continuous, so $1.105 < \alpha < 1.115$, giving $\alpha = 1.11$ to $2$ d.p.

Question 5

Show that $x^3 - 2x - 5 = 0$ has a root $\alpha = 2.095$ correct to $3$ decimal places.

โ–ถ Show solution

Let $\mathrm{f}(x) = x^3 - 2x - 5$. Test $2.0945$ and $2.0955$.

$\mathrm{f}(2.0945) = -0.000575\ldots < 0$

$\mathrm{f}(2.0955) = 0.0106\ldots > 0$

Change of sign, $\mathrm{f}$ continuous, so $2.0945 < \alpha < 2.0955$ and $\alpha = 2.095$ to $3$ d.p.

Note: $\mathrm{f}(2.0945)$ is very small โ€” the root ($2.09455\ldots$) is only just above the lower bound. That is why you must work to enough significant figures.

Question 6

A student finds that $\tan 1 > 0$ and $\tan 2 < 0$ and concludes that $\tan x = 0$ has a root between $1$ and $2$. Explain the error.

โ–ถ Show solution

$\tan 1 = 1.557\ldots$ and $\tan 2 = -2.185\ldots$, so the signs are indeed different.

But $\tan x$ has a vertical asymptote at $x = \dfrac{\pi}{2} = 1.5707\ldots$, which lies between $1$ and $2$. The function is not continuous for $1 \leqslant x \leqslant 2$, so the change of sign principle does not apply.

In fact the roots of $\tan x = 0$ are $x = 0, \pm\pi, \ldots$ โ€” none lies between $1$ and $2$.

Question 7

$\mathrm{f}(x) = 4x^2 - 4x + 1$. Show that $\mathrm{f}(0)$ and $\mathrm{f}(1)$ have the same sign. Does this mean there is no root with $0 \leqslant x \leqslant 1$?

โ–ถ Show solution

$\mathrm{f}(0) = 1$ and $\mathrm{f}(1) = 4 - 4 + 1 = 1$, both positive.

No: $\mathrm{f}(x) = (2x - 1)^2$, which has a repeated root at $x = 0.5$. The graph touches the axis there without crossing, so there is no sign change even though there is a root.

Question 8

$\mathrm{f}(x) = x^3 - 3x - 1$. Given $\mathrm{f}(-2) = -3$ and $\mathrm{f}(2) = 1$, a student says "there is one root between $-2$ and $2$". By evaluating $\mathrm{f}(-1)$ and $\mathrm{f}(0)$, show that there are in fact three roots, and give an interval of width $1$ for each.

โ–ถ Show solution

$\mathrm{f}(-1) = -1 + 3 - 1 = 1$ and $\mathrm{f}(0) = -1$.

$x$$-2$$-1$$0$$1$$2$
$\mathrm{f}(x)$$-3$$1$$-1$$-3$$1$

Sign changes for $-2 < x < -1$, for $-1 < x < 0$ and for $1 < x < 2$: three roots. A cubic has at most three, so these are all of them.

The sign change between $-2$ and $2$ only guarantees at least one root.

Question 9

The equation $2^x = 3x$ has two roots. Show that the larger root lies between $3.3$ and $3.4$.

โ–ถ Show solution

Let $\mathrm{f}(x) = 2^x - 3x$.

$\mathrm{f}(3.3) = 2^{3.3} - 9.9 = -0.0508\ldots < 0$

$\mathrm{f}(3.4) = 2^{3.4} - 10.2 = 0.356\ldots > 0$

Change of sign and $\mathrm{f}$ continuous, so a root lies in $3.3 < x < 3.4$. (The other root satisfies $0 < x < 1$, as in Worked Example 3.)

Question 10

The amount of a drug in a patient's bloodstream, in mg, $t$ hours after an injection is modelled by $D = 20t\,\mathrm{e}^{-0.5t}$. The drug is effective while $D \geqslant 10$.

(a) Show that $D = 10$ when $20t\,\mathrm{e}^{-0.5t} - 10 = 0$ has a root between $t = 0.7$ and $t = 0.8$.
(b) Show that there is a second root between $t = 4$ and $t = 5$.
(c) Show that the first root is $0.71$ correct to $2$ decimal places.
(d) Given that the second root is $4.31$ to $2$ d.p., estimate for how long the drug is effective.

โ–ถ Show solution

Let $\mathrm{g}(t) = 20t\,\mathrm{e}^{-0.5t} - 10$, which is continuous.

(a) $\mathrm{g}(0.7) = -0.134\ldots < 0$ and $\mathrm{g}(0.8) = 0.725\ldots > 0$. Change of sign, so a root lies in $0.7 < t < 0.8$.

(b) $\mathrm{g}(4) = 0.827\ldots > 0$ and $\mathrm{g}(5) = -1.79\ldots < 0$. Change of sign, so a root lies in $4 < t < 5$.

(c) $\mathrm{g}(0.705) = -0.0887\ldots < 0$ and $\mathrm{g}(0.715) = 0.00174\ldots > 0$. Change of sign, so the root lies in $0.705 < t < 0.715$ and equals $0.71$ to $2$ d.p.

(d) $D \geqslant 10$ between the two roots, so the drug is effective for about $4.31 - 0.71 = 3.6$ hours.

Check: at $t = 2$ (between the roots) $D = 40\mathrm{e}^{-1} = 14.7 > 10$ โœ“

Locating Roots · A Level Maths Year 2 · Created with MathJax