You are on page 1of 9

ASSIGNMENT OF:

NAME:
ZEESHAN

ROLL NO:

By Rooman khan
Bisection Method

4 × 𝑆𝑖𝑛(𝑥) = 𝑒 𝑥 [0,0.5]

Iteration 𝒙𝟏 𝒙𝟐 𝒙𝟑 f(𝒙𝟏 ) f(𝒙𝟐 ) 𝒇(𝒙𝟑)


No:

1 0 0.5 0.25 -1 0.26898 -0.29441


2 0.25 0.5 0.375 -0.2944 0.26898 0.01010
3 0.25 0.375 0.3125 -0.2944 0.1010 -0.13708
4 0.3125 0.375 0.34375 - 0.1010 -0.06214
0.137084
5 0.34375 0.375 0.359375 -0.06214 0.1010 -0.025
6 0.359375 0.375 0.3671875 -0.025 0.1010 -0.007
7 0.367187 0.375 0.3710937 -0.077 0.1010 0.00012
8 0.367187 0.37109 0.369140 -0.077 0.0012 -0.0032
9 0.369140 0.37109 0.370117 -0.0032 0.0012 -0.00100
10 0.370117 0.37109 0.370605 -0.00100 0.0012 0.000010
11 0.370117 0.37060 0.37036 -0.00100 0.000010 -0.00004
12 0.37036 0.370605 0.3704833 -0.00004 0.000010 -0.000017
13 0.3704833 0.370605 0.370544 -0.00001 0.000010 -0.0000015
14 0.370544 0.370605 0.370544 -0.00015 0.00000010 3.8
15 0.370544 0.370574 0.37055 -0.00015 0.000000038 0.00000036
Newton Raphson method

f(x) = 4 Sin(x) —𝑒 𝑥 [0,0.5]

But I take here 0 so: 𝑥0 = 0


𝑓 ′ (𝑥 ) = 4 cos(x) − ex

Iteration No 1
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
𝑓′(𝑥𝑛 )
Here n=0
𝑓(𝑥0 )
𝑥1 = 𝑥0 − 𝑥0 =0
𝑓′(𝑥0 )

𝑓(𝑥0 )= -1
𝑥1 = 0 – (- 1/3) 𝑓′(𝑥0 ) = 3
𝑥1 = 1/3
𝑥1 =0.33333333

Iteration no 2
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑥1 = 0.3333333
𝑓′(𝑥𝑛 )
Here n = 1
𝑓(𝑥1 )
𝑥2 = 𝑥1 − 𝑓(𝑥1 ) = -0.08691
𝑓′(𝑥1 )

𝑥2 =0.333 – (-0.08691/2.3843) 𝑓′(𝑥1 )= 2.3843

𝑥2 = 0.369751

Iteration no 3

𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑥2 = 0.369751
𝑓′(𝑥𝑛 )

Here n = 2
𝑓(𝑥2 )
𝑥3 = 𝑥2 − 𝑓 (𝑥2 ) = 0.086833
𝑓′(𝑥2 )

0.086833
𝑥3 = 0.369751 + 𝑓 ′ (𝑥2 ) = 2.28244
2.28244

𝑥3 = 0.370558

Iteration no 4
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − 𝑥3 = 0.370558
𝑓′(𝑥𝑛 )

Here n = 3 𝑓 (𝑥3 ) = 0000012


𝑓(𝑥3 )
𝑥4 = 𝑥3 − 𝑓 ′ (𝑥3 ) = 0.00255
𝑓′(𝑥3 )

0.0000012
𝑥4 = 0.370558 +
0.00255

𝑥4 = 0.370558

So that the repetition occurred up to 4 decimal places so we stop the


procedure

Regula false method

𝑓(𝑥 ) = 4 sin(𝑥 ) − 𝑒 𝑥 [0,0.5]

𝑎𝑓(𝑏)−𝑏𝑓(𝑎)
Formula : 𝑥1 =
𝑓(𝑏)−𝑓(𝑎)

Iteration no 1:

As: 𝑥1 =
𝑎𝑓(𝑏)−𝑏𝑓(𝑎)
a=0 , f(a)= -1
𝑓(𝑏)−𝑓(𝑎)

