You are on page 1of 23

PRACTICAL - 1

BISECTION METHOD

Aim - Developing the numerical programs using Bisection Method.


In[1]:= x0 = 0;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := Cos[x];
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
2 Prac2(Bisection Method).nb

1th iteration value is:1.

Estimated error in1th iteration is:1.

2th iteration value is:1.5

Estimated error in2th iteration is:0.5

3th iteration value is:1.75

Estimated error in3th iteration is:0.25

4th iteration value is:1.625

Estimated error in4th iteration is:0.125

5th iteration value is:1.5625

Estimated error in5th iteration is:0.0625

6th iteration value is:1.59375

Estimated error in6th iteration is:0.03125

7th iteration value is:1.57813

Estimated error in7th iteration is:0.015625

8th iteration value is:1.57031

Estimated error in8th iteration is:0.0078125

9th iteration value is:1.57422

Estimated error in9th iteration is:0.00390625

10th iteration value is:1.57227

Estimated error in10th iteration is:0.00195313

11th iteration value is:1.57129

Estimated error in11th iteration is:0.000976563

12th iteration value is:1.5708

Estimated error in12th iteration is:0.000488281

13th iteration value is:1.57056

Estimated error in13th iteration is:0.000244141

14th iteration value is:1.57068

Estimated error in14th iteration is:0.00012207


Out[6]= Return[1.57074]
1.0

0.5

Out[7]=
-1 1 2 3

-0.5

-1.0
Prac2(Bisection Method).nb 3

x0 = 0;
x1 = 1.0;
Nmax = 20;
eps = 0.0001;
f[x_] := x ^ 3 - 5 x + 1;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
1th iteration value is:0.5

Estimated error in1th iteration is:0.5

2th iteration value is:0.25

Estimated error in2th iteration is:0.25

3th iteration value is:0.125

Estimated error in3th iteration is:0.125

4th iteration value is:0.1875

Estimated error in4th iteration is:0.0625

5th iteration value is:0.21875

Estimated error in5th iteration is:0.03125

6th iteration value is:0.203125

Estimated error in6th iteration is:0.015625

7th iteration value is:0.195313

Estimated error in7th iteration is:0.0078125

8th iteration value is:0.199219

Estimated error in8th iteration is:0.00390625

9th iteration value is:0.201172

Estimated error in9th iteration is:0.00195313

10th iteration value is:0.202148

Estimated error in10th iteration is:0.000976563

11th iteration value is:0.20166

Estimated error in11th iteration is:0.000488281

12th iteration value is:0.201416

Estimated error in12th iteration is:0.000244141

13th iteration value is:0.201538

Estimated error in13th iteration is:0.00012207


Return[0.201599]
4 Prac2(Bisection Method).nb

1.0

0.5

-1 1 2 3

-0.5

-1.0

In[15]:= x0 = 0;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := Cos[x] - x Exp[x];
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
Prac2(Bisection Method).nb 5

1th iteration value is:1.

Estimated error in1th iteration is:1.

2th iteration value is:0.5

Estimated error in2th iteration is:0.5

3th iteration value is:0.75

Estimated error in3th iteration is:0.25

4th iteration value is:0.625

Estimated error in4th iteration is:0.125

5th iteration value is:0.5625

Estimated error in5th iteration is:0.0625

6th iteration value is:0.53125

Estimated error in6th iteration is:0.03125

7th iteration value is:0.515625

Estimated error in7th iteration is:0.015625

8th iteration value is:0.523438

Estimated error in8th iteration is:0.0078125

9th iteration value is:0.519531

Estimated error in9th iteration is:0.00390625

10th iteration value is:0.517578

Estimated error in10th iteration is:0.00195313

11th iteration value is:0.518555

Estimated error in11th iteration is:0.000976563

12th iteration value is:0.518066

Estimated error in12th iteration is:0.000488281

13th iteration value is:0.517822

Estimated error in13th iteration is:0.000244141

14th iteration value is:0.5177

Estimated error in14th iteration is:0.00012207


Out[20]= Return[0.517761]
1.0

0.5

Out[21]=
-1 1 2 3

-0.5

-1.0
6 Prac2(Bisection Method).nb

x0 = - 1;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := 8 x ^ 3 - 12 x ^ 2 - 2 x + 3;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
1th iteration value is:0.5

Estimated error in1th iteration is:1.5

2th iteration value is:1.25

Estimated error in2th iteration is:0.75

3th iteration value is:1.625

Estimated error in3th iteration is:0.375

4th iteration value is:1.4375

Estimated error in4th iteration is:0.1875

5th iteration value is:1.53125

Estimated error in5th iteration is:0.09375

6th iteration value is:1.48438

Estimated error in6th iteration is:0.046875

