Professional Documents
Culture Documents
Numerical Analysis
Prepared by Eng. Maged Kamel
Prepared By Eng Maged kamel
Objective of lecture.
Numerical analysis involves the study of all the methods of computing numerical
data.
We let f(x)=y=0
(x+2)*(x-2)=0
So x=-2 or x=+2 are the zeros
To check substitute in the value of x
Y=(2)^2-4= 4-4=0
Y=(-2)^2-4=4-4=0
Synthetic Division
To get the zero for a function ,some times we are guessing the values for x ,so
called rational roots test
Rational roots test is a handy way of obtaining a list of useful first guesses when
you are trying to find the zeroes (roots) of a polynomial.
Example: solve the function y=𝑥 2 − 5𝑥 + 6
2nd trial :
Next step we let X-2=0 i.e x=2
+2 1 -5 +6
+2 -6
(x-2)*(x-3)=0 the result shows that we
-3
1 0 have two roots x1=2,x2=3
Our example is :f(x) =𝑥 3 − 6𝑥 2 + 11 ∗ x − 6, find the zeros for the function
by analytical method and further by Numerical method.
Solution:
Leading coefficient ±1
1,6,2,3
Constant coefficient ±1,6,2,3 Our choices: ± as zeros
1
4- check f((𝑥1 ) .
5- if f((𝑎1 )*f(𝑥1 ) <0 ,then they are opposite to each other , (𝑥1 will have right hand bracket }
if not then (𝑥1 ) then x1 will be having left bracket ,get new point
Take intermediate point with (𝑥2 , as 2nd trial= 0.50*((𝑎1 +(𝑏1 ) get f(x2)
Bracketing method
Bisecting method.
5- if f((𝑎1 )*f(𝑥1 ) < 0 ,then they are opposite to each other , (𝑥1 will have right hand
bracket }
We will bisect the distance between 𝑎1 & 𝑥1 and get a new point 𝑥2
if f((𝑎1 )*f(𝑥1 ) >0 X1 will be having left bracket ,get new point
Take intermediate point ,between 𝑥1 and 𝐵1 with (𝑥2 ,
6- check if f((𝑥2 )*f(𝑏1 ) ) < 0,then these points will be opposite to each other .
7- Continue the process by bisecting the distance between point having opposite f(x) value till you
approach to the zero point.
Example if :f(x)=X^3-6X^2+11x-6 ,find the zeros for the function by bisecting
method.
Solution:
1- Try several values of x that give different values of f(x)
for X =4 f(4) = 4^3-6*4^2+11*(4)-6=64-96+44-6=+6
for x=2.50 then f(2.50)= 2.5^3 - 6*2.5^2+11*(2.5)-6=15.625-37.50+27.50-6=-0.375
(3.25,0.7031) (4,+6)
a0=2.50 X3=0.50*(2.875+3.25)=3.0625
X1=3.25 f(3.0625)=+0.1369
(2.50,-0.375) b=4
}
{ { X2=2.875
(2.875,-0.2050)
X4=0.50*(2.875+3.0625)=2.96875
X2=2.875 { } X1=3.25 f(2.96875=-0.0596
X2=2.875 { } X3=3.0625
Zero point at x=3
X4=2.968 { } X3=3.0625 X5=0.50*(2.968+3.0625)=3.015
} X5=3.015 f(3.015)=0.032
1st iteration.
Take X1=0.50*(4+2.50)=3.25
f(3.25)=+0.7031
f(2.50)*f(3.25)=- 0.375*(+0.7031)=- 0.26367
they are opposite to each other
2nd iteration.
Take X2=0.50*(2.50+3.25)=2.875
f(2.875)=-0.20508
f(2.875)*f(4)=-0.20508*6 =-1.23047
Take X4=0.50*(2.875+3.0625)=2.968
f(2.968) =-0.06
f(3.0625)*f(2.968)=+0.1369*(-0.06)=-0.01
5th iteration
Take X5=0.50*(2.968+3.0625)=3.015
f(3.015) =+0.032
f(3.015)*f(2.968)=+0.032*(-0.06)=-0.002
Solution (4,+6)
For 𝑎0 =2.5 put x=2.5
then f(4)= 2.53 − 6 ∗ 2.52 +11 ∗ 2.5 X1
= -0.375
𝑎0 =2.5 x
(2.588,-0.3847) 𝑏0 =4
(2.50,-0.375)
For 𝑏0 =4 put x=4 then f(4)= 43 − 6 ∗ 42 +11 ∗ 4
First iteration. = 64- 96+ 44 – 6 = +6
(4 ∗ (−0.375) − (2.50 ∗ 6)
= (4 ∗ −0.375) − (2.50 ∗ 6)
(−0.375 − 6)
= 2.588
(−0.375 − 6)
𝑥1 =(2.588)
𝑎0 =2.50
(2.50,-0.375) b=4
X1=2.588 { }
f(2.588)= -0.38469
X2 =2.673 {
}
𝑥1 =(2.588)
𝑎0 =2.50
(2.50,-0.375) b=4
X1=2.588 { }
3rd iteration.
X2 =2.673 {
}
(4 ∗ (−0.36801) − (2.6732 ∗ 6) X3 = 2.749 { }
(−0.36801 − 6) X4=2.8147 { }
X3= 2.7499
f(2.7499)*f(4)=-0.328*+6 = -1.9688
f(2.7499) )= 2.74993 − 6 ∗ 2.74992 +11 ∗ 2.7499 = = -0.328 Left bracket
f(2.7499)*f(4)=-0.328*+6 = -1.9688 Proceed to X4
Left bracket
X2=2.673 (4,+6)
𝑥1 =(2.588)
𝑎0 =2.50
(2.50,-0.375) b=4
X1=2.588 { }
4rth iteration.
X2 =2.673 {
}
(4 ∗ (−0.328) − (2.749 ∗ 6) X3 = 2.749 { }
(−0.328 − 6) X4=2.8147 { }
X4 = 2.8417
f(2.8417)*f(4)=-0.274*(+6 )= -1.643
f(2.8417) )= 2.84173 − 6 ∗ 2.84172 +11 ∗ 2.8417 = = -0.274 Left bracket
f(2.8417)*f(4)=-0.274*(+6 )= -1.643 Proceed to X5
Left bracket
X2=2.673 (4,+6)
𝑥1 =(2.588)
𝑎0 =2.50
(2.50,-0.375) b=4
X1=2.588 { }
5th iteration.
X2 =2.673 {
}
(4 ∗ (−0.274) − (2.8417 ∗ 6) X3 = 2.749 { }
(−0.274 − 6) X4=2.8147 { }
X5 = 2.866 X5=2.866 {
f(2.866) )= 2.88663 − 6 ∗ 2.8662 +11 ∗ 2.866 = = -0.216 f(2.866)*f(4)=-0.216*(+6 )= -1.9255
Left bracket
f(2.866)*f(4)=-0.216*(+6 )= -1.9255 Proceed to X6
Left bracket
X2=2.673 (4,+6)
𝑥1 =(2.588)
𝑎0 =2.50
(2.50,-0.375) b=4
X1=2.588 { }
X2 =2.673 {
}
X3 = 2.749 { }
X4=2.8147 { }
Iteration will continue till x =3.00 after 20 iteration
X5=2.866
{
Spread sheet data used for approximation