Area 7 of the course is Computational Methods or Mechanics: each school teaches one. This unit and Unit 21 are Computational Methods; Units 22–23 are Mechanics.
Suppose you borrow Rs 1,00,000 for a motorbike and pay it back at Rs 4,800 a month for two years. You pay Rs 1,15,200 in all, Rs 15,200 more than you borrowed: 7.6% a year for two years, it seems. But each month you owe less, so the interest is charged on less and less. What rate is the lender really charging? The rate r a month is the one that makes the 24 payments worth the loan:
No formula gives r. Yet a spreadsheet’s RATE function answers in a blink, “by iteration”: it guesses, checks how wrong the guess is, and guesses better. This unit is how. The answer comes at the end of 20.3. (The loan’s numbers are made up; the method is how a lender’s and a spreadsheet’s rate is found.)
20.1 Roots of equations
A root of the equation f(x) = 0 is a number that makes it true; on the graph of y = f(x), it is where the curve meets the X-axis.
An equation is algebraic if f(x) is a polynomial, such as (or can be made one, as can by squaring). It is transcendental if it has a trigonometric, exponential or logarithmic function of x in it, such as x = cos x, or .
Quadratics have a formula, and cubics and quartics have long ones. But in 1824 Niels Abel proved that no formula of roots and the four operations solves every equation of degree 5 or more, and a transcendental equation such as x = cos x has no formula at all. So we find roots numerically: a rough value first, then a rule that makes it better, step by step, until it is as accurate as we need. Each step is an iteration.
Locating a root
The first job is a rough place. Unit 17 gave the tool, the intermediate value theorem: if f is continuous on [a, b], and f(a) and f(b) have opposite signs, then f(x) = 0 at least once between a and b. An unbroken curve can’t get from below the axis to above it without crossing.
Approximate error
A method gives approximations x₁, x₂, x₃, … to a root α. The error of is ; its size is the absolute error, and the relative error (× 100 for a percentage error).
But we don’t know α: that is what we are looking for. So we judge a step by how much it changed the answer. The approximate error of is
When the steps close in on the root, a small change means we are close. We stop when (or ) is below a set tolerance, or, for “correct to k decimal places”, when two successive values agree to k places.
Two successive approximations to a root are 2.7465 and 2.7406. The relative approximate error of the second is about:
Pick an answer to see why.
20.2 Bisection method
Example 1 trapped the root of x = cos x in (0, 1). Cut the interval in half: the root is in one half, and the signs say which. Cut that half in half, and so on. Each cut halves the trap. That is the bisection method (bisect: cut in two).
The steps. Start with a, b where f(a) and f(b) have opposite signs.
- Find the midpoint and f(c).
- If f(c) = 0, c is the root. Otherwise, if f(a) and f(c) have opposite signs, the root is in [a, c]: put b = c. If not, it is in [c, b]: put a = c.
- Repeat with the new [a, b]. For “correct to k decimal places”, stop when a and b round to the same k places: the root between them rounds the same way.
The error of bisection
The root α is always inside the interval. The first midpoint c₁ is at most half the interval, , from it, and each step halves that. So after n steps
This bound is known before you start: to make the error less than a tolerance E, you need , that is . From an interval of width 1, an error below 0.001 needs : n = 10 steps (). Its approximate error is fixed too: , half the bound.
To find the root of by bisection, which interval should you start with?
Pick an answer to see why.
20.3 Newton–Raphson method
Bisection uses only the signs of f. Newton–Raphson uses its slope too. Near a root, a smooth curve looks almost like its tangent, and the tangent’s root is easy to find. So follow the tangent down to the X-axis, and take where it lands as the next guess.
The formula. Let x₀ be a guess near a root of f(x) = 0.
- The tangent at P(x₀, f(x₀)) has slope f′(x₀) Grade 11: Unit 18, 18.6.
- So its equation is y − f(x₀) = f′(x₀)(x − x₀) (the line through a point with a given slope).
- It meets the X-axis where y = 0: −f(x₀) = f′(x₀)(x − x₀).
- If f′(x₀) ≠ 0, divide: . Call that x₁, and repeat from it:
When Newton–Raphson fails
Bisection never fails once a root is trapped. Newton–Raphson can:
- A flat tangent. If , the tangent is parallel to the X-axis and never meets it: the formula divides by zero. Near such a point the tangent is almost flat, and the next guess is thrown far away.
- A cycle. For from x₀ = 0, the guesses go 0, 1, 0, 1, … for ever (short question 4 shows why), though there is a root near −1.77.
- Running away. For (root 0) from x₀ = 1.5, the guesses are −1.69, 2.32, −5.11, 32.3: each tangent lands farther out. From x₀ = 1 they close in (−0.571, 0.117, −0.001).
So start close: locate the root first with a sign change, and if the guesses jump about, go back to bisection for a few steps. A flat or near-flat start, or a root next to a turning point, is a bad start.
Running it on a computer
Both methods are a few lines of a program (Python, on this page) or a spreadsheet. In a spreadsheet, put 1 in A1, then in A2 =A1-(A1-COS(A1))/(1+SIN(A1)), and fill it down: each row is the next guess (spreadsheets use radians).
from math import cos, sin def f(x): return x - cos(x) def df(x): return 1 + sin(x) # Bisection on [0, 1]: f(0) < 0 < f(1)a, b = 0, 1for n in range<span class="lm-pt">(1, 21)</span>: c = (a + b) / 2 if f(a) * f(c) < 0: b = c else: a = cprint("Bisection, 20 steps:", c, "error at most", 1 / 2**20) # Newton-Raphson from x0 = 1, until two values agree to 1e-10x = 1for n in range<span class="lm-pt">(1, 21)</span>: new = x - f(x) / df(x) print(n, new, abs(new - x)) if abs(new - x) < 1e-10: break x = newTwenty halvings give 0.7390852 (error under 0.000001); Newton–Raphson gives 0.7390851332151607 in five.
Back to the loan
Exercise
Choose the correct option
The bisection method can be started on [a, b] when f is continuous there and:
Pick an answer to see why.
The Newton–Raphson formula is:
Pick an answer to see why.
Which of these equations is transcendental?
Pick an answer to see why.
Bisection for starts on [1, 2]. After the first step the root is in:
Pick an answer to see why.
Newton–Raphson for f(x) = 0 fails at a step where:
Pick an answer to see why.
Two successive Newton–Raphson values are x₃ = 1.41422 and x₄ = 1.41421. The approximate error of x₄ is:
Pick an answer to see why.
After 5 steps of bisection that started on [2, 3], the error of the midpoint is at most:
Pick an answer to see why.
One step of Newton–Raphson for from x₀ = 2 gives:
Pick an answer to see why.
To find a root trapped in [0, 1] with error less than 0.01, bisection needs at least:
Pick an answer to see why.
Newton–Raphson applied to (a > 0) gives the rule:
Pick an answer to see why.
Bisection is used on tan x = 0 with [1, 2] (tan 1 > 0, tan 2 < 0). The midpoints close in on:
Pick an answer to see why.
Short questions
Show that has a root between 2 and 3, and find it correct to two decimal places by bisection. (5 marks)
Hint
Answer
Find the root of correct to four decimal places by Newton–Raphson, starting from x₀ = 2.5. (5 marks)
Hint
Answer
- a.Show that Newton–Raphson for is . (2 marks)
- b.Use it to find correct to four decimal places, from x₀ = 2.5. (3 marks)
Answer
.
- a.Show that Newton–Raphson from x₀ = 0 never reaches a root. (2 marks)
- b.Find the root correct to three decimal places, starting from x₀ = −2. (3 marks)
Answer
- a.An interval of width 1 traps a root. How many bisection steps make the error less than 0.00005 (four decimal places)? (2 marks)
- b.Newton–Raphson for from x₀ = 0.5 gives 0.566311, 0.567143, 0.567143. Find the approximate error and the relative approximate error of each step, and say which method you would use and why. (3 marks)
Answer
Long question
NEB’s grid gives this area no long question; this one joins the unit’s methods for practice.
The equation 3x − cos x − 1 = 0 (x in radians).
- a.Show that it has a root in (0, 1). (1 mark)
- b.Do four steps of bisection, and give the interval the root is in and the greatest possible error. (3 marks)
- c.Find the root correct to four decimal places by Newton–Raphson from x₀ = 0.5. (3 marks)
- d.Compare the two methods’ approximate errors. (1 mark)
Answer
Project work
Printable PDFs
- Study notes 2 pages
- Worksheet 4 pages Answer key
- Harder practice questions 2 pages Answer key
Practice every question in the book, and keep track of the ones you miss →
Where these facts come from
- Excel’s RATE function “is calculated by iteration”, and gives up with #NUM! if successive results don’t agree within 0.0000001 after 20 iterations (the opening, Example 4): Microsoft Support, “RATE function”, read November 2026.
- Newton’s example in the Method of Fluxions (written 1671, printed 1736); Raphson’s Analysis aequationum universalis (1690) and the Royal Society’s minutes of 17 December 1690, “doubles the known figures of the Root” (20.3): MacTutor, “Joseph Raphson”; Simpson’s general form (1740), and the cycle of from 0: Wikipedia, “Newton’s method”, History and Oscillatory behavior, read November 2026.
- Abel’s proof (1824) that equations of degree five and more have no general formula in radicals (20.1): MacTutor, “Niels Henrik Abel”.
- The methods and their errors checked against OpenStax, Calculus Volume 1, 4.9 “Newton’s Method”, which lists the flat tangent and the cycle of from 0 (CC BY 4.0); the run-away of is our own working.
- The unit’s items and project work: CDC, Secondary Education Curriculum 2078, Mathematics, Grades 11–12, 7.1 and sample project 16; the marks: CDC, Specification Grid 2078, Mathematics, Grade 11.
Found a mistake? Please tell us.