7th iteration value is:1.50781

Estimated error in7th iteration is:0.0234375

8th iteration value is:1.49609

Estimated error in8th iteration is:0.0117188

9th iteration value is:1.50195

Estimated error in9th iteration is:0.00585938

10th iteration value is:1.49902

Estimated error in10th iteration is:0.00292969

11th iteration value is:1.50049

Estimated error in11th iteration is:0.00146484

12th iteration value is:1.49976

Estimated error in12th iteration is:0.000732422

13th iteration value is:1.50012

Estimated error in13th iteration is:0.000366211

14th iteration value is:1.49994

Estimated error in14th iteration is:0.000183105


Return[1.50003]
Prac2(Bisection Method).nb 7

1.0

0.5

-1 1 2 3

-0.5

-1.0

x0 = - 3;
x1 = - 2;
Nmax = 20;
eps = 0.0001;
f[x_] := 3 x ^ 3 + 10 x ^ 2 + 10 x + 7;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 5, 3}, PlotRange → {- 1, 1}]
8 Prac2(Bisection Method).nb

5
1th iteration value is:-
2
1
Estimated error in1th iteration is:
2
9
2th iteration value is:-
4
1
Estimated error in2th iteration is:
4
19
3th iteration value is:-
8
1
Estimated error in3th iteration is:
8
37
4th iteration value is:-
16
1
Estimated error in4th iteration is:
16
75
5th iteration value is:-
32
1
Estimated error in5th iteration is:
32
149
6th iteration value is:-
64
1
Estimated error in6th iteration is:
64
299
7th iteration value is:-
128
1
Estimated error in7th iteration is:
128
597
8th iteration value is:-
256
1
Estimated error in8th iteration is:
256
1195
9th iteration value is:-
512
1
Estimated error in9th iteration is:
512
2389
10th iteration value is:-
1024
1
Estimated error in10th iteration is:
1024
4779
11th iteration value is:-
2048
1
Estimated error in11th iteration is:
2048
9557
12th iteration value is:-
4096
1
Estimated error in12th iteration is:
4096
19 115
13th iteration value is:-
8192
1
Estimated error in13th iteration is:
8192

Return- 38 229 
16 384
Prac2(Bisection Method).nb 9

1.0

0.5

-4 -2 2

-0.5

-1.0

x0 = 0;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := Cos[x] - x;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
10 Prac2(Bisection Method).nb

1th iteration value is:1.

Estimated error in1th iteration is:1.

2th iteration value is:0.5

Estimated error in2th iteration is:0.5

3th iteration value is:0.75

Estimated error in3th iteration is:0.25

4th iteration value is:0.625

Estimated error in4th iteration is:0.125

5th iteration value is:0.6875

Estimated error in5th iteration is:0.0625

6th iteration value is:0.71875

Estimated error in6th iteration is:0.03125

7th iteration value is:0.734375

Estimated error in7th iteration is:0.015625

8th iteration value is:0.742188

Estimated error in8th iteration is:0.0078125

9th iteration value is:0.738281

Estimated error in9th iteration is:0.00390625

10th iteration value is:0.740234

Estimated error in10th iteration is:0.00195313

11th iteration value is:0.739258

Estimated error in11th iteration is:0.000976563

12th iteration value is:0.73877

Estimated error in12th iteration is:0.000488281

13th iteration value is:0.739014

Estimated error in13th iteration is:0.000244141

14th iteration value is:0.739136

Estimated error in14th iteration is:0.00012207


Return[0.739075]
1.0

0.5

-1 1 2 3

-0.5

-1.0
Prac2(Bisection Method).nb 11

x0 = 0;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := Sin[x];
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
1th iteration value is:1.

Estimated error in1th iteration is:1.

2th iteration value is:0.5

Estimated error in2th iteration is:0.5

3th iteration value is:0.25

Estimated error in3th iteration is:0.25

4th iteration value is:0.125

Estimated error in4th iteration is:0.125

5th iteration value is:0.0625

Estimated error in5th iteration is:0.0625

6th iteration value is:0.03125

Estimated error in6th iteration is:0.03125

7th iteration value is:0.015625

Estimated error in7th iteration is:0.015625

8th iteration value is:0.0078125

Estimated error in8th iteration is:0.0078125

9th iteration value is:0.00390625

Estimated error in9th iteration is:0.00390625

10th iteration value is:0.00195313

Estimated error in10th iteration is:0.00195313

11th iteration value is:0.000976563

Estimated error in11th iteration is:0.000976563

12th iteration value is:0.000488281

Estimated error in12th iteration is:0.000488281

13th iteration value is:0.000244141

Estimated error in13th iteration is:0.000244141

14th iteration value is:0.00012207

