Tải bản đầy đủ (.pdf) (10 trang)

A textbook of Computer Based Numerical and Statiscal Techniques part 9 docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (124.02 KB, 10 trang )

66
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
Putting i = 2 in (1) x
3
= 0.02439
Therefore reciprocal of 41 is 0.0244.
Example 8. Find the square root of 20 correct to 3 decimal places by using recursion formula
x
i+1
=

+


i
i
120
x
2x
.
Sol. Put i = 0, x
1
=
0
0
120
2
x
x

+




Let x
0
= 4.5
∴ x
1
=
120
4.5
24.
5

+


= 4.47
Put i = 1, x
2
=
120
4.47 4.4
72
24.47

+=


Put i = 2, x
3

=
120
4.472 4.47
21
2 4.472

+=


.
Therefore
2
0
≈ 4.472 correct to three decimal places.
Example 9. Show that the following rearrangement of equation x
3
+ 6x
2
+ 10x – 20 = 0 does not
yield a convergent sequence of successive approximations by iteration method near x = 1,
x = (20 – 6x
2
– x
3
)/10.
Sol. Here, x =
()
23
20 6
10

xx
f
x
−−
=
Hence,
f

(x)=
2
12 3
10
xx−−
Clearly, f ’(x) < – 1 in nbd of x = 1 Hence
()

fx
> 1 and therefore the method and hence
the sequence < x
n
> does not converge.
Example 10. Find the smallest root of the equation
() () () ()
!!!!
2345
2222
xxxx
1x 0.
2345



−+−+−+=



Sol. Written the given equation as
x = 1 +
() () () ()
2345
222
2
2! 3! 4! 5!
xxxx
−+−
+ = φ(x)
Omitting x
2
and higher powers of x, we get x = 1 approximately.
Taking x
0
= 1, we obtain
x
1
= φ(x
0
) = 1 +
() () () ()
−+−
2222
1111

2! 3! 4! 5!
+ = 1.2239
x
2
= φ(x
1
) = 1 +
() () () ()
−+−
2345
2222
(1.2239) (1.2239) (1.2239) (1.2239)
2! 3! 4! 5!
+ = 1.3263
ALGEBRAIC AND TRANSCENDENTAL EQUATION
67
Similarly, x
3
= φ(x
2
) = 1.38
x
4
= φ(x
3
) = 1.409
x
5
= φ(x
4

) = 1.425
x
6
= φ(x
5
) = 1.434
x
7
= φ(x
6
) = 1.439
x
8
= φ(x
7
) = 1.442
Values of x
7
and x
8
indicate that the root is 1.44 correct to two decimal places.
PROBLEM SET 2.3
1. Use the method of Iteration to find a positive root between 0 and 1 of the equation
xe
x
– 1. [Ans. 0.5671477]
2. Find the Iterative method, the real root of the equation 3x – log
10
x = 6 correct to four
significant figures. [Ans. 2.108]

3. Solve by Iteration method:
(a) x
3
+ x + 1 = 0 [Ans. –0.682327803]
(b) sin x =
1
1
x
x
+

[Ans. –0.420365]
(c) x
3
– 2x
2
– 4 = 0 [Ans. 2.5943]
4. By Iteration method, find
3
0
.[Ans. 5.477225575]
5. If f(x) is sufficiently differentiable and the iteration x
n+1
= F (x
n
) converges, prove that the
order of convergence is a positive integer.
6. The equation f(x) = 0, where f(x) = 0.1 – x +
() () ()
234

222
2! 3! 4!
xxx
−+
– has one root in the
interval (0,1). Calculate this root correct to 5 decimal places. [Ans. 0.10260]
7. The equation x
2
+ ax + b = 0 has two real roots α and β. Show that the iteration method
x
n+1
= –
2
n
x
b
a

+



is convergent near x =
α
if 2
aα< +β
.
2.7 NEWTON–RAPHSON METHOD (OR NEWTON’S METHOD)
This method can be derived from Taylor’s series as follows:
Let f(x) = 0 be the equation for which we are assuming x

