Chapter 2. Solutions of Equations in One Variable
Chapter 2. Solutions of Equations in One Variable
SOLUTIONS OF EQUATIONS
IN ONE VARIABLE
Bisection method (I)
f(b)
a b
f(a)
f(b)
p3
a p2 p1 b
f(a)
p
Bisection method (IV)
Algorithm
1. We let a1 = a and b1 = b; then compute the value of f at
p1 = (a1 + b1 )/2.
f(b)
a4 b4
a3 b3
a2 b2
a1 p3 b1
a p2 p1 b
f(a)
p
Bisection method (VI)
Pseudo code: We carry the algorithm out until |an − bn |/2 < ε
Example:
Find the root of f (x) = x 2 − 2 in (0, 2).
|a1 − b1 | = |a − b|
|a1 − b1 | |a − b|
|a2 − b2 | = =
2 2
|a2 − b2 | |a − b|
|a3 − b3 | = =
2 4
...
|an−1 − bn−1 | |a − b|
|an − bn | = = n−1
2 2
Note that the root p is always in [an , bn ], so with pn = 12 (an + bn ):
|pn − p| ≤ 12 (bn − an ) = 21n (b − a).
Bisection method (X)
b−a |an − bn |
= < ε,
2n 2
so
|pn − p| < ε.
To achieve this, we need ln(b − a) − n ln 2 < ln ε, i.e.
ln(b − a) − ln ε
n> .
ln 2
Bisection method (XI)
We should have
We need 11 iterations.
Fixed-point iteration (I)
y=x
y
b Proof Consider h(x) = g (x) − x.
g(b) Then h(a) = g (a) − a ≥ 0 and
g(p) h(b) = g (b) − b ≤ 0
g(a) so from the intermediate value theo-
rem, h has a zero p in [a, b], at which
a
g (p) = p.
a p b x
Fixed-point theorem (III)
Proof Assume that g has two fixed points p and q. From the
Mean value theorem (see calculus), we can find a value ξ such that
g (p) − g (q)
= g ′ (ξ).
p−q
Thus
p1 = g (p0 ),
p2 = g (p1 ),
...,
pn = g (pn−1 ),
...
y y=x
p1=g(p0)
p2=g(p1)
p3=g(p2)
p p3 p2 p1 p0 x
Fixed-point iteration (VII)
y=g(x)
y y=x
p3=g(p2)
p2=g(p1)
p1=g(p0)
p=g(p)
p p0 p1 p2 p3 x
Fixed-point iteration (VIII)
lim |pn − p| = 0.
n→∞
Fixed-point iteration (X)
Example:
The equation f (x) = x 3 + 4x 2 − 10 = 0 has a unique root
p = 1.365230013 in [1, 2].
x 2 (x + 4) = 10,
so 10 1/2
x= = g2 (x). (2)
4+x
We find a fixed point of g2 . Take p0 = 1.5.
The scheme converges after 15 iterations. Why is it faster?
Fixed-point iteration (XIII)
3
g1′ (x) = − x 2 (10 − x 3 )−1/2 ,
4
which is negative on [1, 2] so g1 (x) is decreasing on [1, 2].
x 3 + 4x 2 − 10
x =x− = g (x).
3x 2 + 8x
We find the fixed point of g (x). Take p0 = 1.5. The scheme
converges after only 4 iterations.