Newton Method
Newton Method
(* newton method*)
f[x_] := x ^ 2 - 4x + 1
a = 0;
b = 1;
nmax = 10;
l = {};
Out[638]=
10
-2 -1 1 2 3
Out[640]//TableForm=
Iteration Root of the Equation Function Value
1 0. 1.
2 0.25 0.0625
3 0.267857 0.000318878
4 0.267949 8.47267 × 10-9
5 0.267949 0.
6 0.267949 0.
7 0.267949 0.
8 0.267949 0.
9 0.267949 0.
10 0.267949 0.
2
In[641]:=
f[x_] := x ^ 3 - 2 x ^ 2 + 1
a = 0;
b = 6;
nmax = 10;
l = {};
Out[646]=
400
300
200
100
-2 2 4 6 8
Out[648]//TableForm=
Iteration Root of the Equation Function Value
1 4.27381 42.5321
2 3.14567 12.3367
3 2.42435 3.49414
4 1.98401 0.937069
5 1.74206 0.2172
6 1.64037 0.0323056
7 1.61899 0.00132556
8 1.61804 2.60698 × 10-6
9 1.61803 1.01563 × 10-11
10 1.61803 0.
3
In[649]:=
f[x_] := x ^ 2 - 4x + 1
a = - 3;
b = 3;
nmax = 10;
l = {};
Out[654]=
40
30
20
10
-4 -2 2 4
Out[656]//TableForm=
Iteration Root of the Equation Function Value
1 4. 1.
2 3.75 0.0625
3 3.73214 0.000318878
4 3.73205 8.47268 × 10-9
5 3.73205 0.
6 3.73205 0.
7 3.73205 0.
8 3.73205 0.
9 3.73205 0.
10 3.73205 0.
4
In[657]:=
f[x_] := x ^ 2 + 3x+4
a = - 20;
b = 10;
nmax = 10;
l = {};
Out[662]=
400
300
200
100
Out[664]//TableForm=
Iteration Root of the Equation Function Value
1 4.17391 33.9433
2 1.18274 8.9471
3 - 0.484788 2.78066
4 - 1.85428 1.87552
5 0.792637 7.00619
6 - 0.735338 2.33471
7 - 2.26197 2.33059
8 - 0.732636 2.33885
9 - 2.25659 2.32242
10 - 0.721781 2.35563
5
In[665]:=
f[x_] := x ^ 3 - 5x + 1
a = - 5;
b = 10;
nmax = 10;
l = {};
Out[670]=
1500
1000
500
-5 5 10
Out[672]//TableForm=
Iteration Root of the Equation Function Value
1 6.77627 278.27
2 4.68013 80.111
3 3.36058 22.1497
4 2.59363 5.479
5 2.23271 0.966536
6 2.13562 0.0622248
7 2.12846 0.000328686
8 2.12842 9.34672 × 10-9
9 2.12842 3.55271 × 10-15
10 2.12842 - 1.77636 × 10-15