You are on page 1of 13

NUMERICAL ANALYSIS

Lecture -4

Dr. Muhammad Rafiq


Assistant Professor
University of Central Punjab
Lahore Pakistan

Page 1 of 13
SOLUTION OF NON- LINEAR EQUATIONS
Non linear equations:-
Polynomial equations of degree more than 1 and transcendental equations are called non- linear equation.

e.g:-

 x3+4x2+5=0
 tanx+𝑒 𝑥 +3=0
 Lnx+x=0

Basic properties of Non- linear equations:-


Suppose we have an equation f(x)=0 .

 If f(a)=0 then a is called root of the equation .


 Every equation of nth degree has only ‘n’ roots (real or imaginary).
 If f(a) and f(b) have different signs then equation f(x)=0 has at least one real root between x= a and x=b.

e.g:-

x3-4x-9=0

f(x)= x3-4x-9

Page 2 of 13
f(2)= 23 – 4(2) - 9= -9

f(3)= 33- 4(3) - 9 = 6

 f(x) has at least one real root between 2 and 3.

This property is called intermediate value property.

 In an equation with real coefficients imaginary root occur in conjugate pair i.e. if 𝛼 + ί𝛽 is a root of the
equation f(x)=0,then 𝛼 − ί𝛽 is also a root of the same equation similarly if root a+√𝑏 is a root of
equation f(x)=0,then a-√𝑏 also a root of the f(x)=0.
 Every equation of odd degree has at least one real root.
 The f(x)=0 cannot have more positive real root than the changes of signs in f(x) and cannot have more
negative real roots than changes in sign of f(-x).

e.g:- f(x)=

thus the given equation cannot have more than 3 real roots.

f(-x)=

therefore the given equation cannot have more than 2 negative real roots the given equation has at least 2
imaginary roots.

Page 3 of 13
Note:-If equation of nth degree has at most (p) +ve and at most (q) –ve real roots than it follow that the equation
has at least {n-(p+q)} imaginary roots.

BISECTION METHOD:-
This method is based on the repeated application of intermediate value property.

Let the function f(x) be continuous between x=a and x=b. let f(a) be –ve and f(b) +ve so the roots lies in the
interval (a,b). First approximation to the root is given by
a+b
X1 = -ve a X1 b +ve
2

Put X1 in f(x) if f(X1)=0, then X1 is root of f(x)=0 otherwise the root lies between a and X1 Or X1 and b according
as f(X1) is positive or negative

 If f(x) is positive then root lies between a and X1 in the interval (a, X1) next approximation to the root is
a+X1
X2 = -ve a X2 X1 b +ve
2

 If the is negative then root lies between X1 and b i.e. in the interval (X1,b) next approximation to the root is
X1+b
X2 = -ve a X2 X1 b +ve
2

Note:-

Choose interval (a,b) as small as possible. Bisection Method is also called Binary Search or Bolzano method.
Page 4 of 13
Example1:
Find one real root of the equation x3-4x-9=0 using bisection method in four stages.

Solution:
x3-4x-9=0

f(x)= x3-4x-9

f(2)= 23 - 4*2 - 9= -9

f(3)= 33- 4*3 - 9 = 6

the roots lies between 2 and 3 2 3

1st approximation:
2+3
X1 = =2.5
2

f(2.5)= 2.53 - 4*2.5 - 9= -3.375

root lies between 2.5 and 3 2 2.5 3

2nd approximation:
2.5+3
X2 = =2.75
2

Page 5 of 13
f(2.75)= 2.753 - 4*2.75 - 9= 0.797

root lies between 2.5 and 2.75 2 2.5 2.75 3

3rd approximation:
2.5+5.75
X3 = =2.625
2

f(2.625)= 2.6253 - 4*2.625 - 9= -1.412

root lies between 2.625 and 2.75 2 2.5 2.625 2.75 3

4th approximation:
2.625+2.75
X4 = =2.6875
2

After four stages root is = 2.6875

Example2:
Use bisection method to find a real root between 0.4 and 0.6 of equation sinx-5x+2=0 (correct to 4d.p)

Solution
f(0.4)= sin(0.4) − 5(0.4) + 2 = 0.3894

f(0.6)=sin(0.6) − 5(0.6) + 2 = −0.435

Page 6 of 13
1st Approximation: (+ve) 0.5 (-ve)

0.4+0.6
=0.5 0.4 0.6
2

f(0.5)= sin(0.5) − 5(0.5) + 2= -0.052

2nd Approximation:
0.4+0.5
=0.45 (+ve) 0.45 (-ve)
2

f(0.45)= sin(0.45) − 5(0.45) + 2= 0.184 0.4 0.5

3rd Approximation:
0.45+5
=0.475 (+ve) 0.475 (-ve)
2

f(0.475)= sin(0.475) − 5(0.475) + 2= 0.0823 0.45 0.5

4th Approximation:
0.475+0.5
=0.4875 (+ve) 0.4875 (-ve)
2

f(0.4875)= sin(0.4875) − 5(0.4875) + 2=0.0309 0.475 0.5

5th Approximation:
0.4875+0.5
=0.49375 (+ve) 0.49375 (-ve)
2

Page 7 of 13
f(0.49375)= sin(0.49375) − 5(0.49375) + 2= 0.00518 0.4875 0.5

6th Approximation:
0.49375+0.5
=0.49875 (+ve) 0.496875 (-ve)
2

f(0.49875)= sin(0.49875) − 5(0.49875) + 2= -0.007691 0.49375 0.5

