Вы находитесь на странице: 1из 40

Chapter 2 Root Approximation

Section 1 Introduction
Section 2 Bisection method
Section 3 Simple Iterative Method
Section 4 Newton Iterative Method
Section 5 Secant method

Section 1 Introduction
Many problems in the science and engineering can be solved
by equation of one variable, namely f(x)=0.
The root of equation is also called the zero point of function.
There may be real roots and complex roots, and we just focus
on real roots.

Section 1 Introduction
General solution exists for equations such as
ax2 + bx + c = 0
The quadratic formula provides a quick answer to all
quadratic equations.
However, exact analytic solutions (formulas) dont exist for
some equations, such as those where the variables are in the
exponent, logarithm and trigonometric function.

Section 1 Introduction
1 Three steps to find the roots of an equation
(1)Check root existence
(2)Estimate root interval
(3)Get the accurate root

Section 1 Introduction
2 Estimate the root interval
1 construction of graph
Sketch the figure of y=f(x), then check where the curve intersect the horizontal
axis , by doing so we can get the root interval.
Separate f(x) into two parts, g1(x)=g2(x), and draw their curves in the same
coordinate system, and estimate the root interval by checking where they intersect
each other.

Section 1 Introduction
2 Step-by-step searching
For equation f(x)=0
Ascertain the root interval [a, b]
Select the step h=(b-a)/n, and get points xk=a+kh(k=0,1,,n)
Compute the value f(xk), the root interval [a, b] can be decided according to the
the sign of f(xk)
x3 x 1 0
x
0

0.5

1.5

2.0

f(x)

-1

-1.375

-1

0.875

sign

If n is large enough we can get the approximated root with any accuracy. But the
computing task may be too heavy, and hence this method is not a good solution.

Section 2 Bisection Method


1 the steps of bisection method
compute the midpoint of interval [a, b], namely x1 =(a+b)/2
(1) if f(x1)=0, x1 is the root of equation f(x)=0.

Section 2 Bisection Method


1 the steps of bisection method
(2) if f(a)*f(x1)<0, the root x* (a, x1), so set a1=a,b1= x1,
or x* (x1,b), set a1=x1, b1=b. The new interval is [a1,b1] with the
length half of interval [a, b].
(3) continue until n steps

Section 2 Bisection Method


after n steps, we can get a series of decreasing intervals
[a,b],[a1,b1], ..., [an, bn], , with the following relationship
[a, b] [a1 , b1 ] [a2 , b2 ] [an , bn ]
The length of each interval is the half of its previous one, so
the length of [an, bn] is:

bn an (b a) / 2n
When n , the intervals converge to one point, namely
the root.

Section 2 Bisection Method


2 application in practice
Suppose the midpoint of interval [ak,bk] is the approximated
root, we have the following root series:

x0 , x1 , x2 , , xk ,
For the given error limit , if the following requirement is met,

1
x xk (bk ak )
2
*

xk=(ak+bk)/2 will be the final root equation.

Section 2 Bisection Method


3 step numbers

ba
bk ak bk ak k
2
1
*
x xk (bk ak )
2
accuracy

ba
ba
k log 2 (
)
k 1
2
2
ln( b a) ln( 2 )
k
ln 2

Section 2 Bisection Method


4 example
example 1: compute the root of the equation

x 3 4 x 2 10 0

using bisection method. Interval (1,2) absolute error limit is 0.5 10 2


Solution

f(1)=-5<0

interval

midpoint xn

f(2)=14>0

-(1,2)+

x0 1.5

f(1.5)>0

(1,1.5)

x1 1.25

f(1.25)<0

(1.25,1.5)

x2 1.375

f(1.375)>0

(1.25,1.375)

x3 1.313

f(1.313)<0

(1.313,1.375)

x4 1.344

f(1.344)<0

(1.344,1.375)

x5 1.360

f(1.360)<0

(1.360,1.375)

x6 1.368

f(1.368)>0

(1.360,1.368)

x7 1.364

Section 2 Bisection Method

x* x7 1.364
1
1
| x x | (1.368 1.360) 0.004 10 2 (Afterwards estimate )
2
2
*

Prior estimate:

n7

ba 1
x x n 1 10 2
2
2
*

Section 2 Bisection Method


5 computing procedure for bisection method
(1) Estimate the root interval [a, b] of equation f(x)=0 and compute the
value of f(a) and f(b).
(2) Calculating the midpoint value f((a+b)/2)
(3) Three possibilities:
if f((a+b)/2)=0 then (a+b)/2 is the root end
if f((a+b)/2)*f(a) <0, then root lies in (a, (a+b)/2), b = (a+b)/2
if f((a+b)/2)* f(b)<0, then root lies in ((a+b)/2, b), a = (a+b)/2
(4) if b a , stop calculation and get the root x*=(a+b)/2 else go to
step (2)

Section 2 Bisection Method