Estimated error in14th iteration is:0.00012207


Return[0.0000610352]
12 Prac2(Bisection Method).nb

1.0

0.5

-1 1 2 3

-0.5

-1.0

x0 = 0;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := x3 + 2 x2 - 3 x - 1;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
Prac2(Bisection Method).nb 13

1th iteration value is:1.

Estimated error in1th iteration is:1.

2th iteration value is:1.5

Estimated error in2th iteration is:0.5

3th iteration value is:1.25

Estimated error in3th iteration is:0.25

4th iteration value is:1.125

Estimated error in4th iteration is:0.125

5th iteration value is:1.1875

Estimated error in5th iteration is:0.0625

6th iteration value is:1.21875

Estimated error in6th iteration is:0.03125

7th iteration value is:1.20313

Estimated error in7th iteration is:0.015625

8th iteration value is:1.19531

Estimated error in8th iteration is:0.0078125

9th iteration value is:1.19922

Estimated error in9th iteration is:0.00390625

10th iteration value is:1.19727

Estimated error in10th iteration is:0.00195313

11th iteration value is:1.19824

Estimated error in11th iteration is:0.000976563

12th iteration value is:1.19873

Estimated error in12th iteration is:0.000488281

13th iteration value is:1.19849

Estimated error in13th iteration is:0.000244141

14th iteration value is:1.19861

Estimated error in14th iteration is:0.00012207


Return[1.19867]
1.0

0.5

-1 1 2 3

-0.5

-1.0
14 Prac2(Bisection Method).nb

x0 = 0.42;
x1 = 0.48;
Nmax = 20;
eps = 0.0001;
f[x_] := Tan[π x] - x - 6;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
1th iteration value is:0.45

Estimated error in1th iteration is:0.03

2th iteration value is:0.465

Estimated error in2th iteration is:0.015

3th iteration value is:0.4575

Estimated error in3th iteration is:0.0075

4th iteration value is:0.45375

Estimated error in4th iteration is:0.00375

5th iteration value is:0.451875

Estimated error in5th iteration is:0.001875

6th iteration value is:0.450938

Estimated error in6th iteration is:0.0009375

7th iteration value is:0.451406

Estimated error in7th iteration is:0.00046875

8th iteration value is:0.451172

Estimated error in8th iteration is:0.000234375

9th iteration value is:0.451055

Estimated error in9th iteration is:0.000117188


Return[0.450996]
1.0

0.5

-1 1 2 3

-0.5

-1.0
Prac2(Bisection Method).nb 15

x0 = 2;
x1 = 3;
Nmax = 20;
eps = 0.0001;
f[x_] := 1 - Log[x];
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
16 Prac2(Bisection Method).nb

5
1th iteration value is:
2
1
Estimated error in1th iteration is:
2
11
2th iteration value is:
4
1
Estimated error in2th iteration is:
4
21
3th iteration value is:
8
1
Estimated error in3th iteration is:
8
43
4th iteration value is:
16
1
Estimated error in4th iteration is:
16
87
5th iteration value is:
32
1
Estimated error in5th iteration is:
32
173
6th iteration value is:
64
1
Estimated error in6th iteration is:
64
347
7th iteration value is:
128
1
Estimated error in7th iteration is:
128
695
8th iteration value is:
256
1
Estimated error in8th iteration is:
256
1391
9th iteration value is:
512
1
Estimated error in9th iteration is:
512
2783
10th iteration value is:
1024
1
Estimated error in10th iteration is:
1024
5567
11th iteration value is:
2048
1
Estimated error in11th iteration is:
2048
11 135
12th iteration value is:
4096
1
Estimated error in12th iteration is:
4096
22 269
13th iteration value is:
8192
1
Estimated error in13th iteration is:
8192

Return 44 537 
16 384
Prac2(Bisection Method).nb 17

1.0

0.5

0.5 1.0 1.5 2.0 2.5 3.0

-0.5

-1.0

x0 = 1;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := x6 - 3;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
18 Prac2(Bisection Method).nb

1th iteration value is:1.5

Estimated error in1th iteration is:0.5

2th iteration value is:1.25

Estimated error in2th iteration is:0.25

3th iteration value is:1.125

Estimated error in3th iteration is:0.125

4th iteration value is:1.1875

Estimated error in4th iteration is:0.0625

5th iteration value is:1.21875

Estimated error in5th iteration is:0.03125

6th iteration value is:1.20313

Estimated error in6th iteration is:0.015625

7th iteration value is:1.19531

Estimated error in7th iteration is:0.0078125

8th iteration value is:1.19922

Estimated error in8th iteration is:0.00390625

9th iteration value is:1.20117

Estimated error in9th iteration is:0.00195313

10th iteration value is:1.2002