0
be the initial approximation and
h be a small corrections to x
0
, so that
f(x
0
+ h)= 0
Expanding it by Taylor’s series, we get
f(x
0
+ h) = f(x
0
) + hf ′(x
0
) +
2
2!
h
f ′(x
0
) + = 0
Since h is small, we can neglect second and higher degree terms in h and therefore, we get
f(x
0
) + hf ′ (x
0
)= 0
68
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES

From which we have, h = –
()
()
0
0
fx
fx

, where [f ′(x
0
)¹ 0].
Hence, if x
0
be the initial approximation, then next (or first) approximation x
1
is given by
x
1
= x
0
+ h = x
0

()
()
0
0
fx
fx


The next and second approximation x
2
is given by
x
2
= x
1

()
()

1
1
fx
fx
In general, x
n+1
= x
n

()
()

n
n
fx
fx
This formula is well known as Newton-Raphson formula.
The iterative procedure terminates when the relative error for two successive approximations
becomes less than or equal to the prescribed tolerance.

2.7.1 Procedure for Newton Raphson Method to Find the Root of the Equation
f
(
x
) = 0
Step 1: Take a trial solution (initial approximation) as x
0
. Find f(x
0
) and f ′(x
0
).
Step 2: Find next (first) approximation x
1
by using the formula x
1
= x
0

()
()

0
0
fx
fx
Step 3: Follow the above procedure to find the successive approximations x
n +1
using the
formula x

n+1
= x
n

()
()
n
n
fx
fx

, where n = 1, 2, 3,
Step 4: Stop the process when
1n
n
xx
+

< ε, where ε is the prescribed accuracy.
2.7.2 Order (or Rate) of Convergence of Newton-Raphson Method
Let α be the actual root of equation f(x) = 0 i.e., f(a) = 0. Let x
n
and x
n+1
be two successive
approximations to the actual root α. If e
n
and e
n+1
are the corresponding errors we have, x

n
= α
+ e
n
and x
n+1
= α + e
n+1
. By Newton’s-Raphson formula,
e
n+1
= e
n

()
()
n
n
fe
fe
α+

α+
e
n+1
= e
n

() () ()
() ()

()
2
2

2!

2!
′′′
α+ α+ α+
′ ′′ ′′′
α+ α+ α+
n
n
n
n
e
fef f
e
fef f
(By Taylor’s expansion)
e
n+1
= e
n

() ()
() ()
()
2
2


2!

2!
′′′
α+ α+
′ ′′ ′′′
α+ α+ α+
n
n
n
n
e
ef f
e
fef f
[3 f (α) = 0]
ALGEBRAIC AND TRANSCENDENTAL EQUATION
69
e
n+1
=
()
() ()
′′
α
′′′
α+ α



2
2
n
n
ef
fef
(On neglecting high powers of e
n
)
=
()
()
()
()
′′
α
′′
α

α+


α

2
2
1
n
n
f

e
f
fe
f
=
()
()
()
()

′′ ′′

αα

+

′′
αα


1
2
1
2
n
n
ff
e
e
ff

=
2
() ()
1
2() ()
n
n
ffe
e
ff
αα
αα
′′ ′′

−+

′′

=
()
()
()
()
′′ ′′

αα

−+



αα


2
23

2' 2
nn
ff
ee
ff
or
2
1
2
() ()
1

2()2 ()
nn
n
ff
ee
ff
e
+
′′ ′′

αα
=− +


′′
αα

()
()
′′
α


α2
f
f
(Neglecting terms containing powers of e
n
)
Hence by definition, the order of convergence of Newton-Raphson method is 2 i.e., Newton-
Raphson method is quadratic convergent.
This also shows that subsequent error at each step is proportional to the square of the
previous error and as such the convergence is quadratic.
Example 1. Find the real root of the equation x
2
– 5x + 2 = 0 between 4 and 5 by Newton-
Raphson’s method.
Sol. Let f(x)= x
2
– 5x + 2 (1)
Now, f(4) = 4
2
– 5 × 4 + 2 = – 2

