Nota PDF Bab 2
Nota PDF Bab 2
Example:
Given a system of response following the function f ( x ) = x 4 − x − 3 . Find
the zero of the system in range [1.3,1.6] using Bisection method. Iterate until
the tolerance error ε ≤ 0.005 .
Solution:
f (1.3) = −1.4439, f (1.6) = 1.9536 Since f (1.3) f (1.6) < 0 , so there is a root
in the interval [1.3,1.6]
a) Bisection Method:
** Calculator Formula: C = ( A + B ) / 2 : C 4 − C − 3 : C − B CALC
Iteration a c b f(c) |error|
0 1.3 ( A ) 1.45 ( C ) 1.6 ( B ) -0.0295 0.15
1 1.45 1.525 1.6 0.8835 0.075
2 1.45 1.4875 1.525 0.4083 0.0375
3 1.45 1.4688 1.4875 0.1849 0.0188
4 1.45 1.4594 1.4688 0.0769 0.0094
5 1.45 1.4547 1.4594 0.0234 0.0047
At the first step, since f ( a ) f ( b ) < 0 , then set a1 = a and b1 = c . Hence the The predicted zero (root) is x = 1.4547 .
b) Secant Method: c) Newton-Raphson Method
Secant method is another iterative method to approximate the root of a Newton-Raphson method is another iterative method to approximate the root of
non-linear equation f ( x ) = 0 by repeatedly finding a secant line of a non-linear equation f ( x ) = 0 by repeatedly finding a tangent line (or slope/
equation f ( x ) = 0 . the first derivative) of equation f ( x ) = 0 .
Finding a secant line that passes through two points of Finding a tangent line that passes through a point of ( x0 , f ( x0 ) ) gives
( x0 , f ( x0 ) ) , ( x1, f ( x1 ) ) gives y − f ( x0 ) = f ' ( x0 )( x − x0 )
f ( x1 ) − f ( x0 ) Since the tangent line intercept x-axis at ( x1 , 0 ) , the tangent line between
y − f ( x0 ) = ( x − x0 ) .
x1 − x0
0 − f ( x0 ) = f ' ( x0 )( x1 − x0 )
Since the secant line intercept x-axis at ( x2 , 0 ) , the secant line becomes
f ( x0 )
f ( x1 ) − f ( x0 ) Solving for x1 , we get x1 = x0 − .
0 − f ( x0 ) = ( x2 − x0 ) f ' ( x0 )
x1 − x0
Notice that with x0 , we can get x1 . Then with x1 , we can get x2 as
x0 f ( x1 ) − x1 f ( x0 )
Solving for x2 , we get x2 = f ( x1 )
f ( x1 ) − f ( x0 ) x2 = x1 −
f ' ( x1 )
Notice that with x0, x1 , we can get x2 . Then with x1 , x2 , we can get x3 as
Hence in general, we get the solution of non-linear equation f ( x ) = 0 via
x1 f ( x2 ) − x2 f ( x1 )
x3 = . Newton-Raphson method, also known as Newton’s method which is given by
f ( x2 ) − f ( x1 ) f ( xi )
xi +1 = xi − , i = 0,1, 2,…
Hence in general, we get the solution of non-linear equation f ( x ) = 0 by f ' ( xi )
secant method which is given by
x f ( xi +1 ) − xi +1 f ( xi )
xi + 2 = i , i = 0,1, 2,…
f ( xi +1 ) − f ( xi )
Example: Example:
Given the equation of f ( x ) = x − 5 . Approximate the root of the non- Given the equation of f ( x ) = x 2 − 5 . Approximate the root of the non-
2
equation by using Secant method. Start with the interval [ 2,3] . Iterate until equation by using Newton-Raphson method. Use x0 = 2 . Iterate until
f ( xi ) < ε = 0.0005 . Use 4 decimal places in your calculation. f ( xi ) < ε = 0.0005 . Use 4 decimal places in your calculation.
Solution:
Let set [ x0 , x1 ] = [ 2,3] Solution:
1. f ( x ) = x 2 − 5 , f ' ( x ) = 2 x
** Calculator Formula: E = ( AD − BC ) / ( D − C ) : E 2 − 5 CALC
2 ** Calculator Formula: D = A − ( B / C ) : D 2 − 5 : 2 D CALC
Iteration x f(x)
2 ( A) -1 ( C ) iteration x f(x) f'(x)
0
0 2 ( A) -1 ( B ) 4 (C )
1 3 ( B) 4 ( D)
1 2.25 ( D ) 0.0625 4.5
2 2.2 ( E ) -0.16
2 2.2361 0.0002 4.4722
3 2.2308 -0.0237
3.Since f ( x2 ) = 0.0002 < ε = 0.0005 , the positive root of x 2 − 5 = 0 is
4 2.2362 0.0004
Since f ( x4 ) = 0.0004 < ε = 0.0005 , the positive root of x 2 − 5 = 0 is approximately x2 = 2.2361 .
approximately x4 = 2.2362 .