Professional Documents
Culture Documents
Chapter 17
Numerical Analysis
x: 0 1 2
WORKED OUT EXAMPLES f (x) = x 3 5x + 3: 3 1 1
Thus, a root lies between 0 and 1 and another root
lies between 1 and 2.
Bisection Method Choose x0 = 1 and x1 = 2. Then x2 = x0 +x 2
1
=
Example 1: Find a real root of the equation x 3
1+2
2
= 1.5, f (1.5) = 1.125 < 0.
6x 4 = 0 by bisection method. So root lies in between 1.5 and 2. So x3 = x2 +x
2
1
=
[JNTU 2006, Set No. 1] 1.5+2
2
= 1.75, f (1.75) = 0.3906 < 0.
So root lies between 1.75 and 2. Then x4 = 1.75+2
2
=
Solution: 1.875, f (1.875) = 0.2167 > 0.
x: 0 1 2 3
So root lies between 1.75 and 1.875. So the approx-
f (x) = x 3 6x 4: 4 9 8 5
imate root of the given equation is x5 = 1.75+1.875 =
... one root lies between 2 and 3. Take x0 = 2, 2
1.8125.
x1 = 3. By bisection method, the next approxima-
tion is x2 = x0 +x
2
1
= 2+32
= 2.5. Now at x2 = 2.5, Example 3: Find a real root of the Equation x 3
f (2.5) = 3.375 < 0. Thus, a root lies between 2.5 x 11 = 0 by bisection method.
and 3. So the next approximation is x3 = 2.5+3 2
= [JNTU 2007, Set No. 2]
5.5
2
= 2.75. At x 3 = 2.75, f (2.75) = 0.2968 > 0.
Thus a root lies between 2.5 and 2.75. Next approx- Solution:
imation is x4 = 2.5+2.75 = 2.625. x: 0 1 2 3
2
Now f (2.625) = 1.6621 < 0. The root lies be- f (x) = x 3 x 11: 11 11 5 13
tween 2.625 and 2.75. Then x5 = 2.625+2.75 2
= A root lies between 2 and 3. Then the rst approxi-
2.6875 and f (2.6875) = 0.7141 < 0. So root lies mation is x2 = x0 +x
2
1
= 2+3
2
= 2.5. Now f (2.5) =
between 2.6875 and 2.75. The approximate value of 2.125 > 0. So root lies between 2 and 2.5. So
the real root of the given equation is 2.6875+2.75
2
= the next approximation is x3 = 2+2.5 = 2.25. Now
2
2.71875. f (2.25) = 1.859 < 0. So next approximation is
x4 = 2.25+2.5 = 2.375. Now f (2.375) = 0.0215 >
Example 2: Find a real root of x 3 5x + 3 = 0 2
0 and f (2.25) < 0.
using bisection method.
[JNTU 2006, Set No. 2] ... Root lies between 2.25 and 2.375. So x = 5
2.25+2.375
2
= 2.3125. Now f (2.3125) = 0.946 < 0
Solution: and f (2.375) > 0.
17.1
Chap-17 B.V.Ramana August 30, 2007 10:15
x4 = g(x3 ) = 2.09455, x5 = g(x4 ) = 2.09455 Since f (1) = 2.178 and f (1) = 6.2780 are of the
Hence the approximate root of (2) is 2.09455; so the same sign, we choose x0 as 1. Then for n = 0,
negative root of the given Equation (1) is 2.09455. we have x1 = x0 ff(x(x0 )) or x1 = 1 2.178
6.278
= 0.653,
0
f (x1 ) = 0.46, and f (x1 ) = 3.7835. Then for n = 1,
Example 12: Find a solution of x 3 + x 1 = 0 by we get x2 = x1 ff(x(x1 )) = 0.653 3.7835
0.46
= 0.5314.
iteration. 1
Now f (x2 ) = 0.042, f (x2 ) = 3.11213. For n = 2,
Solution: we get x3 = x2 ff(x(x2 )) or x3 = 0.5314 3.11213
0.042
=
2
x: 0 1
0.518. Then f (x3 ) = 0.000738, f (x3 ) = 3.0433.
f (x) = x 3 + x 1: 1 1 So for n = 3, x4 = x3 ff(x(x3 )) = 0.518 0.000738
3.0433
=
... A root lies in (0, 1).
3
0.5177. Since f (0.5177) = 0.000174, we take
Rewriting the given equation, x4 = 0.5177 as an approximate root.
1
x= = g(x) Example 14: Find a real root of x + log10 x 2 =
1 + x2 0 using NewtonRaphson method.
so that [JNTU 2007, Set No. 3]
1
xn+1 = . Solution: Here, f (x) = x + log10 x 2, f (x) =
1 + xn2
1 + x1 log e10 = 1 + 2.3026
x
.
Also |g (x)| = (1+x 2 )2 < 1 for any x.
2|x| Since f (1) = 1 < 0 and f (2) = 0.3010 > 0, a
Choosing x0 = 1, we obtain root lies between 1 and 2. Again at 1.5, we have
f (1.5) = 0.324, root lies between 1.5 and 2.
1 1 Choose x0 = 1.8. Then for n = 0, we have the rst
x1 = = = 0.5
1 + 12 2 approximation as, x1 = x0 ff(x(x0 )) = 1.8 2.2792
0.0553
,
0
x2 =
1
= 0.800, x1 = 1.7757. Then x2 = x1 ff(x(x1 )) = 1.7757
1 + (0.5)2 0
0.0251
2.2967
= 1.7648.
1
x3 = = 0.610, Now x3 = x2 ff(x(x2 )) = 1.7648 0.0015
2.3047
= 1.7598,
1 + (0.8)2 2
Again x4 = x3 ff(x(x3 )) = 1.7598 2.3084
0.0053
= 1.7575
x4 = 0.729, x5 = 0.653, x6 = 0.701 3
f (x4 ) = f (1.7575) = 0.002395, we may take x4 =
Approximate root is 0.701. 1.7575 as an approximate root.
P (4) = 64 using Lagrange interpolation formula. Put x = 3 and substitute x0 , x1 , x2 , . . ., f (x0 ) . . ., etc.
[JNTU Aug. 2006, Supply. S 2004] (3 1)(3 2)(3 4)(3 5)(3 6)
f (3) = 1 +
(0 1)(0 2)(0 4)(0 5)(0 6)
Solution: x0 = 1, x1 = 3, x2 = 4, y(x) = P (x),
(3 0)(3 2)(3 4)(3 5)(3 6)
so y0 = P (x0 = 1) = P (1) = 1, y1 = P (x1 = 3) = + 14 +
27, y3 = P (3) = 27. By Lagranges interpolation (1 0)(1 2)(1 4)(1 5)(1 6)
formula, we get (3 0)(3 1)(3 4)(3 5)(3 6)
+ 15 +
(2 0)(2 1)(2 4)(2 5)(2 6)
(x x1 )(x x2 )
y(x) = P (x) = y0 + (3 0)(3 1)(3 2)(3 5)(3 6)
(x0 x1 )(x0 x2 ) +5 +
(4 0)(4 1)(4 2)(4 5)(4 6)
(3 0)(3 1)(3 2)(3 4)(3 6)
(x x0 )(x x2 ) +6 +
+ y1 + (5 0)(5 1)(5 2)(5 4)(5 6)
(x1 x0 )(x1 x2 )
(3 0)(3 1)(3 2)(3 4)(3 5)
+19
(6 0)(6 1)(6 2)(6 4)(6 5)
(x x0 )(x x1 )
+ y2 12 18 36 36
(x2 x0 )(x2 x1 ) = 14 + 15 + 5
240 60 48 48
18 12
(x 3)(x 4) (x 1)(x 4) 6+ 19
= 1+ 27+ 60 240
(1 3)(1 4) (3 1)(3 4)
= 0.05 4.2 + 11.25 + 3.75 1.8 + 0.95 = 10.
(x 1)(x 3)
+ 64 Example 22: If yx is the value of y at x for which
(4 1)(4 3)
the fth differences are constant and y1 + y7 =
784, y2 + y6 = 686, y3 + y5 = 1088, then nd y4 .
1
= [48x 2 114x + 72] = 8x 2 19x + 12 [JNTU 2007, Set No. 3]
6
Solution: Since 5th order differences are constant,
Example 21: Using Lagranges formula, calculate
we have 5 yn = constant for any n. Then all the
f(3) from the following table.
higher order differences are zero i.e., 6 yn = 0 and
x 0 1 2 4 5 6
7 yn = 0, etc. for any n. We know that
f (x) 1 14 15 5 6 19
[JNTU Aug. 2006, Supply. Aug. 2003] 0 = 6 y0 = y6 6y5 + 15y4 20y3 + 15y2
6y1 + y0
Solution: Here, x0 = 0, x1 = 1, x2 = 2, x3 = 4,
x4 = 5, x5 = 6 and f (x0 ) = 1, f (x1 ) = 14, f (x2 ) = 0 = y0 = y7 7y6 + 21y5 35y4 + 35y3
7
5 since n yk = yn+k n c1 , yn+k1 + n c2 yn+k2 +
(x xj ) . . . + (1)n yk .
j =0
5
j
=i Adding, we get
f (x) = f (xi )
5
i=0 (xi xj ) (y1 + y7 ) 6(y2 + y6 ) + 15(y3 + y5 ) 20y4 = 0.
j =0
i
=1
Given, y1 + y7 = 784, y2 + y6 = 686 and y3 +
5 5
(x xj ) y5 = 1088
= f (xi ) Therefore 784 6(686) + 15(1088) 20y4 = 0
(x i xj )
i=0 j =0
j
=i or y4 = 721.
Chap-17 B.V.Ramana August 30, 2007 10:15
Example 23: Construct the difference table for the Solution: Finite differences table is
following data.
x f(x) Df D2f D 3f D4f
x 0.1 0.3 0.5 0.7 0.9 1.1 1.3 20 354
F (x): 0.003 0.067 0.148 0.248 0.370 0.518 0.697 25 22
332 19
41 31
30 291 12 43
and nd F (0.6) using a cubic that ts at x = 0.3, 0.5, 29 12
35 260 0 14
0.7 and 0.9 using Newtons forward formula. 29 2
40 231 2
[JNTU 2007, Set No. 2] 27
45 204
Solution: The differences table is Gausss forward (rst GI) interpolation formula (see
(1) on page 17.19)
x F(x) DF(x) D2F(x) D3F(x) D4F(x) D5F(x) f (x) = f0 + qf0 + q(q1) 2
2 f1
0.1 0.003 + (q+1)q(q1) 3
f1 + . . .
0.064 6
0.3 0.067 0.017 Here, x = 22, x0 = 20, h = 5, q = xx h
0
= 2220
5
=
0.081 0.002
0.5 0.148 0.019 0.001 0.4, f0 = 354, f0 = 41, f1 = 19,
2
0.100 0.003 0
0.7 0.248 0.022 0.001 3 f1 = 31
0.122 0.004 0 f (22) = 354 + (0.4)(41) + (0.4)(0.6) (19)
0.9 0.370 0.026 0.001 2
0.148 0.005 + (1.4)(0.4)(0.6)
(31)
1.1 0.518 0.031 6
0.179 = 354 16.4 + 2.28 1.736 = 338.144
1.3 0.697
y0 = 0.067, y0 = 0.081, 2 y0 = 0.019, 3 y0 = ences formula (Gauss second G2: see (2) on Page
0.003, 4 y0 = 0.001, 5 y0 = 0, we get, F (0.6) = 17.19).
0.067 + (1.5)(0.081) + (1.5)(1.51)
2!
(0.019)+ y(x) = y0 + qy1 + q(q+1)
2 y1 + q(q +
2!
+ (1.5)(1.51)(1.52)
3!
(0.003)+ 1) (q1)
3!
+ (1.5)(1.51)(1.52)(1.53)
4!
(0.001) 3 y2 + y2
(q+2)(q+1)q(q1) 4
+ ...
4!
= 0.067 + 0.1215 + 0.0071 0.0011 + 0.000002
F (0.6) = 0.194502 x y D D2 D3 D4
0 7
4
5 11 1
Example 24: Find f (22) from the following table 3 2
10 14 1 1
x0 using Gauss forward formula 4 1
15 18 2 1
x 20 25 30 35 40 45 6 0
20 24 2
f (x) 354 332 291 260 231 204 8
25 32
[JNTU 2007, Set No. 4]
Chap-17 B.V.Ramana August 30, 2007 10:15
2
n1
Solution: From the denition of rst order divided fk = 2 f0 + 2 f1 + 2 f2 + . . . + 2 fn1
differences, we have k=0
u[x0 , x1 ] = u[xx1 ]u[x0]
, v[x0 , x1 ] = v[xx1 ]v[x0]
, = (f1 f0 ) + (f2 f1 ) +
x x
1 0 1 0 . . . (fn fn1 )
and f [x0 , x1 ] = f [xx1 ]f [x0 ]
= fn f0 .
1 x0
Thus RHS = u[x0 ] v[x0, x1 ] + u[x0 , x1 ] v[x1 ] sin x
= u[x0 ] v[xx1 ]v[x0]
+ u[xx1 ]u[x0]
v[x1 ]v[x1 ] 2. Consider the following data for g(x) = x2
.
x
1 0 x 1 0
= 1
x1 x0
{u[x0 ]v[x1 ] u[x0 ] v[x0 ] x: 0.1 0.2 0.3 0.4 0.5
+[u[x1 ] v[x1 ] u[x0 ] v[x1 ]} g(x): 9.9833 4.9696 3.2836 2.4339 1.9177
= 1
{u[x1 ]v[x1 ] u[x0 ] v[x0 ]}
x1 x0 Calculate g(0.25) accurately using Newtons
= 1
x1 x0
{f [x1 ] f [x0 ]} = f [x0 , x1 ]. forward method of interpolation.
[JNTU: Aug. 2003]
Example 27: Find the unique polynomial P (x) Hint: q = 0.250.1 = 1.5, h = 0.1, x = 0.25,
0.1
of degree 2 or less such that P (1) = 1, P (3) = 27, x0 = 0.1, g(0.25) = 9.9833 + 1.5(5.0137) +
P (4) = 64 using Newton divided differences for- (1.5)(0.5)
3.3277
2
mula.
[JNTU Aug. 2006, Supply. Set No. 2] + 1.50.5(0.5)
32
(2.4919)
which lies between 3.5 and 4 by RegulaFalsi 17. Find a real root of tan1 x x = 1.
method. [JNTU 2006, Set No. 3] Ans. 2.1323.
Ans. 3.789. Hint: g(x) = 1 + tan1 x, xn+1 = 1 + tan1 xn ,
Hint: x0 = 3.5, x1 = 4, x2 = 3.7888, f (2) = 0.10, f (3) = 0.75; choose x0 = 1,
f (x2 ) = 0.0009, f (x1 ) = 0.3979, x1 = 1.7854, x2 = 2.0602, x3 = 2.1189, x4 =
root (3.7888, 4), x0 = 3.7888, x1 = 4, 2.1318, x5 = 2.1322, x6 = 2.1323.
x3 = 3.7893 18. Using xed point
Iteration Method iteration method, evaluate ap-
proximately (a) 12 (b) 1 . 12
13. Find a real root of x 3 + x 2 100 = 0.
Ans. (a) 3.46425 (b) 0.2887.
Ans. 4.3311
Hint: (a) 12 = x, x 2 = 12 or x = 12 x
= g(x).
Hint: f (4) = 20 < 0, f (5) = 50 > 0 Since 9 and 16 are nearest numbers to 12 with
root in (4, 5), xn+1 = x10+1 = g(x), perfect squares 9 = 3, 16 = 4. Take x0 =
n
5 3.5, x = 3.4285, x = 3.5, x = 3.4285, x4 =
|g (x)| = (x+1)3/2 < 1 in (4, 5). Take x0 = 4.2 1 2 3
3.5, approximate root = 3.4285+3.5
2
= 3.46425.
x1 = 4.38529, x2 = 4.30919, x3 = 4.33996, (b) x = 112 , x 2 = 12 1
or x = 12x 1
= g(x)
x4 = 4.32744, x5 = 4.33252, x6 = 4.33046, choose x0 = 3.5 = 0.285,
1
x1 = 0.2924,
x7 = 4.33129, x8 = 4.33096, x9 = 4.33109, x2 = 0.285, x3 = 0.2924, approximate root
x10 = 4.33104, x11 = 4.33106, x12 = 4.33105, = 0.285+0.2924 = 0.2887.
x13 = 4.33105 2
19. Find a real root of ex sin x = 1 using Newton
14. Find the real root of the Equation Raphsons method.
[JNTU Aug. 2006, Supply Set No. 3,
x3 x5 x7 x9 x 11
x + + + ... R059010202]
3 10 42 216 1320 Hint: f (x) = ex sin x 1, f (x) =
= 0.4431135. x
e (sin x + cos x). f (2) = 5.7188,
f ( ) = 1; f (2) = 3.6439.
Ans. 0.4769.
3 5 7 9 11 Since f (2) and f (2) have the same sign
Hint: x = x3 x10 + x42 216
x x
+ 1320 + choose x0 = 2. NR formula is
0.4431135
x0 = 0.44, x1 = 0.4699, exn sin xn 1
Choose xn+1 = xn ,
x2 = 0.4755, x3 = 0.47664, x4 = 0.47686, exn (sin xn + cos xn )
x5 = 0.47690. x1 = 2 5.7188 = 0.4305, f (x1 ) = 0.358,
3.6439
15. By iteration method, nd a real root of sin x = f (x1 ) = 2.039, x2 = 0.606, f (x2 ) = 0.044,
10(x 1). f (x2 ) = 2.5507, x3 = 0.5887,
Ans. x = 1.088. f (x3 ) = 0.0004178. Approximate root x3 =
0.5887.
Hint: f (1) > 0 and f (2) < 0, root in (1, 2)
choose x0 = 1, x1 = 1.084, x2 = 1.088, x3 =
1.088
16. Using method of successive approximation nd
a root of x 3 3x + 1 = 0.
Ans. 0.347.
Hint: f (0) = 1 > 0, f (1) = 1 < 0, xn+1 =
xn3 +1
3
.