7th Approximation:
0.49375+0.496875
=0.4953 (+ve) 0.4953 (-ve)
2

f(0.4953)= sin(0.4953) − 5(0.4953) + 2= -1.26 0.49375 0.496875

8th Approximation:
0.49375+0.4953
=0.4945312 (+ve) 0.4945312 (-ve)
2

f(0.4945312)= sin(0.4945312) − 5(0.4945312) + 21=0.0019 0.49375 0.4953

9th Approximation:
0.4345312+0.4953
=0.494921 (+ve) 0.494921 (-ve)
2

f(0.494921)= sin(0.494921) − 5(0.494921) + 2= 0.000356 0.4945312 0.4953

Page 8 of 13
10th Approximation:
0.494921+0.4953
=0.495116 (+ve) 0.495116 (-ve)
2

f(0.495116)= sin(0.495116) − 5(0.495116) + 2=-0.000448 0.494921 0.4953

11th Approximation:
0.494921+0.495116
=0.495043 (+ve) 0.495043 (-ve)
2

f(0.495043)= sin(0.495043) − 5(0.495043) + 2= -0.000145 0.494921 0.4951126

12th Approximation:
0.494921+0.495043
=0.494982 (+ve) 0.494982 (-ve)
2

f(0.494982)= sin(0.494982) − 5(0.494982) + 2= 0.000105 0.494921 0.495043

13th Approximation:
0.494982+0.495043
=0.4950125 (+ve) 0.4950125 (-ve)
2

f(0.4950125)= sin(0.4950125) − 5(0.4950125) + 2=-0.00019 0.494982 0.495043

14th Approximation:
0.494982+0.4950125
=0.494997 (+ve) 0.494997 (-ve)
2

f(0.494997)= sin(0.494997) − 5(0.494997) + 2= 0.00004 0.494982 0.4950125

Page 9 of 13
15th Approximation:
0.494997+0.4950125
=0.49500475
2

f(0.495004 )= sin(0.495004 ) − 5(0.495004) + 2= 0.0000128

(+ve) 0.49500475 (-ve)

0.494997 0.4950125

16th Approximation:
(+ve) (-ve)

0.49500475 0.4950125

Hence the root is 0.4950 which 4 d.p accurate

Example3:
Use bisection method to find a real root between 0.5 and 1 of equation 𝒙 − 𝐜𝐨𝐬 𝒙 =0

(correct to 3d.p)

Solution:
f(1)= (1) − cos(1) =0.45

f(0.5)=(0.5) − cos(0.5) =-0.377

Page 10 of 13
1st Approximation: (-ve) 0.75 (+ve)

1+0.5
=0.75 0.5 1
2

f(0.75)= (0.75) − cos(0.75) =0.018

2nd Approximation:
0.5+0.75
=0.625 (-ve) 0.625 (+ve)
2

f(0.625)= (0.625) − cos(0.625) =-0.18 0.5 0.75

3rd Approximation:
0.625+0.75
=0.6878 (-ve) 1.375 (+ve)
2
f(0.6875)= (0.6875) − cos(0.6875) = -0.08 0.625 0.75

4th Approximation:
0.6875+0.75
=0.71875 (-ve) 0.71875 (+ve)
2

f(0.71875)= (0.71875) − cos(0.71875) = -0.033 0.6875 0.75

5th Approximation:
0.71875+0.75
=0.73437 (-ve) 0.7343 (+ve)
2

Page 11 of 13
f(0.73437)= (0.73437) − cos(0.73437) =-.0078 0.71875 0.75

6th Approximation:
0.7343+0.75
=0.742187 (-ve) 0.742187 (+ve)
2

f(0.742187)= (0.742187) − cos(0.742187) =0.005 0.73437 0.75

7th Approximation:
0.73437+0.742187
=0.738281 (-ve) 0.738281 (+ve)
2

f(0.738281)= (0.738281) − cos(0.738281) =-0.001 0.73437 0.742187

8th Approximation:
0.738281+03742187
=0.7402343 (-ve) 0.7402343 (+ve)
2

f(0.7402343)= (0.7402343) − cos(0.7402343) =0.0019 0.738281 0.74218

9th Approximation:
0.738281+0.7402343
=0.73925 (-ve) 0.7402343 (+ve)
2

f(0.73925)= (0.73925) − cos(0.73925) =.00028 0.738281 0.7402343

10th Approximation:
0.7382812+0.73925
=0.738769 (-ve) 0.738769 (+ve)
2

Page 12 of 13
f(0.73876)= (0.73876) − cos(0.73876) = -0.26 0.7382812 0.73925

11th Approximation:
0.738769+0.73925
=0.73901 (-ve) 0.7 3901 (+ve)
2

f(0.73901)= (0.73901) − cos(0.73901) =-0.00011 0.738769 0.73925

12th Approximation: (-ve) (+ve)

0.73901 0.73925

Hence the root is 0.739 which 3 d.p accurate

Exercise
Find the real root of the following equation correct to 4d.p using bisection method

I. 𝒙𝟑 − 𝒙𝟐 + 𝒙 − 𝟕 = 𝟎
II. 𝒙𝟑 +x-1=0
III. 3x=√𝟏 − 𝒔𝒊𝒏𝒙
IV. 𝒙𝒍𝒐𝒈𝟏𝟎 𝒙 − 𝟏. 𝟐 = 𝟎
V. ex sin (x) = 1

Page 13 of 13

You might also like