Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

1-Bisection Method: Equation Number One (3 X+sin (X) - Exp (X) )

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Equation number one (3*x+sin(x)-exp(x))

1- Bisection Method
Enter the Equation : 3*x+sin(x)-exp(x)
Enter First approximate Number x0 : 0
Enter Second approximate Number x1 : 1

The Equation is >> 3*x+sin(x)-exp(x) <<


Actual Root is 0.360422
Iteration x0 x1 x2 f(x2) Absolute Error Maximum Error
1 0.000000 1.000000 0.500000 0.330704 0.139578 0.500000
2 0.000000 0.500000 0.250000 -0.286621 0.110422 0.250000
3 0.250000 0.500000 0.375000 0.036281 0.014578 0.125000
4 0.250000 0.375000 0.312500 -0.121899 0.047922 0.062500
5 0.312500 0.375000 0.343750 -0.041956 0.016672 0.031250
6 0.343750 0.375000 0.359375 -0.002620 0.001047 0.015625
7 0.359375 0.375000 0.367188 0.016886 0.006766 0.007813
8 0.359375 0.367188 0.363281 0.007147 0.002860 0.003906
9 0.359375 0.363281 0.361328 0.002267 0.000906 0.001953
10 0.359375 0.361328 0.360352 -0.000175 0.000070 0.000977
11 0.360352 0.361328 0.360840 0.001046 0.000418 0.000488
12 0.360352 0.360840 0.360596 0.000435 0.000174 0.000244
13 0.360352 0.360596 0.360474 0.000130 0.000052 0.000122
14 0.360352 0.360474 0.360413 -0.000023 0.000009 0.000061
15 0.360413 0.360474 0.360443 0.000054 0.000021 0.000031
16 0.360413 0.360443 0.360428 0.000015 0.000006 0.000015
17 0.360413 0.360428 0.360420 -0.000004 0.000001 0.000008
18 0.360420 0.360428 0.360424 0.000006 0.000002 0.000004
2- Secant Method
Enter the Equation : 3*x+sin(x)-exp(x)
Enter First approximate Number x0 : 0
Enter Second approximate Number x1 : 1
The Equation is >> 2*x^3+x^2-3*x-3 <<
Actual Root is 0.360422
Iteration x0 x1 x2 f(x2) Absolute Error Maximum Error
1 1.000000 0.000000 0.529010 0.394459 0.168589 0.500000
2 0.000000 0.529010 0.379366 0.047072 0.018944 0.250000
3 0.529010 0.379366 0.359089 -0.003336 0.001333 0.125000
4 0.379366 0.359089 0.360431 0.000023 0.000009 0.062500
5 0.359089 0.360431 0.360422 0.000000 0.000000 0.031250

3- False position Method


Enter the Equation : 3*x+sin(x)-exp(x)
Enter First approximate Number x0 : 0
Enter Second approximate Number x1 : 1
The Equation is >> 3*x+sin(x)-exp(x) <<
Actual Root is 0.360422
Iteration x0 x1 x2 f(x2) Absolute Error Maximum Error
1 0.000000 1.000000 0.470990 0.265159 0.110568 0.500000
2 0.000000 0.470990 0.221831 0.362851- 0.138591 0.250000
3 0.221831 0.470990 0.339182 0.053536- 0.021239 0.125000
4 0.339182 0.470990 0.401262 0.100658 0.040840 0.062500
5 0.339182 0.401262 0.368421 0.019956 0.007999 0.031250
6 0.339182 0.368421 0.352953 0.018734- 0.007468 0.015625
7 0.352953 0.368421 0.360239 0.000458- 0.000183 0.007813
8 0.360239 0.368421 0.364093 0.009172 0.003671 0.003906
9 0.360239 0.364093 0.362054 0.004081 0.001632 0.001953
10 0.360239 0.362054 0.361094 0.001680 0.000672 0.000977
11 0.360239 0.361094 0.360641 0.000549 0.000220 0.000488
12 0.360239 0.360641 0.360428 0.000016 0.000007 0.000244
13 0.360239 0.360428 0.360328 0.000235- 0.000094 0.000122
14 0.360328 0.360428 0.360375 0.000116- 0.000047 0.000061
15 0.360375 0.360428 0.360400 0.000054- 0.000022 0.000031
16 0.360400 0.360428 0.360413 0.000021- 0.000008 0.000015
17 0.360413 0.360428 0.360420 -0.000003 0.000001 0.000008

4- Newton Method
Enter the Equation : 3*x+sin(x)-exp(x)

Enter First approximate Number x0 : 0

The Equation is >> 3*x+sin(x)-exp(x) <<

Actual Root is 0.360422

Iteration x0 x1 f(x1) Absolute Error

1 0.000000 0.333333 -0.068418 0.027088


