Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CHAPTER 1
NONLINEAR EQUATIONS
2
1.1 Introduction
In this chapter, we will learn how to find the root(s) of a non-linear
equation.
Root/Solution/Zeroes: the value which, substituted in an
equation, satisfies the equation.
Example 1: y = x 2 − 4.
From the graph, the roots of y are -2 and 2.
In real applications, it is not always easy to draw the graph to locate
the roots. However, we can always find the interval [a, b] where the
roots lie.
Steps:
1. Breaking the original equation into few equations.
2. Draw the graphs.
3. Identify the intersection points.
4. Determine the interval.
3
Example 2:
2
Find the interval [a, b] where the roots for y = x − x − 3 lie.
Step 1: Breaking the original equation into few equations.
Set y = 0.
x2 − x − 3 = 0
x2 = x + 3
Set y1 = x 2 and y2 = x + 3
Step 2: Plot y1 and y2.
Step 3: Identify the intersection points.
Step 4: Determine the intervals.
∴ x*∈[2,3] and [-2,-1].
4
1.2 Intermediate Value Theorem (IVT)
• to verify the existence of the roots.
Theorem:
If f ( x) ∈ C [a, b] and K is any number between f (a) and
f (b) where f (a) f (b) <0, then there exist a number c in
[a,b] for which f (c) = K .
f (a)
K
f (b)
a c b
Example 3:
Verify that x5 − 2 x3 + 3x 2 − 1 = 0 has a solution in the interval [0,1].
Solution:
f (a ) = f (0) = −1
f (b ) = f (1) = 1
f (a ) f (b ) = −1< 0
∴ x *exists in[0,1]
5
1.3 BISECTION METHOD
a +b
Ø Formula : ci = i i
2
Ø Initial guess: a0 and b0 so that f ( a0 ) f (b0 ) < 0
Ø Algorithm:
If f ( ai ) f (ci ) = 0 then STOP. Take x* = ci as a root.
If f ( ai ) f (ci ) < 0 then ai +1 = ai , bi +1 = ci
If f ( ai ) f (ci ) > 0 then ai +1 = ci , bi +1 = bi
Ø The process is repeated up to i-th step until it satisfies
1. f (c ) = 0 2. f (ci ) < ε or 3. bi − ai < ε
i
for a given value of ε and then take x* ≈ ci .
Example 4
Solve f ( x) = x3 − x 2 − 2 in the interval [1,2] take ε = 0.005. Stop when
| f (ci ) |< ε .
Solution
i=0
1+ 2
a0 = 1, b0 = 2 therefore c0 = = 1.5
2
f (a0 ) = f (1) = 13 − 12 − 2 = −2 ⎫⎪
3 2
⎬ ⇒ f (a0 ) f (c0 ) > 0
f (c0 ) = f (1.5) = (1.5) − (1.5) − 2 = −0.875 ⎪⎭
Therefore: a1 = c0 = 1.5 and b1 = b0 = 2
6
i =1
1.5 + 2
a1 = 1.5, b1 = 2 therefore c1 = = 1.75
2
f ( a1 ) = f (1.5) = −0.875 ⎫
⎬ ⇒ f ( a1 ) f (c1 ) < 0
f (c1 ) = f (1.75) = 0.297 ⎭
Therefore: b2 = c1 = 1.75 and a2 = a1 = 1.5
Notice that f (c1 ) > ε ,
so repeat the above step for i = 2,3,..until satisfying the conditions.
i ai bi ci f ( ai ) f (ci ) f (ci ) f ( ai ) f (ci )
0 1 2 1.5 -2 -0.875 0.875 +
1 1.5 2 1.75 -0.875 0.297 0.297 -
2 1.5 1.75 1.625 -0.875 -0.350 0.350 +
6 1.688 1.704 1.696 -0.040 0.002 0.002
From the table above, the algorithms stop at i = 6 since | f (ci ) |< ε .
Therefore, x* = c6 = 1.696
7
1.4 FIXED-POINT ITERATION METHOD
Ø Formula: xi +1 = g ( xi )
Ø Convergence: − 1 ≤ g ʹ( xi ) ≤ 1 (or | g ʹ( x) |≤ 1)
Ø Initial guess: x0 which is close to the root x*.
Ø Do the iteration up to i-th step until xi − xi −1 < ε for a given
value of ε and take x* ≈ xi .
Example 5
Find a root for f ( x) = x3 − x 2 − 2 in the interval [1, 2], and take
ε = 0.005.
Solution
Step 1: find g(x)
Set f(x) = 0 to get x = g(x)
⇒ x3 − x 2 − 2 = 0
x3 = x 2 + 2
1
(
x = x +2 2
)3
1 −2
2x 2
(
∴ g ( x) = x + 2 2
)3 and g ʹ( x) = (
3
x +2 )3
1
2
∴ xi +1 = ( xi + 2) 3
Step 2: Iteration
8
i = 0
Let x0 = 1
1
2
x1 = (x + 2) 0
3
1
2
= (1 + 2) = 1.442
3
−2
2(1) 2
and g ʹ( x0 ) = (1 + 2) 3 = 0.320 satisfies − 1 ≤ g ʹ( xi ) ≤ 1.
3
i = 1
x1 = 1.442
1
2
x2 = (x + 2) 1
3
1
2
= ((1.442) + 2) = 1.598
3
and g ʹ( x1) = 0.377 satisfies − 1 ≤ g ʹ( xi ) ≤ 1.
Error = x1 − x0 = 1.442 − 1 = 0.442 > ε , so continue for i = 2
Proceed until the stopping condition is met.
i xi xi − xi −1
0 1
1 1.442 0.442
2 1.598 0.156
6 1.693 0.004
i = 6 to get x* = x6 = 1.693
9
Example 2:
Show that x 2 − 3 x + e x − 2 = 0 can be manipulated to form
x2 + e x − 2
x= . Then, find a root, x* using fixed-point iteration
3
method. Use x0 = −1.
Solution:
x 2 − 3x + e x − 2 = 0
3x = x 2 + e x − 2
x2 + e x − 2
x= (shown).
3
x = g ( x) xi +1 = g ( xi )
x 2 + e x − 2 xi 2 + ei x − 2
= =
3 3
i xi | xi − xi −1 |
0 -1
1 -0.2107 0.7893
2 -0.3819 0.1712
3
4
∴ x * ≈ x 4 = −0.3903
10
1.5 NEWTON-RAPHSON METHOD
f ( xi )
Formula : xi +1 = xi −
f ( xi )
ʹ
Initial guess: x0 = a or x0 = b so that f ( a0 ) f (b0 ) < 0
Do the iteration up to i-th step until
f ( xi ) = 0 , f ( xi ) < ε or xi − xi −1 < ε for a given value of ε
and take x* ≈ xi .
Example 1
Find a root for f ( x) = x3 − x 2 − 2 in the interval [1, 2] and take
ε = 0.005. Stop when xi − xi −1 < ε .
Solution
*you can choose any number between 1 and 2 to start, x0 .
f ( x) = x 3 − x 2 − 2
f ʹ( x) = 3x 2 − 2 x
i=0
f ( x0 )
x0 = 1, so x1 = x0 −
f ʹ( x0 )
−2
=1 − =3
1
Continue for next i = 1
11
i =1
f ( x1 )
x1 = 3, so x2 = x1 −
f ʹ( x1 )
16
= 3 − = 2.238
21
Notice that error = x1 − x0 = 3 − 1 = 2 > ε , so continue for i = 2 .
i xi f ( xi ) f ʹ( xi ) xi − xi −1
0 1 -2 1
1 3 16 21 2
2 2.238 4.201 10.550 0.762
6 1.696 0.002 5.237 0.000
Stop the algorithm at i = 6 to get x* = x6 = 1.696 where x6 − x5 = 0 < ε
12