MATH231
Tutorial
utorial note 1
1. Root finding
For any functionfx: , a root of f is a value p such that f ( p ) = 0 . p is also
called the zero of the function f.
It is impossible
possible to obtain the exact root(s) of many functions using algebraic methods,
met
e.g. f ( x) = cos x − x . Hence numerical methods are used to obtain the approximate
roots of this type of functions. In the following tutorials, the following methods will
be discussed:
(1) Bisection method;
(2) Fixed-point
point iteration;
(3) Newton’s method; and
(4) Secant method.
2. Bisection method
Suppose f is a continuous function defined on the interval [a,b], with f (a ) and f (b) of
opposite sign (i.e. either f (a ) < 0 < f (b) or f (b) < 0 < f (a ) ). By a theorem (which
theorem?), there exist a number p in (a,b) with f ( p ) = 0 . To find an approximated
value of p, we can use the following process:
(1) Let a1 = a and b1 = b .
an + bn
.
2
(3) Check whether f ( pn ) = 0 , if yes, stop and p = pn .
(2) Let pn =
(4) If f ( pn ) has the same sign with f (a ) , let an +1 = pn and bn +1 = bn ; otherwise
an +1 = an and bn +1 = pn .
(5) Repeat steps (2) to (4).
MATH231 Tutorial note 1
1
Theorem 2.1
Suppose that f ∈ C[a, b] and f (a ) ⋅ f (b) < 0 . The Bisection method generates a
sequence p1 , p2 , p3 ,... converging to a zero p of f with
pn − p ≤
b−a
,
2n
when n ≥ 1 .
Proof
See the textbook p.49.
Example 1
Use the Bisection method to find p3 for cos x − x = 0 on [0,1].
Solution
Let f ( x) = cos x − x , then f (0) = 1 > 0 and f (1) = cos 1 − 1 < 0 .
p1 =
0 +1
= 0.5 , f (0.5) = cos 0.5 − 0.5 = 0.37758 > 0 .
2
p2 =
0.5 + 1
= 0.75 , f (0.75) = cos 0.75 − 0.75 = −1.8311× 10−2 < 0 .
2
∴ p3 =
0.5 + 0.75
= 0.625 .
2
Remark
Example 1 can be solved by constructing a table also:
Let f ( x) = cos x − x .
n
an
bn
pn
f (an )
f ( pn )
f (bn )
1
0
1
0.5
+
+
–
2
0.5
1
0.75
+
–
–
3
0.5
0.75
0.625
+
+
–
Hence p3 = 0.625 .
Example 2
Use the Bisection method to find a solution accurate to within 10−2 for 3 x − e x = 0
on [1,2].
Solution
Let f ( x) = 3 x − e x .
n
an
bn
pn
f (an )
f ( pn )
f (bn )
1
1
2
1.5
+
+
–
2
1.5
2
1.75
+
–
–
3
1.5
1.75
1.625
+
–
–
MATH231 Tutorial note 1
2
4
1.5
1.625
1.5625
+
–
–
5
1.5
1.5625
1.53125
+
–
–
6
1.5
1.53125
1.515625
+
–
–
7
1.5
1.515625 1.5078125
+
–
–
Since p7 − p6 = 7.8125 ×10−3 < 10−2
Hence p = 1.5078.
Remark
We can try to figure out the number of iterations to ensure an approximation accurate
to within 10−2 by solving pn − p ≤ 2− n < 10−2 . However, it is important to realize
that Theorem 2.1 gives only a bound for approximation error and this bound may be
quite conservative.
Example 3
Find an approximation to 3 25 correct to within 10−4 using the Bisection Algorithm.
Solution
First of all, we need to find the continuous function f such that 3 25 is a zero of f.
f ( x) = x3 − 25 is one of the functions satisfied the requirement.
Also 2 ≤ 3 25 ≤ 3 .
If we solve f ( x) = 0 on [2,3] correct to within 10−4 using the Bisection method, then
the problem is done. (This part is left as an exercise.)
Finally we obtain p = 2.9240.
Example 4
π
Let f ( x) = tan x − 1 , we know that f = 3 − 1 > 0 and
3
3π
f
4
= −1 − 1 = −2 < 0 .
We generate the sequence p1 , p2 , p3 ,... using the “Bisection Algorithm”. The sequence
{ pn }∞n=1 converges to a certain number m. However m is not the zero of f. This is
π 3π
because f is not continuous on , . Hence we cannot apply the Bisection
3 4
π 3π
method to approximate the roots of f ( x) = 0 on , .
3 4
MATH231 Tutorial note 1
3
Exercise
(1) Use the Bisection method to find p4 for
ex
π
− tan x = 0 on 0, .
2
3
(2) Use the Bisection method to find a solution accurate to within 10−3 for
x − 2 − x = 0 on [0,1].
(3) Let f ( x) = ( x + 2)( x + 1) x( x − 1) 3 ( x − 2) . To which zero of f does the Bisection
method converge on the intervals (a) [–3,2.5], (b)[ –2.5,3], and (c) [–1.5,1.75]?
3. Fixed-Point iteration
A number p is a fixed-point of a function g if g ( p ) = p . For example, the function
f ( x) = x 2 − 2 for −2 ≤ x ≤ 3 has fixed points at x = –1 and x = 2.
Fixed point problems and root-finding problems are equivalent in the following sense:
given a root finding problem f ( p ) = 0 , we can define function g ( x) = x + f ( x) which
has the fixed point at p. Conversely, if the function g has a fixed point at p, then the
function f ( x) = x − g ( x) has a zero at p.
Theorem 2.2
(a) If g ∈ C[ a, b] and g ( x) ∈ [a, b] for all x ∈ [a, b] , then g has a fixed point in [a,b].
(b) If, in addition, g '( x) exists on (a,b) and a positive constant k < 1 exists with
g '( x) ≤ k for all x ∈ (a, b) , then the fixed point in [a,b] is unique.
Proof
See the textbook p.54.
We hope that the approximated value of p can be found by the following way:
(1) Guess an initial value p0 ;
(2) For n = 0, 1, 2, …, obtain the new value by the equation pn +1 = g ( pn ) .
(3) Repeat steps 2 until pn +1 ≈ pn and f ( pn +1 ) ≈ 0 .
If the sequence p1 , p2 , p3 ,... converges to p and g is continuous, then
(
)
p = lim pn = lim g ( pn −1 ) = g lim pn −1 = g ( p )
n →∞
n →∞
n →∞
and a solution to x = g ( x ) is obtained.
Q: How can we find a fixed-point problem that produces a sequence that reliably and
rapidly converges to a solution to a given root-finding problem?
MATH231 Tutorial note 1
4
Theorem 2.3 (Fixed-Point Theorem)
Let g ∈ C[ a, b] and g ( x) ∈ [a, b] for all x ∈ [a, b] . Suppose that g’ exists on (a,b) and
that a constant 0 < k < 1 exists with g '( x) ≤ k for all x ∈ (a, b) . Then for any
number p0 ∈ [a, b] , the fixed-point iteration of x = g ( x ) converges.
Proof
See the textbook p.59.
Corollary 2.4
If g satisfies the hypotheses of Theorem 2.3, then the bounds for error involved in
using pn to approximate p are given by
kn
pn − p ≤ k max{ p0 − a, b − p0 } and pn − p ≤
p1 − p0 for all n ≥ 1 .
1− k
n
Proof
See the textbook p.59.
Example 5
Use the fixed-point iteration method to determine a solution accurate to within 10−2
for x 4 − 3 x 2 − 3 = 0 on [1,2]. Use p0 = 1 . (Hint: Let g ( x) = (3x 2 + 3)1/4 .)
Solution
Let g ( x) = (3 x 2 + 3)1/ 4 and hence x = g ( x) .
Since g '( x) =
31/ 4
x
,. g is an increasing function as g '( x) > 0 for all
2
2 ( x + 1)3/ 4
x ∈ (1, 2) . 1 < g (1) < g (2) < 2 . Also g '( x) ≤ 6−1/ 2 < 1 for all x ∈ (1, 2) (why?).
By theorem 2.3, the fixed-point iteration of x = g ( x) converges.
p = 3 × 1 + 3/ = 6/ = 1.5651
p = 3 × 1.5651 + 3/ = 1.7936
p = 3 × 1.7936 + 3/ = 1.8859
…
p = 1.9375
p = 1.9433
|p − p | = 5.8094 × 10" < 10"
Hence p6 = 1.94332 is the required answer.
MATH231 Tutorial note 1
5
Example 6
Given x = 0.5(sin x + cos x) , determine an interval [a,b] on which the fixed-point
iteration will converge.
Solution
If we find an interval [a,b] that satisfies the conditions in Theorem 2.3, then the
problem is solved.
Let g ( x) = 0.5(sin x + cos x) .
Since g ( x) = 0.5(sin x + cos x) =
Hence g ( x) ≤
1
π
π
1
π
(cos sin x + sin cos x) =
sin x + .
4
4
4
2
2
1
for all x.
2
1 1
We choose −
,
as the target interval. It is necessary to check whether there
2 2
1 1
is a constant k and g '( x) ≤ k < 1 for all x ∈ −
,
.
2 2
1
π
1
1 1 1 1
cos x + ≤
< 1 for all x ∈ −
,
,
, −
is the
4
2
2
2 2 2 2
interval we want.
Since g '( x) =
Example 7
Let g ∈ C1[a, b] and p be in (a,b) with g ( p ) = p and g '( p ) > 1 . Show that there
exists a δ > 0 such that if 0 < p0 − p < δ , then p0 − p < p1 − p .
Solution
Let h( x) = g '( x) − 1 and h is continuous on [a,b]. Since h( p ) > 0 , there is
an
interval I = ( p − δ , p + δ ) with δ > 0 such that h( x) > 0 for every x ∈ [a, b] ∩ I
(why?). Therefore g '( x) > 1 for every x ∈ [a, b] ∩ I .
Suppose 0 < p0 − p < δ ,
p1 − p = g ( p0 ) − g ( p)
= g '( x0 ) p0 − p
for some x0 between p0 and p
As x0 ∈ [a, b] ∩ I , g '( x0 ) > 1 and p1 − p > p0 − p .
MATH231 Tutorial note 1
6
Remark
If g '( p ) > 1 , no matter how close the interval approximation p0 is to p, the next
iterate p1 is farther away. The fixed point iteration does not converge if p ≠ p0 .
Exercise
(4) Use the fixed-point iteration method to find p4 for x = cos x on [0,1].
(5) Use the fixed-point iteration method to determine a solution accurate to within
10−2 for x 2 = 3 on [1,2]. Use p0 = 1 . (Hint: Let g ( x ) = x −
x2
+ 1 .)
3
4. Appendix
Theorem (Intermediate Value Theorem)
If $: [&, (] is continuous and the y0 is between f(a) and f(b) inclusive, then
there is (at least one) x0 ∈ [a, b] such that f ( x0 ) = y0 .
Theorem (Nested Interval Theorem)
∞
If I n = [an , bn ] is such that I1 ⊇ I 2 ⊇ I 3 ⊇ ... , then
II
n
= [a, b] , where
n =1
∞
a = lim an ≤ lim bn = b . If lim(bn − an ) = 0 , then
n →∞
n →∞
n →∞
II
n
contains exactly one number.
n =1
Theorem (Mean-Value Theorem)
Let f be continuous on [a,b] and differentiable on (a,b). Then there exists x0 ∈ ( a, b)
such that f (b) − f (a) = f '( x0 )(b − a ) .
MATH231 Tutorial note 1
7
© Copyright 2026 Paperzz