Roots of Nonlinear Equations
Roots of Nonlinear Equations
→ 3sin x + e x = 0
→ 3x3 + 3x + 1 = 0
Bisection method
Secant method
f (a)
f (b)
x3
Example: Find the possible sub-interval that contain the solution of f ( x) = − x 2 + 1 To increase your speed in
3 obtaining the value using
in the interval −2,3 , with step size (h) = 1, using intermediate value theorem. calculator? Learn it from
https://youtu.be/g6txNbJkrGk
Use 4 decimal points in your calculations.
(−2)3
f (−2) = − (−2) 2 + 1 = −5.6667
3
x3
There are three possible sub-interval that contain the solution of f ( x) = − x 2 + 1: −1, 0 , 1, 2 and 2,3.
3
Roots of Non-linear Equations:
BISECTION METHOD
*Aim: We want to find the solution of x, so that f (x)=0.
(Find the root of solution f (x))
→ Find f '( x) = 3x 2 − 3 f ( x0 ) −1
x1 = x0 − = 0− = −0.333333
f '( x0 ) −3
→ substitute the initial value x0 = 0 into the f '( x)
f ( x1 ) −0.037037
= 3(0) − 3 = −3
2 x2 = x1 − = (−0.333333) − = −0.347222
f '( x1 ) −2.666667
Formula NRmethod:
f ( x2 ) −0.000196
f ( xi ) x3 = x2 − = (−0.347222) − = −0.347296
xi +1 = xi − f '( x2 ) −2.638310
f '( xi )
i x f ( xi ) f '( xi )
0 0 -1 -3
1 -0.333333 -0.037037 -2.666667
2 -0.347222 -0.000196 -2.638310
3 -0.347296 -0.000000 -
→ Find f '( x) = 2 x − 4
→ substitute the initial value x0 = 2 into the f '( x)
2(2) − 4 = 0
i x f(x) f’(x)
0 2 2 0
1 Solution cannot be find - -
2
x1 = 2 − = not exist
0
→ Find f '( x) = 2 x + 2
i x f ( xi ) f '( xi ) xi − xi −1
0 1 -2 4 -
1 1.5 0.25 5 x1 − x0 = 1.5 − 1 = 0.5
2 1.45 0.0025 4.9 x2 − x1 = 1.45 − 5 = −0.05 = 0.05
3 1.4495 0.00005 0.0001 4.8990 0.0005
4 1.4495 0.00005 0.0001 - -
xi − xi −1 x
xi +1 = xi − f ( xi ) i f ( xi )
f ( xi ) − f ( xi −1
)
0 0 -1
x1 − x0
x2 = x1 − f ( x1 ) 1 1 -3
f ( x1 ) − f ( x0
)
1− 0 2 -0.5 0.375
= 1 − (−3) = −0.5
(−3) − (−1) 3 -0.333333 -0.037037
x2 − x1 4 -0.348315 0.002685
x3 = x2 − f ( x2 )
f ( x2 ) − f ( x1
) 5 -0.347302 0.000016
(−0.5) − 1
= (−0.5) − (0.375) 6 -0.347296 -0.000000
(0.375) − (−3)
= −0.333333
x3 − x2
x4 = x3 − f ( x3 )
f ( x3 ) − f ( x2
)
(−0.333333) − (−0.5)
= (−0.333333) − (−0.037037)
( −0.037037) − (0.375)
= −0.348315
*How to determine initial value if it is not given in the question?
Example: Solve 4 x cos(2 x) − ( x − 2) 2 in the interval 0, 5 using Bisection, Newton-Raphson & Secant method.
Use 3 decimal places in all calculations.