6 advantages and disadvantages
Advantages
Simple and easy for programming
Able to capture the root even in big interval
Disadvantages
Slow convergence rate
Possible failure to get repeatted roots, i.e., (x-1)2=0

Section 3 Simple Iterative Method


1 Procedure
Given root interval [a, b] for equation f(x)=0, the simple iterative method consists
of the following steps:
(1) Rewrite the equation in a form

x (x)

(2) Select a point x0 in [a, b] as initial value, and substitute x0 into the right side of
formula (1) to get a new approximation:

x1 ( x0 )

Section 3 Simple Iterative Method


(3) Continuously substitute the new approximated x into the formula (1) for a
further approximation

x2 ( x1 )

xn ( xn 1 )

(4) After n steps we can get a series


to some point, it will be the root.

x1 , x2 ,, xn . If this series can converge

Section 3 Simple Iterative Method


2 some concepts
1 iterative function

(x)

2 iterative formula

x (x )

3 convergence and divergence


Only if the series
method diverges.

xn

converge this method can find the root, or the

Section 3 Simple Iterative Method


3 example
1 equation

2 x3 x 1 0

Calculate the root in [0, 1.5]


solution

Method 1 get the iterative formula


assuming

Iteration procedure

x 2x 3 1

x0 0
x0 0
x1 2x03 1 1

x2 2x13 1 3
x3 2x23 1 55

divergence

Section 3 Simple Iterative Method


Method 2
get the iterative formula
assuming

x3

x0 0

x1
2

x0 0
Iteration procedure

And so on:
x3 = 0.9940
x4 = 0.9990
x5 = 0.9998
x6 = 1.0000
x7 = 1.0000

x1 3

1
x0 1
0.7937
3
2
2

x2

x1 1 3 1.7937
0.9644
2
2

What kinds of iteration


formula can converge?
convergence
For the same equation, different iteration
formula get different results.

Section 3 Simple Iterative Method


4 convergence theorem for iterative method

Assume the iteration function (x ) satisfies the following two points:


(1)for all x in [a, b], that is
(2)For any

x [a, b], a ( x) b

x [a, b], there exists a positive constant L<1


( x) L 1

then
iteration process x

k 1

( xk )

converge to the root x* of equation

, for any numberx

x (x)

absolute error is

x * xk

1
xk 1 xk
1 L

[ a, b]

, all

Section 3 Simple Iterative Method


Proof
Lagrange Mean Value Theorem assume the f(x) satisfies
be continuous on the closed interval [a,b]
exist difference coefficient in the open interval (a,b)
We have

f ( )

convergence

f (b) f (a) , where (a, b)


ba

Based on the iteration formula

xk 1 ( xk ),

we can get

x* xk ( x* ) ( xk 1 )
( k )( x* xk 1 )
L x* xk 1

Lagrange Mean Value


Theorem
term 2

Section 3 Simple Iterative Method

x* xk L x* xk 1
x* xk L x * xk 1

And so on

L2 x * xk 2

Lk x * x0
Because

L 1, lim ( x * xk ) 0
k

Conclusion
For any

x0 [a, b] iterative method xk 1 ( xk ) converges to x *

Section 3 Simple Iterative Method


Prove the absolute error
Based on the proved convergence, we have the inequation

x* xk L x* xk 1
x* xk 1 L x * xk

x* xk x * xk 1 xk 1 xk

substitute

x * xk 1 xk 1 xk

x* xk L x* xk xk 1 xk
1
x xk
xk 1 xk
1 L
*

conclusion

Section 3 Simple Iterative Method


Conclusions
as long as the iteration function satisfies

'( x) L 1
xk 1 ( xk ) will converge.
Give the required error
Based on the theorem

namely | x* xk |
1
xk xk 1
1 L

xk xk 1 (1 L)

xk

can be the approximate root

iteration terminal
criterion

Section 3 Simple Iterative Method


Example 1

2 x3 x 1 0
solution: two forms of iteration function

(1)

x 2 x 3 1 1 ( x)

(2)

divergence

x 1
2( x), 2( x) 1, x 0,1
2
convergence

Section 3 Simple Iterative Method


Example 2 required error 0.510-6, root interval (0, 0.2)

e x 10 x 2 0
solution:

two forms of iteration function

2 e
x 1( x )
10

x 2( x ) ln(2 10x )

ex
1
1 '( x)
10

2 '( x)

10
5
2 10 x

2 ex
Selected iteration function should be ( x )
10

Section 3 Simple Iterative Method

2 ex
xk 1
10

x0 0
2 e x0
x1
0.1
10
x1 = 0.1000000
x2 = 0.0894829
x3 = 0.0906391
x4 = 0.0905126
x5 = 0.0905265
x6 = 0.0905250
x7 = 0.0905251

d1= x1-x0 = 0.1000000


d2= x2-x1 = -0.0105171
d3 = 0.1156e-002
d4 = -0.1265e-003
d5 = 0.1390e-004
d6 = -0.1500e-005
d7 = 0.1000e-006