b=0.5 , f(b)=0.26
0(0.26) − (0.5)(−1)
𝑥1 =
0.26 − (−1)

0.5
𝑥1 =
0.261
𝑥1 = 0.3743
Iteration no 2:

As: 𝑥2 =
𝑎𝑓(𝑥1 )−𝑥1 𝑓(𝑎)
a=0, f (a) =-1
𝑓(𝑥1 )−𝑓(𝑎)

𝑥1 = 0.3743, 𝑓(𝑥1 ) = 0.0085116


0.374
𝑥2 =
0.0085116+1

𝑥2 = 0.371141

Iteration no 3:

As: 𝑥3 =
𝑎𝑓(𝑥2 )−𝑥2 𝑓(𝑎)
a=0, f (a) = -1
𝑓(𝑥2 )−𝑓(𝑎)

𝑥2 = 0.371131, 𝑓(𝑥2 ) = 0.0013284


0(0.0013284)−0.371141(−1)
𝑥3 =
0.0013284+1

𝑥3 = 0.370649

Iteration no 4
As: 𝑥4 =
𝑎𝑓(𝑥3 )−𝑥3 𝑓(𝑎)
a=0, f (a) = -1
𝑓(𝑥3 )−𝑓(𝑎)

𝑥3 = 0.370649 , f (𝑥3 ) = 0.0002


0.370649
𝑥4 =
0.0002 + 1
𝑥4 = 0.370572

Iteration no 5

: 𝑥5 =
𝑎𝑓(𝑥4 )−𝑥4 𝑓(𝑎)
a=0, f (a) = -1
𝑓(𝑥4 )−𝑓(𝑎)

𝑥4 = 0.370572, f (𝑥4 )=0.0002


𝑥5 = 0.37056

Iteration no 6
𝑎𝑓(𝑥5 )−𝑥5 𝑓(𝑎)
𝑥6 = a=0, f (a) = -1
𝑓(𝑥5 )−𝑓(𝑎)

𝑥5 = 0.37056,

f (𝑥5 ) = 0.00000041

𝑥6 = 0.37056
So that the repetition occurred up to 4 decimal places so we stop the
procedure

Secant method

𝑓(𝑥 ) = 4 sin(𝑥 ) − 𝑒 𝑥 [0,0.5]

𝑓(𝑥𝑖 )(𝑥𝑖 −𝑥𝑖−1 )


Formula : 𝑥𝑖+1 = 𝑥𝑖 −
𝑓(𝑥𝑖 )−𝑓(𝑥𝑖−1 )

Iteration no 1
0.2689(−0.5−0)
𝑥2 = 0.5 − 𝑥0 = 0, 𝑓(𝑥0 ) = −1
0.2689+1

𝑥2 = 0.3940170 𝑥1 = 0.5, 𝑓(𝑥1 ) = 0.2689

Iteration no 2:
𝑓(𝑥2 )(𝑥2 −𝑥1 )
𝑥3 = 𝑥2 − 𝑥1 = 0.5, 𝑓(𝑥1 ) = 0.2689
𝑓(𝑥2 )−𝑓(𝑥1 )

𝑥3 = 0.3682067 𝑥2 = 0.3940170,

𝑓(𝑥2 ) = 0.0526
Iteration no 3:
𝑓(𝑥3 )(𝑥3 −𝑥2 )
𝑥4 = 𝑥3 − 𝑥2 = 0.39401, f (𝑥2 ) = 0.05
𝑓(𝑥3 )−𝑓(𝑥2 )

𝑥4 = 0.3705941 𝑥3 = 0.3682067

f (𝑥3 ) =-0.025810

Iteration no 4:
𝑓(𝑥4 )(𝑥4 −𝑥3 )
𝑥5 = 𝑥4 − 𝑥3 = 0.3682067
𝑓(𝑥4 )−𝑓(𝑥3 )

f (𝑥3 ) =-0.025810

𝑥5 = 0.3705941 𝑥4 = 0.3705941

f(𝑥4 ) = 0.00000012

You might also like