Key2PS5

advertisement
Key to Problem set #5
Instructor: Dr. Ming Xu
P324: 2, 4, 6
2. e  x  x
Solution :
f ( x )  e  x  x , f '( x )  e  x  1
e  xn  x n
, n  0,1, 2,...
 e  xn  1
Since f ( x ) is positive for x  0 and negative for x  1,
we conclude that there is a root of f ( x )  0 in the interval (0,1).
We therefore choose a starting value in this interval, say x0  0.5.
xn1  xn 
We summarize the first few steps of the interation in the following table, where x0  0.5
Note that x2 and x3 agree to six decimal places. We therefore suspect that x  0.567143
is a root of f ( x )  e  x  x , accurate to six decimal degree.
n
0
1
2
3
4
e  xn  x n
 e  xn  1
xn
xn1  xn 
0.5
0.566311003
0.567143165
0.56714329
0.56714329
0.566311003
0.567143165
0.56714329
0.56714329
0.56714329
4. x 2  5  0
Solution :
f ( x )  x 2  5, f '( x )  2 x
xn 2  5
xn1  xn 
, n  0,1, 2,...
2 xn
Since f ( x ) is negative for x  2 and positive for x  3,
we conclude that there is a root of f ( x )  0 in the interval (2,3).
And, Since f ( x ) is negative for x  2 and positive for x  3,
we conclude that there is an another root of f ( x )  0 in the interval (-3,-2).
We therefore choose a another starting value in this interval, say x0  03.
We summarize the first few steps of the interation in the following table,
where x0  2.5 and x0  2.5
Note that x3 and x4 agree to seven decimal places. We therefore suspect that
x1  2.2360679, x2  2.2360679 are two roots of f ( x )  x 2  5
xn 2  5
xn1  xn 
2 xn
xn
0
1
2
3
4
5
2.5
2.25
2.236111111
2.236067978
2.236067977
2.236067977
2.25
2.236111111
2.236067978
2.236067977
2.236067977
2.236067977
xn 2  5
xn1  xn 
2 xn
xn
-2.5
-2.25
-2.236111111
-2.236067978
-2.236067977
-2.236067977
-2.25
-2.236111111
-2.236067978
-2.236067977
-2.236067977
-2.236067977
6. (a) Solution:
1
f '( x ) 
, for x  1
2 x 1
1
=
, for x  1
2 1-x
We find
f ( xn )
xn1  xn 
f '( xn )
 xn  2 xn  1( xn  1), for x  1
=
 xn  2 1  xn ( 1  xn ), for x  1
= - xn  2 for xn1
If x0  1  h, then x1  1  h, x2  1  h, x3  1  h, and so on; that is, successive approximations
oscillate between 1  h and 1- h, and never approach the x  1.
(b) No, it doesn’t converge since that tangent line at x  1  h is parallel to the tangent
line at x  1  h .
3
2
1
0
-3
-1
-2
-3
-2
-1
0
1
2
3
4
5
8. (a) Solution:
We can sovle the roots of x 4  x 2  0 . Since x 4  x 2  x 2 ( x  1)( x  1), there are three
1
2 , successive values are collected in the
roots: r  0, r  1, r  1. If we set x0  
2
following list:
X0
X1
X2
X3
X4
X5
X6
X7
X8
X9
X10
-0.707106781
-7.96131E+14
-5.97099E+14
-4.47824E+14
-3.35868E+14
-2.51901E+14
-1.88926E+14
-1.41694E+14
-1.06271E+14
-7.9703E+13
-5.97773E+13
We can conclude the method converges to the root x  1 , but the speed is very slow.
14
12
10
8
6
4
2
0
-2
-2
-1.5
-1
-0.5
0
(b) Set x0  0.71 , we get the following list:
X0
X1
X2
X3
X4
X5
X6
X7
X8
X9
X10
X11
X12
X13
X14
X15
X16
-0.71
-22.17884146
-16.63977283
-12.48735534
-9.37555883
-7.045077933
-5.301731893
-4.000303115
-3.032482799
-2.317952537
-1.797924648
-1.430689731
-1.188628731
-1.054237065
-1.006209742
-1.000094409
-1.000000022
0.5
1
1.5
2
We can conclude the method converges to the root x  1 . But the converging rate is
slower than the speed in example 5.
Set x0  0.6 , we get the following list:
X0
X1
X2
X3
X4
X5
X6
X7
X8
X9
X10
-0.6
0.085714286
0.042537578
0.021230165
0.010610294
0.005304549
0.0026522
0.001326091
0.000663044
0.000331522
0.000165761
We can conclude the method converges to the root x  0 . That is to say, given different
initial value for a function with multiple roots, Newton-Raphson method will converge to
different root with different converging speed.
10. Solution:
We use the function of last question and set x0  1 , and get the following list:
X0
X1
X2
X3
X4
X5
X6
X7
X8
X9
X10
1
1
1
1
1
1
1
1
1
1
1
14
12
10
8
6
4
2
0
-2 -2
-4
-6
-8
-1.5
-1
-0.5
0
0.5
1
1.5
2
We can conclude that the subsequent iterations are all x 0 . x 0 =1 is the only point that the
tangent line intersected with the function graph.
Additional Question:
y  bx
Solution:
 xi yi  159104.1  8.48 , so the function is y  8.48 x
b
2
 xi 18762.77
2
i
xi y i
xi
yi
xi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
sum
27.2
35.6
37.9
31.3
32.6
36.4
29.8
34
32.3
27.9
29.1
36.2
33.3
28.1
30.2
35.8
32.7
27.7
147
371
428
246
255
370
215
299
274
161
170
361
300
188
215
366
264
172
3998.4
13207.6
16221.2
7699.8
8313
13468
6407
10166
8850.2
4491.9
4947
13068.2
9990
5282.8
6493
13102.8
8632.8
4764.4
159104.1
739.84
1267.36
1436.41
979.69
1062.76
1324.96
888.04
1156
1043.29
778.41
846.81
1310.44
1108.89
789.61
912.04
1281.64
1069.29
767.29
18762.77
Download