Week 04 - Lecture Notes
Week 04 - Lecture Notes
Week 04
by
Dr. Sajjad A. Ghauri / Dr. Kamran Suhaib
The Secant Method
It converges quicker than a linear rate, making it more convergent than the bisection
method.
It does not necessitate the usage of the function’s derivative, which is not available in
a number of applications.
Unlike Newton’s technique, which requires two function evaluations in every iteration,
it only requires one.
1
The secant method has the following drawbacks.
Newton’s approach is more easily generalized to new ways for solving non-linear simultaneous
systems of equations.
Example 1: Find the root of the following equation by the secant method up-to 4 dp.
x3 − 2x − 5 =0
2 × 16 − 3 × (−1)
x2 =
16 − (−1)
x2 =2.0588
2
2nd iteration: When n = 2, we have
x3 =2.0812
x3 =2.0948
Approximate root of the equation x3 − 2x − 5 = 0 using the secant method is 2.0948 (correct
to 4 dp) (After 3 iterations).
Example 2: Find the root of 2 cosh(x) sin(x) = 1 using secant method correct upto 4
dps by taking initial values as 0.4 and 0.5
Solution: Here f (x) = 2 cosh(x) sin(x) − 1. As, the root lies between 0.4 and 0.5. So
x0 = 0.4 and x1 = 0.5.
Note: sin(x) will be calculated in Radian mode. For Degree mode, select the option in
Trigonometry Function Mode.
x2 =0.466
3
Now, f (x2 ) = f (0.466) = 2 cosh(0.466) sin(0.466) − 1 = −0.0019
x3 =0.4668
Approximate root of the equation 2 cosh(x) sin(x) − 1 using the secant method is 0.4668
(correct to 4 dp) (After 2 iterations).
Bisection method is a perfectly valid technique for finding the roots. Its — approach
is relatively insufficient.
In bisection method the interval in divided into two equal halves, no account is taken
of the magnitude of f (x1 ) and f (x2 ).
For example, if f (x1 ) is much closer to zero, then f (x2 ) it is likely that root is closer
to x2 than x2 .
Replacement of the curve by a straight line gives a false position of the root.
Example 2: Find the root of x2.2 = 69 using false position method correct upto 4 dps
by taking initial values as 5 and 8
4
Solution: Here f (x) = x2.2 − 69. As, the root lies between 5 and 8. So x0 = 5 and x1 = 8.
x2 =6.6559
Now, we see that f (x2 )f (x1 ) < 0, this implies that root lies between 6.6559 8.
Note: If f (xn+1 ) and f (xn ) are of opposite signs then root lies between [xn , xn+1 ]. Else
f (xn+1 ) and f (xn−1 ) are of opposite signs then root lies between [xn−1 , xn+1 ].
x3 =6.8340
So, root lies in [6.8340,8] and repeat until answer will be correct upto 4 dps.
5
Stagnation is not desirable b/c it slows down The Convergence.
One end of successive intervals does not move from original end point.
Mean approximation of root converges to the exact root from one side only.
Iterative equations for both methods are identical on a term by term basis.
Critical difference between methods is how one of initial values is replaced by new
estimate.
False Position Method: (i). Two estimates always bracket the root.
(ii). Method always converges between root is Kept within Bracket.
2. Let f (x) = −x3 − cos x and p0 = −1. Use Newton’s method to find p2 . Could p0 = 0 be
used?
6
b. Use the method of False Position.
5. Use Newton’s method to find solutions accurate to within 10−4 for the following problems.
a. x3 − 2x2 − 5 = 0, [1, 4]
b. x3 + 3x2 − 1 = 0, [−3, −2]
c. x − cos x = 0, [0, π/2]
d. x − 0.8 − 0.2 sin x = 0, [0, π/2]
6. Use Newton’s method to find solutions accurate to within 10−5 for the following problems.
a. ex + 2−x + 2 cos x − 6 = 0 for 1 ≤ x ≤ 2
b. ln(x − 1) + cos(x − 1) = 0 for 1.3 ≤ x ≤ 2
c. 2x cos 2x − (x − 2)2 = 0 for 2 ≤ x ≤ 3 and 3 ≤ x ≤ 4
d. (x − 2)2 − ln x = 0 for 1 ≤ x ≤ 2 and e ≤ x ≤ 4
e. ex − 3x2 = 0 for 0 ≤ x ≤ 1 and 3 ≤ x ≤ 5
f. sin x − e−x = 0 for 0 ≤ x ≤ 1 3 ≤ x ≤ 4 and 6 ≤ x ≤ 7