You are on page 1of 11

x5 − x4 = 2x3 − x2 +x+1

a. x5 − x4 - 2x3 + x2 - x - 1 = 0

b1. g(x) = x = x5 − x4 - 2x3 + x2 - 1


g'(x) = 5x^4-4x^3-6x^2+2x
g'(0.5)=5(0.5)^4-4(0.5)^3-6(0.5)^2+2(0.5)
g'(0.5) -0.6875
|g'(0.5)| 0.6875 <1
therefore, will converge

b2. x^2 = - x5 + x4 + 2x3 +x+1


x = sqrt (- x5 + x4 + 2x3 +x+1)
So g(x) = sqrt (- x5 + x4 + 2x3 +x+1) = (- x^5 + x^4 + 2x^3 +x+1)^1/2
And g'(x) = (1/2) (- x^5 + x^4 + 2x^3 +x+1)^(-1/2) (-5x^4 +4x^3 +6x^2 + 1)
g'(0.5) = -0.11
l g'(0.5) l = 0.11 < 1 so there will be convergence.

From b1 and b2, x = g(x) for b2 will converge faster than in b1.

You may try other equations of the form x = g(x)


e^-2x = (x^3 + 2x + 2)/10 e^(-2x^2) = (x^3 + 2x + 2)/
-2x = ln [(x^3 + 2x + 2)/10] -2x^2 = ln [(x^3 + 2x + 2)/1
x =(-1/2) ln [(x^3 + 2x + 2)/10] x^2 =(-1/2) ln [(x^3 + 2x
So g(x) = (-1/2) ln [(x^3 + 2x + 2)/10] x = sqrt {(-1/2) ln [(x^3 +
So g(x) = sqrt {(-1/2) ln [(x^
k x Error
0 -0.5 MOSS
1 1.2181 1.7181 k x
2 0.2355 0.9825 0 -0.5
3 0.6963 0.4608 1 1.103657
4 0.493 0.2033 2 0.542445
5 0.5846 0.0916 3 0.750208
7 0.544 0.0407 4 0.684039
8 0.5621 0.0182 5 0.706208
9 0.554 0.0081 7 0.698905
10 0.5577 0.0036 8 0.701325
9 0.700525
10 0.700789
^2) = (x^3 + 2x + 2)/10
= ln [(x^3 + 2x + 2)/10]
(-1/2) ln [(x^3 + 2x + 2)/10]
qrt {(-1/2) ln [(x^3 + 2x + 2)/10]}
= sqrt {(-1/2) ln [(x^3 + 2x + 2)/10]}

Error

1.603657
0.561212
0.207763
0.066168
0.022169
0.007303
0.002419
0.0008
0.000265
x3 + 2x2 + 10x = 20
x(x2 + 2x + 10) = 20
x = 20/(x2 + 2x + 10)

a.) MOSS x0 = 1 error 0.0003


MOSS
k x Error
0 1
1 1.53846154 0.5384615385
2 1.29501916 0.2434423814
3 1.40182531 0.1068061524
4 1.35420939 0.047615919
5 1.37529809 0.0210887021
7 1.36592979 0.0093683043
8 1.370086 0.0041562152
9 1.36824102 0.0018449798
10 1.36905981 0.0008187884
11 1.3686964 0.0003634145
12 1.36885769 0.0001612911

b.) Newton Raphson x0 = 1 error 0.0003


Newton Raphson: x_n= x_(n-1)- (f(x_(n-1)))/(f'(x_(n-1)))
k x f(x) f'(x) Ratio (f/f')
0 1.000000 -7.000000 17.000000 -0.411765
1 1.411765 0.917566 21.626298 0.042428
2 1.369336 0.011148 21.102593 0.000528
3 1.368808 0.000002 21.096140 0.000000
4 1.368808 0.000000 21.096139 0.000000

c.) Bisection Method a = 1 and b = 2

F(x) = x^3+2x^2+10x-20

Bisection Method
k a f(a) b f(b)
0 1.000000 -7.000000 2.000000 16.000000
1 1.000000 -7.000000 1.500000 2.875000
2 1.250000 -2.421875 1.500000 2.875000
3 1.250000 -2.421875 1.375000 0.130859
4 1.312500 -1.168701 1.375000 0.130859
5 1.343750 -0.524811 1.375000 0.130859
6 1.359375 -0.198460 1.375000 0.130859
7 1.367188 -0.034173 1.375000 0.130859
8 1.367188 -0.034173 1.371094 0.048250
9 1.367188 -0.034173 1.369141 0.007016
10 1.368164 -0.013584 1.369141 0.007016
11 1.368652 -0.003286 1.369141 0.007016
12 1.368652 -0.003286 1.368896 0.001864
13 1.368774 -0.000711 1.368896 0.001864
14 1.368774 -0.000711 1.368835 0.000577

d.) Secant Method a = 2 and b = 1.75

F(x) = x^3+2x^2+10x-20

Secant Method :

n x_n f(x_n) error


0 2 16
1 1.75 8.984375
2 1.4298441 1.3105999613 0.3201559
3 1.37516484 0.1343495474 0.05467926
4 1.36891946 0.0023491652 0.00624538
5 1.36880831 4.318811E-06 0.00011115
6 1.36880811 1.3920243E-10 2.0471E-07

Another way of presenting Secant Method


a b f(a) f(b)
k x(i-k) x(i) f(i-k) f(i)
1 2.000000 1.750000 16.000000 8.984375
2 1.750000 1.429844 8.984375 1.310600
3 1.429844 1.375165 1.310600 0.134350
4 1.375165 1.368919 0.134350 0.002349
5 1.368919 1.368808 0.002349 0.000004
6 1.368808 1.368808 0.000004 0.000000

e.) Regula Falsi a = 1 and b = 2

F(x) = x^3+2x^2+10x-20
a b f(a) f(b)
k x(i) x(k) f(i) f(k) x(i+k)
1 1.000000 2.000000 -7.000000 16.000000 1.304348
2 1.304348 2.000000 -1.334758 16.000000 1.357912
3 1.357912 2.000000 -0.229136 16.000000 1.366978
4 1.366978 2.000000 -0.038592 16.000000 1.368501
5 1.368501 2.000000 -0.006479 16.000000 1.368757
6 1.368757 2.000000 -0.001087 16.000000 1.368799
Error

0.411765
0.042428
0.000528
0.000000
m f(m) Error
1.500000 2.875000 2.875000 f(a) and f(m) opposite sign, a =a, b =
1.250000 -2.421875 2.421875 f(a) and f(m) same sign, a =m, b = b
1.375000 0.130859 0.130859
1.312500 -1.168701 1.168701
1.343750 -0.524811 0.524811
1.359375 -0.198460 0.198460
1.367188 -0.034173 0.034173
1.371094 0.048250 0.048250
1.369141 0.007016 0.007016
1.368164 -0.013584 0.013584
1.368652 -0.003286 0.003286
1.368896 0.001864 0.001864
1.368774 -0.000711 0.000711
1.368835 0.000577 0.000577
1.368805 -0.000067 0.000067

error = 0.0003

x(i+k) Error
1.429844 0.570156
1.375165 0.374835
1.368919 0.060925
1.368808 0.006357
1.368808 0.000111
1.368808 0.000000

f(i+k) f(i)*(fi+k) Error


-1.334758 9.343306 0.304348
-0.229136 0.305841 0.053564
-0.038592 0.008843 0.009066
-0.006479 0.000250 0.001523
-0.001087 0.000007 0.000256
-0.000182 0.000000 0.000043
posite sign, a =a, b = m
me sign, a =m, b = b
100x - 10

You might also like