Lecture 5
Lecture 5
Zhenhua Wang
U Michigan
1 / 18
1 Solving equations
Definition 1.1
The function f (x) has a root at x = r if f (r) = 0.
2 / 18
1.1 The bisection method
Figure: f (x) = x3 + x 1
3 / 18
1.1 The bisection method
• By repeating the bisection step, we can make the interval containing the
4 / 18
1.1 The bisection method
Example 1.1
Find the root of x3 + x 1 = 0 on the interval [0, 1]
5 / 18
1.1 The bisection method
Example 1.1
Find the root of x3 + x 1 = 0 on the interval [0, 1]
5 / 18
1.1 The bisection method
Example 1.1
Find the root of x3 + x 1 = 0 on the interval [0, 1]
5 / 18
1.1 The bisection method
Example 1.1
Find the root of x3 + x 1 = 0 on the interval [0, 1]
5 / 18
1.1 The bisection method
6 / 18
1.1 The bisection method
7 / 18
1.1 The bisection method
Definition 1.3
A solution is correct within p decimal places if the error is less than
0.5 ⇥ 10 p .
Example 1.2
How many steps of the Bisection Method is needed to find a root of
f (x) = cos x x in the interval [0, 1] to within six correct places?
.
fo I o flD cost 1 so
b least so
nft.sn
lbz eo 5xIo At step
zine lot
I 3 06 logzhi.zpp
log.ph 8 / 18
og
1.2 Fixed-point iteration
Motivation: input
trap output
• Use a calculator (make sure it is in radian mode) to apply cos(·) function
successively to an arbitrary starting number
• The resulting sequence converges to 0.7390851332
• This is an example of using the Fixed-Point Iteration (FPI) method to get
one solution to the equation
cos(x) = x.
Definition 1.4
The real number r is a fixed point of the function g if g(r) = r.
9 / 18
1.2 Fixed-point iteration
The Fixed-Point Iteration Algorithm:
x0 initial guess;
for i = 1, 2, . . . , N do
xi g(xi 1 );
end
return xN
That is,
x1 = g(x0 )
x2 = g(x1 )
x3 = g(x2 )
···
10 / 18
1.2 Fixed-point iteration
• FPI can solve the fixed-point problem, how about finding a root?
1 + 2x3 1 + 2x3
3. x = (add 2x to x + x = 1) with g(x) =
3 3
1 + 3x2 1 + 3x2
• Will FPI have the same performance for all these choices? Or will the
choice matter?
11 / 18
1.2 Fixed-point iteration
• Recall that the bisection algorithm found the approximate root of 0.682
after 9 iteration
.
• FPI for x = g(x) = 1 x3 does not even converge!
12 / 18
1.2 Fixed-point iteration
• Recall that the bisection algorithm found the approximate root of 0.682
after 9 iteration
. p
• FPI for x = g(x) = 3
1 x converges, but slower than the bisection
method
13 / 18
1.2 Fixed-point iteration
• Recall that the bisection algorithm found the approximate root of 0.682
after 9 iteration
. 1 + 2x3
• FPI for x = g(x) = converges very fast!
1 + 3x 2
14 / 18
1.2 Fixed-point iteration
15 / 18
1.2 Fixed-point iteration
15 / 18
1.2 Fixed-point iteration
15 / 18
1.2 Fixed-point iteration
15 / 18
1.2 Fixed-point iteration
15 / 18
1.2 Fixed-point iteration
15 / 18
1.2 Fixed-point iteration
Geometry of FPI:
. p
x = g(x) = 3 1 x
16 / 18
1.2 Fixed-point iteration
Geometry of FPI:
. p
x = g(x) = 3 1 x
16 / 18
1.2 Fixed-point iteration
Geometry of FPI:
. p
x = g(x) = 3 1 x
16 / 18
1.2 Fixed-point iteration
Geometry of FPI:
. p
x = g(x) = 3 1 x
16 / 18
1.2 Fixed-point iteration
Geometry of FPI:
. p
x = g(x) = 3 1 x
16 / 18
1.2 Fixed-point iteration
Geometry of FPI:
. 1 + 2x3
x = g(x) =
1 + 3x2
17 / 18
1.2 Fixed-point iteration
18 / 18