Estimated error in10th iteration is:0.000976563

11th iteration value is:1.20068

Estimated error in11th iteration is:0.000488281

12th iteration value is:1.20093

Estimated error in12th iteration is:0.000244141

13th iteration value is:1.20105

Estimated error in13th iteration is:0.00012207


Return[1.20099]
1.0

0.5

-1 1 2 3

-0.5

-1.0
Prac2(Bisection Method).nb 19

x0 = 0;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := x * Sin[x];
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 2}]
1th iteration value is:1.

Estimated error in1th iteration is:1.

2th iteration value is:0.5

Estimated error in2th iteration is:0.5

3th iteration value is:0.25

Estimated error in3th iteration is:0.25

4th iteration value is:0.125

Estimated error in4th iteration is:0.125

5th iteration value is:0.0625

Estimated error in5th iteration is:0.0625

6th iteration value is:0.03125

Estimated error in6th iteration is:0.03125

7th iteration value is:0.015625

Estimated error in7th iteration is:0.015625

8th iteration value is:0.0078125

Estimated error in8th iteration is:0.0078125

9th iteration value is:0.00390625

Estimated error in9th iteration is:0.00390625

10th iteration value is:0.00195313

Estimated error in10th iteration is:0.00195313

11th iteration value is:0.000976563

Estimated error in11th iteration is:0.000976563

12th iteration value is:0.000488281

Estimated error in12th iteration is:0.000488281

13th iteration value is:0.000244141

Estimated error in13th iteration is:0.000244141

14th iteration value is:0.00012207

Estimated error in14th iteration is:0.00012207


Return[0.0000610352]
20 Prac2(Bisection Method).nb

2.0

1.5

1.0

0.5

-1 1 2 3

-0.5

-1.0

x0 = 0.5;
x1 = 2.0;
Nmax = 20;
eps = 0.0001;
f[x_] := x Cos1  x;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 2}]
Prac2(Bisection Method).nb 21

1th iteration value is:1.25

Estimated error in1th iteration is:0.75

2th iteration value is:0.875

Estimated error in2th iteration is:0.375

3th iteration value is:0.6875

Estimated error in3th iteration is:0.1875

4th iteration value is:0.59375

Estimated error in4th iteration is:0.09375

5th iteration value is:0.640625

Estimated error in5th iteration is:0.046875

6th iteration value is:0.617188

Estimated error in6th iteration is:0.0234375

7th iteration value is:0.628906

Estimated error in7th iteration is:0.0117188

8th iteration value is:0.634766

Estimated error in8th iteration is:0.00585938

9th iteration value is:0.637695

Estimated error in9th iteration is:0.00292969

10th iteration value is:0.63623

Estimated error in10th iteration is:0.00146484

11th iteration value is:0.636963

Estimated error in11th iteration is:0.000732422

12th iteration value is:0.636597

Estimated error in12th iteration is:0.000366211

13th iteration value is:0.63678

Estimated error in13th iteration is:0.000183105


Return[0.636688]
2.0

1.5

1.0

0.5

-1 1 2 3

-0.5

-1.0
22 Prac2(Bisection Method).nb

x0 = 0.2;
x1 = 0.4;
Nmax = 20;
eps = 0.0001;
f[x_] := x * Sin1  x;
IfN[f[x0] * f[x1]] > 0,
Print["These values do not satisfy the IVP so change the values."],
Fori = 1, i ≤ Nmax, i ++, a = x0 + x1  2;
IfAbsx1 - x0  2 < eps, Return[a], Print[i, "th iteration value is:", a];
Print"Estimated error in", i, "th iteration is:", x1 - x0  2;
If[f[a] * f[x1] > 0, x1 = a, x0 = a];
Print["Root is:", a]
Plot[f[x], {x, - 1, 3}, PlotRange → {- 1, 1}]
1th iteration value is:0.3

Estimated error in1th iteration is:0.1

2th iteration value is:0.35

Estimated error in2th iteration is:0.05

3th iteration value is:0.325

Estimated error in3th iteration is:0.025

4th iteration value is:0.3125

Estimated error in4th iteration is:0.0125

5th iteration value is:0.31875

Estimated error in5th iteration is:0.00625

6th iteration value is:0.315625

Estimated error in6th iteration is:0.003125

7th iteration value is:0.317188

Estimated error in7th iteration is:0.0015625

8th iteration value is:0.317969

Estimated error in8th iteration is:0.00078125

9th iteration value is:0.318359

Estimated error in9th iteration is:0.000390625

10th iteration value is:0.318164

Estimated error in10th iteration is:0.000195313


Return[0.318262]
Prac2(Bisection Method).nb 23

1.0

0.5

-1 1 2 3

-0.5

-1.0

You might also like