and f(5) = 5
2
– 5 × 5 + 2 = 2
Therefore, the root lies between 4 and 5.
From (1), we get f ′(x) = 2x – 5 (2)
Now, Newton-Raphson’s method becomes
x
n+1
= x
n

()
()
n
n
fx
fx

= x
n

2
5
2
25
nn
n
xx
x
−+


or x
n+1
=
2
2
2
5
n
n
x
x


n = 0, 1, 2, (3)
Let us take x
0
= 4 to obtain the approximation to the root by putting n = 0, 1, 2 into (3),
we get
First approximation:

()
−−
== ==
−−
22
0
1
0
242

14
4.66
67
252453
x
x
x
70
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
Second approximation: The root is given by

()
()
2
2
1
2
1
4.6667 2
2
19.7781
4.5641
2 5 2 4.6667 5 4.3334
x
x
x


== = =
−−

Third approximation: The root is given by

()
()
2
2
2
3
2
4.5641 2
2
18.8310
4.5616
2 5 2 4.5641 5 4.1282
x
x
x
−−
== ==
−−
Fourth approximation: The root is given by

()
()
2
2
3
4
3
4.5616 2

2
18.8082
4.5616
2 5 2 4.5616 5 4.1232
x
x
x


== ==
−−
Since x
3
= x
4
, hence the root of the equation is 4.5616 correct to four decimal places.
Example 2. Solve x
3
+ 2x
2
+ 10x – 20 = 0 by Newton-Raphson’s method
Sol. Let f(x)= x
3
+ 2x
2
+ 10x – 20
⇒ f ′(x)= 3x
2
+ 4x + 10
Now, by Newton-Raphson method, we have

x
n +1
= x
n

()
()
n
n
fx
fx

= x
n

32
2
21020
3410
nn n
nn
xx x
xx
++ −
++
or x
n+1
=
()
32

2
210
3410
nn
nn
xx
xx
++
++
(1)
Clearly, f(1) = – 7 < 0 and f(2) = 16 > 0
Therefore root lies between 1 and 2.
Let x
0
= 1.2 be the initial approximation then
First approximation:
x
1
=
()
32
00
2
00
210
3410
xx
xx
++
++

=
() ()
() ()
32
2
2( 1.2 1.2 10)
26.336
19.12
31.2 41.2 10
++
=
++
or x
1
= 1.3774059
Second approximation: x
2
=
()
32
11
2
11
210
3410
xx
xx
++
++
=

()()
()
32
2
2 1.3774059 1.3774059 10
29.021052
2.201364
3 1.3774059 1.3774059 10
++
=
++
or x
2
= 1.3688295
ALGEBRAIC AND TRANSCENDENTAL EQUATION
71
Third approximation: x
3
=
32
22
2
22
2( 1
0)
341
0
xx
xx
++

++
=
32
2
2(1.3688295) (1.3688295) 10 28.87692
4
21.0964
3(1.3688295) 4(1.3688295) 10
++
=
++
or x
3
= 1.3688081
Fourth approximation: x
4
=
()
32
33
2
33
21
0
341
0
xx
xx
++
++

=
()()
()()
32
2
2 1.3688081 1.3688081 10
28.87656
7
21.0961
4
3 1.3688081 4 1.3688081 10
++
=
++
or x
4
= 1.3688081
Hence the required root is 1.3688081.
Example 3. Find the real root of the equation x log
10
x = 1.2 by Newton-Raphson’s method.
Sol. Let f(x)= x log
10
x – 1.2 = 0 (1)
Then f(1) = – 1.2
f(2) = 2 log
10
2 – 1.2 = – 0.5979
f(3) = 3 log
10

3 – 1.2 = 0.2314
Therefore root lies between 2 and 3.
Let us take x
0
= 2, then from (1)
f´(x) = log
10
x +
1
x
. x log
10
e = log
10
x + 0.4343 (2)
Now, by Newton’s-Raphson method, we have
x
n+1
= x
n