Second Equation (2*x^3+x^2-3*x-3)
1- Bisection
Enter the Equation : 2*x^3+x^2-3*x-3
Enter First approximate Number x0 : 1
Enter Second approximate Number x1 : 2
The Equation is >> 2*x^3+x^2-3*x-3 <<
Actual Root is 1.378161
Iteration x0 x1 x2 f(x2) Absolute Error Maximum Error
1 1.000000 2.000000 1.500000 1.500000 0.121839 0.500000
2 1.000000 1.500000 1.250000 -1.281250 0.128161 0.250000
3 1.250000 1.500000 1.375000 -0.035156 0.003161 0.125000
4 1.375000 1.500000 1.437500 0.694824 0.059339 0.062500
5 1.375000 1.437500 1.406250 0.320618 0.028089 0.031250
6 1.375000 1.406250 1.390625 0.140450 0.012464 0.015625
7 1.375000 1.390625 1.382813 0.052079 0.004652 0.007813
8 1.375000 1.382813 1.378906 0.008320 0.000746 0.003906
9 1.375000 1.378906 1.376953 -0.013453 0.001208 0.001953
10 1.376953 1.378906 1.377930 -0.002576 0.000231 0.000977
11 1.377930 1.378906 1.378418 0.002870 0.000257 0.000488
12 1.377930 1.378418 1.378174 0.000147 0.000013 0.000244
13 1.377930 1.378174 1.378052 -0.001215 0.000109 0.000122
14 1.378052 1.378174 1.378113 -0.000534 0.000048 0.000061
15 1.378113 1.378174 1.378143 -0.000194 0.000017 0.000031
16 1.378143 1.378174 1.378159 -0.000024 0.000002 0.000015
17 1.378159 1.378174 1.378166 0.000062 0.000006 0.000008
18 1.378159 1.378166 1.378162 0.000019 0.000002 0.000004
19 1.378159 1.378162 1.378160 -0.000002 0.000000 0.000002

2- Secant Method
Enter First approximate Number x0 : 1
Enter Second approximate Number x1 : 2
The Equation is >> 2*x^3+x^2-3*x-3 <<
Actual Root is 1.378161
Iteration x0 x1 x2 f(x2) Absolute Error Maximum Error
1 2.000000 1.000000 1.785714 6.220117 0.407554 0.500000
2 1.785714 1.000000 1.530062 1.914930 0.151901 0.250000
3 1.000000 1.530062 1.323542 -0.581798 0.054619 0.125000
4 1.530062 1.323542 1.371666 -0.072038 0.006495 0.062500
5 1.323542 1.371666 1.378467 0.003417 0.000306 0.031250
6 1.371666 1.378467 1.378159 -0.000019 0.000002 0.015625
7 1.378467 1.378159 1.378161 -0.000000 0.000000 0.007813

3- False Method
Enter the Equation : 2*x^3+x^2-3*x-3
Enter First approximate Number x0 : 1
Enter Second approximate Number x1 : 2
The Equation is >> 2*x^3+x^2-3*x-3 <<
Actual Root is 1.378161
Iteration x0 x1 x2 f(x2) Absolute Error Maximum Error
1 1.000000 2.000000 1.214286 -1.587464 0.163875 0.500000
2 1.214286 2.000000 1.382653 0.050288 0.004492 0.250000
3 1.214286 1.382653 1.250364 -1.278015 0.127796 0.125000
4 1.250364 1.382653 1.278712 -1.019376 0.099449 0.062500
5 1.278712 1.382653 1.300985 -0.806397 0.077176 0.031250
6 1.300985 1.382653 1.318485 -0.632933 0.059675 0.015625
7 1.318485 1.382653 1.332236 -0.492814 0.045925 0.007813
8 1.332236 1.382653 1.343039 -0.380337 0.035121 0.003906
9 1.343039 1.382653 1.351528 -0.290479 0.026633 0.001953
10 1.351528 1.382653 1.358198 -0.218955 0.019963 0.000977
11 1.358198 1.382653 1.363438 -0.162188 0.014723 0.000488
12 1.363438 1.382653 1.367556 -0.117231 0.010605 0.000244
13 1.367556 1.382653 1.370791 -0.081689 0.007370 0.000122
14 1.370791 1.382653 1.373333 -0.053627 0.004828 0.000061
15 1.373333 1.382653 1.375330 -0.031495 0.002831 0.000031
16 1.375330 1.382653 1.376899 -0.014054 0.001262 0.000015
17 1.376899 1.382653 1.378132 -0.000318 0.000029 0.000008
18 1.378132 1.382653 1.379101 0.010494 0.000940 0.000004
19 1.378132 1.379101 1.378340 0.001997 0.000179 0.000002
20 1.378132 1.378340 1.378177 0.000178 0.000016 0.000001
21 1.378132 1.378177 1.378142 -0.000212 0.000019 0.000000
22 1.378142 1.378177 1.378149 -0.000129 0.000012 0.000000
23 1.378149 1.378177 1.378155 -0.000063 0.000006 0.000000
24 1.378155 1.378177 1.378160 -0.000011 0.000001 0.000000
25 1.378160 1.378177 1.378163 0.000029 0.000003 0.000000
26 1.378160 1.378163 1.378160 -0.000003 0.000000 0.000000

4- Newton Method
Enter the Equation : 2*x^3+x^2-3*x-3
Enter First approximate Number x0 : 1
The Equation is >> 2*x^3+x^2-3*x-3 <<
Actual Root is 1.378161
Iteration x0 x1 f(x1) Absolute Error
1 1.000000 1.600000 2.952000 0.221839
2 1.600000 1.410283 0.367865 0.032122
3 1.410283 1.378986 0.009207 0.000825
4 1.378986 1.378161 0.000006 0.000001

You might also like