Since |d7| =0.1000e-006<0.5e-6


So the root of the equation is

x*x7 = 0.090525

Section 4 Newton Iterative Method


1. Newton iterative method process
Assume xk is an approximate root of equation f(x)=0, Taylor expansion
about xk is:

f ( xk )
f ( x ) f ( xk ) f ' ( x k ) ( x x k )
( x xk ) 2
2!
f ( xk ) f ' ( x k ) ( x x k )
f(x)=0 can be approximated as f(xk)+ f(xk)(x-xk)=0
Extract x from the above formula and denoted as xk+1 , that is

x k 1 xk

f ( xk )
f ' ( xk )

(k 0,1,...)

f ( x)
( x) x
f ( x)

Newton
iteration
formula

Newton
iteration
function

Section 4 Newton Iterative Method


2. Geometry meaning of Newton iterative method
The tangent of f(x) at xn is:

y f ( xn ) f ' ( xn ) ( x xn )
The intersection point with the horizontal axis will be
xn+1 for the next iteration, namely:

x n1 xn

f ( xn )
f ' ( xn )

tangent

Section 4 Newton Iterative Method


3. Example
calculate the root near x=0.5 of

x e x

Solution: Rewrite the equation as


Hence

f ( x) xe x 1

Newtons iteration formula is

xe x 1 0

xk e xk
xk 1 xk
1 xk

Suppose x0 0.5, the iteration results are as following

x*

0.5

0.57102

0.56716

0.56714

|xk-xk-1|

0.07102

0.00386

0.00002

Section 4 Newton Iterative Method


4. Advantages and disadvantage
Advantages
Convergent fast.
Starting point can be arbitrary.

Disadvantage
Every iteration needs to compute the value of f(x) and the gradient
f(x), the computing load may be large

Section 5 Secant Method


1. Simplified Newton iteration method
Newton iterative method

f ( xk )
xk 1 xk
f ( xk )

Every iteration needs f (xk)


Fix x0 instead of xk for the first derivative f(xk) , then we get

f ( xk )
xk 1 xk
f ( x0 )

The accuracy will slightly lower

Section 5 Secant Method


2. The secant method
Use difference quotient instead of f(xk) in Newton iterative formula

f ( xk ) f ( xk 1)
f ( xk )
xk xk 1
xk 1 xk

f ( xk )
f ( xk )

f ( xk )
xk 1 xk
( xk xk 1 )
f ( xk ) f ( xk 1 )

Section 5 Secant Method


3. Geometry meaning

The slope of line AB :

f ( xk ) f ( xk 1 )
K AB
xk xk 1
f ( xk ) f ( xk 1 )
tan
xk xk 1

xk 1

f ( xk )
xk
( xk xk 1 )
f ( xk ) f ( xk 1 )
xk cot . f ( xk )

y f (x )

xk 1

xk 1

x*

xk

Section 5 Secant Method


4. Example 1
Equation:

x e x

solution

f ( x) xe x 1 0

x0 0.5, x1 0.6

then the results of secant iteration method are as follows

xk

0.5

0.6

0.56532

0.56710

0.56714

|xk-xk-1|

0.00178

0.00004

The secant method may converge more slowly than Newton iterative
method.

Section 5 Secant Method


Example 2: Use the simplified Newton method, secant method and Newton
method to compute the root of equation x 3 3x 1 0
Solution:

f ( x) x 3 3x 1
Simplified Newton method

Secant method

Newton method

f ( x ) 3x 2 3

f ( xk )
xk3 3xk 1
xk 1 xk
xk
f ( x0 )
3x02 3

f ( xk )
xk 1 xk
( xk xk 1 )
f ( xk ) f ( xk 1 )
f ( xk )
xk3 3xk 1
xk 1 xk
xk
f ( xk )
3xk2 3

Section 5 Secant Method


Simplified Newton
x0= 0.5
x1= 0.3333333333
x2 = 0.3497942387
x3 = 0.3468683325
x4 = 0.3473702799
x5 = 0.3472836048
x6 = 0.3472985550
x7 = 0.3472959759
x8 = 0.3472964208
x9 = 0.3472963440
x10 = 0.3472963572
x11 = 0.3472963553

Secant method

x0=0.5
x1=0.4
x2 = 0.3430962343
x3 = 0.3473897274
x4 = 0.3472965093
x5 = 0.3472963553
x6 = 0.3472963553
Accuracy 0.5*10-8
Simplified Newton: 11 times
Secant method: 5 times

Newton method: 4 times

Newton method
x0 =0.5
x1 =0.3333333333
x2 =0.3472222222
x3 =0.3472963532
x4 =0.3472963553
Convergence speed
Newton method
>
Secant method
>
Simplified
Newton method

Brief Summary
1 Bisection method
2 Simple iterative method
3 Newton iterative method
4 Secant method

Mathematical phrases

Вам также может понравиться