Professional Documents
Culture Documents
Numerical Analysis (MATH-254)
Numerical Analysis (MATH-254)
Fall 2021
Lecture No. 4 (Root Location Methods for Nonlinear Equations: M-II.
Tabulation Method)
Focus
then the equation f (x) = 0 has at least one solution in this interval.
Remark I: If f (a) and f (b) have same signs then nonlinear equation
f (x) = 0 has no real roots or has an even number of real roots.
Remark II: If the curve y = f (x) touches the x-axis at some point, say,
x = α, then α is a root of f (x) = 0 though f (a) and f (b) have same signs.
Such roots are called repeated roots.
1
Example 1: Given 8x3 −20x2 −2x+5 = 0. Locate the roots of this equation.
0
y=f(x)
100
-20
y=f(x), y=g(x)
-40
50
-60
0
-80
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5
x
x
(a) Graph of f (x) = 8x3 − 20x2 − 2x + 5 (b) Graph of f (x) = 8x3 and g(x) = 20x2 +
2x − 5
x -2 -1 0 1 2 3 4
f (x) -135 -21 5 -9 -15 35 189
Sign - - + - - + +
∗
The (exact) roots are 2.5, 0.5, and −0.5.
MATLAB Code: To plot the graphs of functions, use the plot command
in MATLAB as follows.
2
Example 2: Given 3x − 3x − 2 = 0. Locate the roots of this equation.
5 Exponential
Linear
y=f(x)
y=f(x), y=g(x)
0
-5
-5
-1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5
x x
x -1 0 1 2 3
f (x) 1.3333 -1 -2 1 16
Sign + - - + +
3
2
f(x)=6x +5x+1
2
2
f(x)=-12x +7x-1
1.5 0.2
1
-0.2
-0.4
0.5
-0.6
0 -0.8
-1
-0.5
-1.2
-1 -0.8 -0.6 -0.4 -0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6
function values
- (c). Stopping Criterion Following are the commonly used stopping cri-
terion (depending on the tolerance) for stopping an iterative process.
(i) If the number of iterations N are fixed then we stop when the desired
number of iterations are done.
(ii) |pN − pN −1 | < , i.e., stop when the absolute difference/error between two
successive approximations/iterations, at the (N − 1)th (pN −1 ) and N th (pN )
iterations, of the desired root is less than the specified tolerance. The desired
root will be pN .
(iii) |pN |p
−pN −1 |
N|
< , pN 6= 0, i.e., stop when the relative difference between two
successive approximations is less than the specified tolerance. The desired
root will be pN .
(iv) |f (pN )| < i.e., when the absolute value of the function at N th approxi-
mation/iteration is less than the specified tolerance. The desired root will be
pN .
4
Next Lecture: Root Finding Methods for Nonlinear Equations: M-I Bisec-
tion Method
5
Numerical Analysis (MATH-254)
Fall 2021
Lecture No. 5 (Root Finding Methods for Nonlinear Equations: M-I
Bisection Method)
Focus
I. Locate the root(s) of the given NL equation (if required), i.e., find an in-
terval [a, b] such that f (a) and f (b) have opposite signs, i.e., f (a) f (b) < 0.
III. Perform the iterations of Bisection Method. Each iteration of the Bisec-
tion Method will consist of the following steps.
Step 2: Take the mid-point c1 = a+b 2 of the interval as the first approximation
of the root, i.e., p1 = c1 . Find f (p1 ).
6
IV. If the stopping criteria is not fulfilled, then repeat the above 3 steps until
the stopping criteria is satisfied. This will produce a sequence p1 , p2 , p3 , · · · , pN , · · ·
of approximations of the root of f (x) = 0.
Q.1(B) Use √the Bisection method to find p3 (or simply perform 3 iterations)
for f (x) = x − cos x = 0 (on [0, 1]) working with 4 decimal place accuracy.
Note The value of root correct to 4 decimal points using calculator (it also
uses some numerical algorithm) is 0.6417.
0.5
0.9
0 0.8
0.7
0.6
0.5
-0.5 0.4
0.3
0.2
0.1
-1 0
0 0.2 0.4 0.6 0.8 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
x
x
7
Numerical Analysis (MATH-254)
Fall 2021
Lecture No. 6 (Error Bound Formula for Bisection Method, Solution of
some Selected Exercises, and MATLAB Demo)
Focus
Theorem 2.1 (Error Bound)/B Suppose that f ∈ C[a, b] and f (a)f (b) <
0. The Bisection method generates a sequence {pN }∞ N =1 for approximating a
∗
zero p of f with
b−a
|pN − p∗ | ≤ N , N ≥ 1.
2
The above formula gives a bound for approximation error, i.e., at each itera-
tion N , the error |pN − p∗ | can’t exceed b−a
2N . However, this bound might be
quite conservative, i.e., the actual error at the N th iteration may be signifi-
cantly smaller than the EB.
Related Exercises: Examples 1-2, Qs. 3-17 (B), Examples 2.1-2.6, Qs. 1-4
(R)
Q. 6d(B) Show that the equation x + 1 − 2 sin πx = 0 has only one sim-
ple root in the interval [0.5, 1]. Determine how many iterations of Bisection
method will be required to find an approximate root accurate to within 10−5 .
Hence, find p3 .
Example
√ 2.6(R) Find a nonlinear equation which has one simple positive
4
root 18. Use bisection method to compute the second approximation to the
positive root using a = 2 and b = 2.5. Compute an error bound and absolute
error for the approximations. Find also the bound for |p12 − p∗ |. Use 4 d.p.
8
5
4
4
3
3
2
1 2
0
1
-1
0
-2
-1
-3
-4 -2
-5 -3
-4 -3 -2 -1 0 1 2 3 -4 -3 -2 -1 0 1 2 3
x x
Note: The value of the fourth root of 18 using calculator (it also uses some
numerical algorithm) is 2.059767 (correct to 7 digits).
4
f(x)=x -18
25
f(x)=x 4-18
20 40
4
f(x)=x
g(x)=18
15 35
10 30
5 25
0 20
-5 15
2 2.1 2.2 2.3 2.4 2.5 2 2.1 2.2 2.3 2.4 2.5
9
Drawbacks of Bisection Method
- There are sequences with the property that the differences pN − pN −1 con-
verge to zero while the sequence {pN }∞
N =1 itself diverges. (See Exercise 17 of
Burden and Faires)
- It is relatively slow to converge (that is, N may become quite large before
|p∗ − pN | is sufficiently small)
Next Lecture: Root Finding Methods for Nonlinear Equations: M-II Fixed-
Point Method
∗∗
Last updated on September10, 2021
10