Professional Documents
Culture Documents
Question
Solve by Newton Raphson Method;
𝑓 (𝑥 ) = 4 cos(𝑥 ) + 𝑒 −𝑥
Solution
First of all, we will plot the given function to get an initial approxiation for the root of the equation. Since we
know that root of the equuation is the point where the curve cuts x axis. From the graph we can see that
curve cuts near to x=1.6
y
3
1
x
1 2 3 4 5 6
−1
−2
−3
−4
−5
0.2
x
0
1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2
−0.2
−0.4
−0.6
−0.8
𝑥2 = 1.62028
𝑓 ′ (𝑥2 ) = −4.19295
4 cos(𝑥𝑛 )+𝑒 −𝑥𝑛
For n=2 𝑥3 = 𝑥2 −
−4.20019
𝑥3 = 1.62028
𝑓 ′ (𝑥3 ) = −4.19295
4 cos(𝑥𝑛 )+𝑒 −𝑥𝑛
For n=3 𝑥4 = 𝑥3 −
−4.20019
𝑥4 = 1.62028
𝑓 ′ (𝑥1 ) = −4.19295
3 0.0000
Approximate root of the equation 4cos(x)+e-x=0 using Newton Raphson mehtod is 1.62028 (After 3 iterations)
Newton Raphson Method in autograph
x Delta (x)
1.62 0.1201
1.62 0.0001574
1.62 1.134E-009
1.62 4.441E-016
1.62 0
1.62 0
2.165 0
Equation 1: y=4⋅ cosx+e −x
2.165 0
y
1.5
0.5
x
−2 −1 1 2 3 4 5 6 7 8
−0.5
−1
−1.5
y
3
−x
2 Equation 1: y=4⋅ cosx+e
x
−15 −10 −5 5 10 15 20
−1
−2
x Delta (x)
-6.543 0.3566
-6.497 0.0465
-6.496 0.0007663
-6.496 2.066E-007
-6.496 2.22E-014
-6.496 0
y
4
3
2
1
x
−10 −8 −6 −4 −2 2 4
−1
−2
−3
−4
−5
Iteration Method
Question
Solve by Iteration Method;
𝑥 3 + 4𝑥 = 1
Solution
First of all, we will plot the given function to get an initial approxiation for the root of the equation. Since we
know that root of the equuation is the point where the curve cuts x axis. From the graph we can see that
curve cuts near to x=1.35
4 y
3
Equation 1: y=x 3 +4 ⋅ x−1
2
1
x
−6 −5 −4 −3 −2 −1 1 2 3 4 5 6
−1
−2
−3
−4
0.4 y
0.3
0.2
0.1
x
−0.4 −0.2 0.2 0.4 0.6 0.8
−0.1
−0.2
−0.3
−0.4
−0.5
𝑥 3 + 4𝑥 − 1 = 0
𝑥(𝑥 2 + 4) = 1
1
𝑥=
(𝑥 2 + 4)
1
𝜑(𝑥) =
(𝑥 2 + 4)
−2𝑥
Taking Derivative 𝜑 ′ (𝑥 ) = (𝑥 2
+4)2
y
Equation 1: y=x 3 +4 ⋅ x−1
2
x
−3 −2 −1 1 2 3
−1
−2
𝑥 3 + 4𝑥 − 1 = 0
3
𝑥 = √√4𝑥 − 1
3
𝑔(𝑥 ) = 𝑥 = √√4𝑥 − 1
Bisection Method
Question
Solve by bisection method
1
2𝑥 + ( )𝑥 = 3
2
Solution
First of all, we will plot the given function to get an initial approxiation for the root of the equation. Since we
know that root of the equuation is the point where the curve cuts x axis. From the graph we can see that root
lies between 1 and 1.3
4 y
3
1 x
2 Equation 1: y=2 x+ −3
2
1
x
−6 −5 −4 −3 −2 −1 1 2 3 4 5 6
−1
−2
−3
−4
y
0.3
0.2
0.1
x
0
0.5 1 1.5
−0.1
−0.2
−0.3
−0.4
−0.5
−0.6
1st iteration :
Here f(1)=-0.5<0 and f(1.4)=0.01794>0
∴ Now, Root lies between 1 and 1.4
x0=(1+1.42)/2=1.2
f(x0)=f(1.2)=21.2+0.51.2-3=-0.26733<0
2nd iteration :
Here f(1.2)=-0.26733<0 and f(1.4)=0.01794>0
∴ Now, Root lies between 1.2 and 1.4
x1=(1.2+1.42)/2=1.3
f(x1)=f(1.3)=21.3+0.51.3-3=-0.13158<0
3rd iteration :
Here f(1.3)=-0.13158<0 and f(1.4)=0.01794>0
∴ Now, Root lies between 1.3 and 1.4
x2=(1.3+1.42)/2=1.35
f(x2)=f(1.35)=21.35+0.51.35-3=-0.05859<0
4th iteration :
Here f(1.35)=-0.05859<0 and f(1.4)=0.01794>0
∴ Now, Root lies between 1.35 and 1.4
x3=(1.35+1.42)/2=1.375
f(x3)=f(1.375)=21.375+0.51.375-3=-0.02077<0
5th iteration :
Here f(1.375)=-0.02077<0 and f(1.4)=0.01794>0
∴ Now, Root lies between 1.375 and 1.4
x4=(1.375+1.42)/2=1.3875
f(x4)=f(1.3875)=21.3875+0.51.3875-3=-0.00152<0
6th iteration :
Here f(1.3875)=-0.00152<0 and f(1.4)=0.01794>0
∴ Now, Root lies between 1.3875 and 1.4
x5=(1.3875+1.42)/2=1.39375
f(x5)=f(1.39375)=21.39375+0.51.39375-3=0.00818>0
7th iteration :
Here f(1.3875)=-0.00152<0 and f(1.39375)=0.00818>0
∴ Now, Root lies between 1.3875 and 1.39375
x6=(1.3875+1.393752)/2=1.39062
f(x6)=f(1.39062)=21.39062+0.51.39062-3=0.00332>0
8th iteration :
Here f(1.3875)=-0.00152<0 and f(1.39062)=0.00332>0
∴ Now, Root lies between 1.3875 and 1.39062
x7=(1.3875+1.390622)/2=1.38906
f(x7)=f(1.38906)=21.38906+0.51.38906-3=0.0009>0
9th iteration :
Here f(1.3875)=-0.00152<0 and f(1.38906)=0.0009>0
∴ Now, Root lies between 1.3875 and 1.38906
x8=(1.3875+1.389062)/2=1.38828
f(x8)=f(1.38828)=21.38828+0.51.38828-3=-0.00031<0
10th iteration :
Here f(1.38828)=-0.00031<0 and f(1.38906)=0.0009>0
∴ Now, Root lies between 1.38828 and 1.38906
x9=(1.38828+1.389062)/2=1.38867
f(x9)=f(1.38867)=21.38867+0.51.38867-3=0.00029>0
11th iteration :
Here f(1.38828)=-0.00031<0 and f(1.38867)=0.00029>0
∴ Now, Root lies between 1.38828 and 1.38867
x10=(1.38828+1.388672)/2=1.38848
f(x10)=f(1.38848)=21.38848+0.51.38848-3=-0.00001<0
12th iteration :
Here f(1.38848)=-0.00001<0 and f(1.38867)=0.00029>0
∴ Now, Root lies between 1.38848 and 1.38867
x11=(1.38848+1.388672)/2=1.38857
f(x11)=f(1.38857)=21.38857+0.51.38857-3=0.00014>0
13th iteration :
Here f(1.38848)=-0.00001<0 and f(1.38857)=0.00014>0
∴ Now, Root lies between 1.38848 and 1.38857
x12=(1.38848+1.388572)/2=1.38853
f(x12)=f(1.38853)=21.38853+0.51.38853-3=0.00006>0
14th iteration :
Here f(1.38848)=-0.00001<0 and f(1.38853)=0.00006>0
∴ Now, Root lies between 1.38848 and 1.38853
x13=(1.38848+1.388532)/2=1.3885
f(x13)=f(1.3885)=21.3885+0.51.3885-3=0.00003>0
15th iteration :
Here f(1.38848)=-0.00001<0 and f(1.3885)=0.00003>0
∴ Now, Root lies between 1.38848 and 1.3885
x14=(1.38848+1.38852)/2=1.38849
f(x14)=f(1.38849)=21.38849+0.51.38849-3=0.00001>0
16th iteration :
Here f(1.38848)=-0.00001<0 and f(1.38849)=0.00001>0
∴ Now, Root lies between 1.38848 and 1.38849
x15=(1.38848+1.388492)/2=1.38848
f(x15)=f(1.38848)=21.38848+0.51.38848-3=0<0
Approximate root of the equation 2x+(1/2)x-3=0 using Bisection mehtod is 1.38848 (After 16 iterations)
n a f(a) Sign f(a) b f(b) Sign f(b) c=a+b2 Error f(c) Sign f©
1 1 -0.5 - 1.4 0.01794 + 1.2 .1 -0.26733 -
2 1.2 -0.26733 - 1.4 0.01794 + 1.3 .05 -0.13158 -
3 1.3 -0.13158 - 1.4 0.01794 + 1.35 0.025 -0.05859 -
4 1.35 -0.05859 - 1.4 0.01794 + 1.375 0.0125 -0.02077 -
5 1.375 -0.02077 - 1.4 0.01794 + 1.3875 0.00625 -0.00152 -
6 1.3875 -0.00152 - 1.4 0.01794 + 1.39375 -0.00313 0.00818 +
7 1.3875 -0.00152 - 1.39375 0.00818 + 1.39062 -0.00156 0.00332 +
8 1.3875 -0.00152 - 1.39062 0.00332 + 1.38906 0.00078 0.0009 +
9 1.3875 -0.00152 - 1.38906 0.0009 + 1.38828 0.00039 -0.00031 -
10 1.38828 -0.00031 - 1.38906 0.0009 + 1.38867 -0.00019 0.00029 +
11 1.38828 -0.00031 - 1.38867 0.00029 + 1.38848 0.00001 -0.00001 -
12 1.38848 -0.00001 - 1.38867 0.00029 + 1.38857 -0.00004 0.00014 +
13 1.38848 -0.00001 - 1.38857 0.00014 + 1.38853 0.00001 0.00006 +
14 1.38848 -0.00001 - 1.38853 0.00006 + 1.38854 -0.00005 0.00003 +
15 1.38848 -0.00001 - 1.3885 0.00003 + 1.38849 -0.00001 0.00001 +
16 1.38848 -0.00001 - 1.38849 0.00001 + 1.38848 - -