()
()
n
n
fx
fx

= x
n


10
10
log 1
.2
log 0.43
43
nn
n
xx
x

+
or x
n+1
=
10
0.4343 1.2
log 0.4343
+
+
n
n
x
x
, n = 0, 1, 2, 3 (3)
Putting n = 0 in (3), we get first approximation
First approximation: x
1
=

0
10 0
0.4343 1.2
log 0.434
3
x
x
+
+
=
()
()
10
0.4343 2 1.2
2.06
86
log 2 0.4343 0.73
53
+
=
+
or x
1
= 2.8133
Putting n = 1 in (3), we get second approximation
Second approximation:
x
2
=
1

10 1
0.4343 1.2
log 0.43
43
x
x
+
+
72
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
=
()
()
10
0.4343 2.8133 1.2
2.4128
log 2.8133 0.4343 0.8835
+
=
+
or x
2
= 2.7411
Putting n = 2 in (3), we get third approximation
Third approximation:
x
3
=
2
10 2

0.4343 1.2
log 0.4343
x
x
+
+
=
()
()
10
0.4343 2.7411 1.2
2.3905
log 2.7411 0.4343 0.8722
+
=
+
or x
3
= 2.7408
Putting n = 3 in (3), we get fourth approximation
Fourth approximation:
x
4
=
3
10 3
0.4343 1.2
log 0.4343
x
x

+
+
=
()
()
10
0.4343 2.7408 1.2
2.3903
log 2.7408 0.4343 0.8721
+
=
+
or x
4
= 2.7408
Since x
3
= x
4
, hence the root of the equation is 2.7408 correct to four decimal places.
Example 4. Find the real root of the equation 3x = cos x + 1 by Newton’s method.
Sol. Let f(x)= 3x – cos x – 1 = 0 (1)
So that f(0) = – 2
f(1) = 3 – cos 1 – 1 = 1.4597
So the root lies between 0 and 1.
Let us take x
0
= 0.6
From (1) f´(x) = 3 + sin x (2)
Therefore the Newton’s method gives

x
n+1
= x
n

()
()
n
n
fx
fx

or x
n+1
=
sin cos 1
3sin
nn n
n
xx x
x
++
+
(3)
First approximation: Putting n = 0, in (3) we get first approximation
x
1
=
00 0
0

sin cos 1
3sin
xx x
x
++
+
=
() () ()
()
0.6 sin 0.6 cos 0.6 1
3sin0.6
++
+
=
()( )
0.6 0.5646 0.8253 1
2.16406
3 0.5646 3.5646
++
=
+
or x
1
= 0.6071
ALGEBRAIC AND TRANSCENDENTAL EQUATION
73
Second approximation: Putting n = 1, in (3) we get second approximation
x
2
=

++
+
11 1
1
sin cos 1
3sin
xx x
x
=
()()()
()
++
+
0.6071 sin 0.6071 cos 0.6071 1
3 sin 0.6071
=
()()
++
=
+
0.6071 0.5705 0.8213 1
2.1677
3 0.5705 3.5705
or x
2
= 0.6071
Since x
1
= x
2

Therefore the root as 0.6071 correct to four decimal places.
Example 5. Find the real root of the equation log x – cos x = 0 correct to three places of decimal
by Newton-Raphson’s method.
Sol. Let f(x) = log x – cos x = 0 (1)
So that f(1) = – 0.5403
f(2) = 1.1092
∴ The root lies between 1 and 2.
Also, f(1.1) = log 1.1 – cos 1.1
= 0.0953 – 0.4535 = – 0.3582
f(1.2) = log 1.2 – cos 1.2 = – 0.18
f(1.3) = log 1.3 – cos 1.3 = – 0.0051
f(1.4) = log1.4 – cos 1.4 = 0.1665
Thus the root lies between 1.3 and 1.4.
From (1) f´(x)=
1
x
+ sin x (2)
Then by Newton’s-Raphson method, we get
x
n +1
= x
n

()
()

