Numerical solution of non-linear equations Bisection method Instructor: Miss Urooj
Numerical solution of non- linear equations
(Root finding method)
1. Open Methods
Newton’s Rapson Method
Secant Method
2. Closed Methods (Bracketing Methods)
Bisection Method
False Position Method
Errors
1. True Errors
Percentage Relative Error
𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒−𝐴𝑝𝑝𝑟 𝑉𝑎𝑙𝑢𝑒
𝜀𝑡 = | |*100
𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
Absolute Error |𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 − 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑣𝑎𝑙𝑢𝑒|
2. Estimated Error
𝑥3𝑛𝑒𝑤 −𝑥3𝑜𝑙𝑑
Percentage Relative Error 𝜀𝑎 = | |*100
𝑥3𝑛𝑒𝑤
Absolute Error |𝑥𝑛𝑒𝑤
3 − 𝑥𝑜𝑙𝑑
3 |
Closed Method
Bisection Method
Formula 𝑥1 + 𝑥2
𝑥3 =
2
If 𝑓(𝑥1) ∗ 𝑓(𝑥3 ) < 0 set 𝑥2 = 𝑥3
𝑓 (𝑥1 ) ∗ 𝑓 (𝑥3 ) > 0 set 𝑥1 = 𝑥3
Numerical solution of non-linear equations Bisection method Instructor: Miss Urooj
Question: Determine the real root of 𝑓 (𝑥 ) = −0.5𝑥 2 + 2.5𝑥 + 4.5
(a). Using the three iterations of bisection method to determine the highest root.
Employ the initial guesses of 𝑥𝑙 = 5, and 𝑥𝑢 = 10. Compute the estimated error
and true error after each iteration.
(b). Using the quadratic formula.
Solution:
(b). Apply quadratic formula.
Roots are 6.4051, -1.4051
(a). Bisection method
𝑥1 = 5 , 𝑓 (𝑥1 = 5) = 4.5
𝑥2 = 10, 𝑓(𝑥2 ) = −20.5
𝑥3 𝜀𝑡
Iterations 𝑥1 𝑥2 f(𝑥3 ) f(𝑥1 )f(𝑥3 ) 𝜀𝑎
6.4051 − 7.5
-21.9375<0 | | ∗ 100
0 5 10 7.5 -4.875 _ 6.4051
𝑥2 = 𝑥3
=17.0937%
4.5*0.593 = 6.25 − 7.5 6.4051 − 6.25
| | ∗ 100 | | ∗ 100
1 5 7.5 6.25 0.5937 2.6718>0 6.25 6.4051
𝑥1 = 𝑥3 =20% = 2.42189%
0.5937*- 6.875 − 6.25 6.4051 − 6.875
| | ∗ 100 | | ∗ 100
2 6.25 7.5 6.875 -1.9453 1.9453 6.875 6.4051
-1.1550<0 =9.091% =7.3359%
Ans. The real root of given equation is 6.875
Numerical solution of non-linear equations Bisection method Instructor: Miss Urooj
Question: Determine a real root of 𝑓(𝑥 ) = 5𝑥 3 − 5𝑥 2 + 6𝑥 − 2
Using bisection method to locate the root. Employ the initial guesses of 𝑥𝑙 = 0,
and 𝑥𝑢 = 1 and iteration until the estimated error 𝜀𝑎 fall below the level of 10%.
Solution:
𝒙𝟏 +𝒙𝟐
𝑥1 = 0 , 𝑓 (𝑥1 = 0) = -2 𝒙𝟑 =
2
𝑥2 = 1, 𝑓 (𝑥2 ) = 4
𝜺𝒂
Iterations 𝒙𝟏 𝒙𝟐 𝒙𝟑 f(𝒙𝟑 ) f(𝒙𝟏 )f(𝒙𝟑 ) 𝑥3𝑛𝑒𝑤 −𝑥3𝑜𝑙𝑑
𝜀𝑎 = | |*100
𝑥3𝑛𝑒𝑤
-0.75<0
0 0 1 0.5 --
𝒙𝟐 = 𝒙𝟑
1.46876>0
1 0 0.5 0.25 100%
𝒙𝟏 = 𝒙𝟑
0.13913>0
2 0.25 0.5 0.375 33.3%
𝒙𝟏 = 𝒙𝟑
-0.01642<0
3 0.375 0.5 0.4375 14.285%
𝒙𝟐 = 𝒙𝟑
0.00994>0
4 0.375 0.4375 0.40625 7.692%
𝒙𝟏 = 𝒙𝟑
The real root of given equation is 0.40625, with 7.692% error.
Numerical solution of non-linear equations Bisection method Instructor: Miss Urooj
Question: Determine a real root of 𝑓(𝑥 ) = 𝑥 3 − cos(𝑥) − 1
Use bisection method to locate a real root of function, and iteration until the
estimated error 𝜀𝑎 fall below the level of 10%.
Solution: (convert the mode of calculator in radians)
Let 𝑥1 = 0 𝑎𝑛𝑑 𝑥2 = 2
𝒙𝟏 +𝒙𝟐
At, 𝑥1 = 0 , 𝑓 (𝑥1 ) = −2 𝒙𝟑 =
2
And at, 𝑥2 = 2, 𝑓(𝑥2 ) = 7.41615
𝜺𝒂
Iterations 𝒙𝟏 𝒙𝟐 𝒙𝟑 f(𝒙𝟑 ) f(𝒙𝟏 )f(𝒙𝟑 ) 𝑥3𝑛𝑒𝑤 −𝑥3𝑜𝑙𝑑
𝜀𝑎 = | 𝑥3𝑛𝑒𝑤
|*100
1.080604 >0
0 0 2 1 -0.540302 --
𝒙𝟏 = 𝒙𝟑
-1.244998<0
1 1 2 1.5 2.304263 33.33%
𝒙𝟐 = 𝒙𝟑
-0.344606<0
2 1 1.5 1.25 0.637803 20%
𝒙𝟐 = 𝒙𝟑
0.0039701>0
3 1 1.25 1.125 -0.007348 11.11%
𝒙𝟏 = 𝒙𝟑
-0.002209<0
4 1.125 1.25 1.1875 0.300581 5.263%
𝒙𝟐 = 𝒙𝟑
The real root of given equation is 1.1875, with 5.263% error.