n
n
fx
fx

Using (1) and (2) x
n +1
= x
n


+
log cos
1
sin
nn
n
n
xx
x
x
or x
n +1
=
+−+
+
2
sin log cos
1sin
nn nn nn n
nn
xx xx xx x
xx
(3)
Let us take x

0
= 1.3
Now putting n = 0 into (3), we get first approximation
First approximation:
x
1
=
+−+
+
2
00 00 00 0
00
sin log cos
1sin
xx xx xx x
xx
=
()() ()() ()() ()
() ()
+−+
+
2
1.3 1.3 sin 1.3 1.3 log 1.3 1.3 cos 1.3
1 1.3 sin 1.3
74
COMPUTER BASED NUMERICAL AND STATISTICAL TECHNIQUES
=
()
1.3 1 1.2526 0.2623 0.2674
1 1.2526

+− +
+
or x
1
=
2.93501
2.2526
= 1.3029
Now putting n = 1 into (3), we get second approximation
Second approximation:
x
2
=
2
11 11 11 1
11
sin log cos
1sin
xx xx xx x
xx
+−+
+
=
()()()()
()()
()()
+−
+
+
2

1.3029 1.3029 sin 1.3029 1.3029 log 1.3029
1.3029 cos 1.3029
1 1.3029 sin 1.3029
=
1.3029 (1 1.2526 0.2645 0.2647)
1 1.2564
+−+
+
or x
2
=
2.9401
2.2564
= 1.3030
Hence the required root is 1.303 correct to three decimal places.
Example 6. Evaluate
12
to four decimal places by Newton’s iterative method.
Sol. Let x =
12
⇒ x
2
– 12 = 0 (1)
Therefore Newton’s Iterative formula gives,
x
n+1
= x
n

()

()
n
n
fx
fx

x
n+1
= x
n

2
12
112
22
n
n
nn
x
x
xx


=+


(2)
Now since f(3) = – 3 (–ve) and f(4) = 4 (+ve)
Therefore the root lies between 3 and 4.
Take x

0
= 3.5, equation (2) gives
x
1
=
0
0
112
2
x
x

+


x
1
=
112
3.5
23.5

+


= 3.4643
x
2
=
112

3.4643
2 3.4643

+


= 3.4641
x
3
=
112
3.4641
2 3.4641

+


= 3.4641
Since, x
2
= x
3
up to four decimal places. So we have
1
2
= 3.4641.
ALGEBRAIC AND TRANSCENDENTAL EQUATION
75
Example 7. Find a positive root of (17)
1/3

correct to four decimal places by Newton-Raphson’s
method.
Sol. The iterative formula for the given equation is
x
n+1
=
2
1
2
3
n
n
k
x
x

+



(1)
Here k = 17. Take x
0
= 2.5 because
!
&
= 2,
!
%
= 3

Putting n = 0 in (1), we get
First approximation: x
1
=
0
2
0
117
2
3
x
x

+



x
1
=
117
5
36.25

+


= 2.5733
Putting n = 1 in (1), we get
Second approximation:

x
2
=
1
2
1
117
2
3
x
x

+



x
2
=
117
5.1466
3 6.6220

+


= 2.5713
Putting n = 2 in (1), we get
Third approximation:
x

3
=
2
2
2
117
2
3
x
x

+


x
3
=
117
5.1426
3 6.61158

+


= 2.57128
Putting n = 3 in (1), we get
Fourth approximation:
x
4
=

3
2
3
117
2
3
x
x

+



x
1
=
117
5.14256
3 6.61148

+


= 2.57138
Since x
3
and x
4
are accurate to four decimal places hence the required root is 2.5713.
Example 8. Using Newton’s iterative method, find the real root of x sin + cos x = 0, which is near

x = π correct to 3 decimal places.
Sol. Given, f(x)= x sin x + cos x = 0 therefore f ′(x) = x cos x
The iteration formula is, x
n+1
= x
n

sin cos
cos
nn
n
nn
xx
x
xx
+
With x
0
= π

×