Soln AC09
Soln AC09
Soln AC09
Answer: A
Answer: C
1 2
0 - 2
0
0
Eigen values of H are 2 2 .
Since the spectral radius of H is 2 2 >1, the method diverges.
Answer: D
(d) We first construct the forward difference table from the given data. We have
x
f(x)
f
2 f
3 f
1
-1
2
-1
0
3
1
2
2
4
5
4
2
0
Using Newton forward difference interpolation and the given data, we get for h = 1
(x 1)(x 2) (2) = x2 3x + 1
p ( x) = 1 + ( x 1)(0) +
Answer: B
2
x2
x0
f ( x)dx = h[ f ( x 0 ) + 4 f ( x1 ) + f ( x 2 )] / 3
f0 = 1, f1 = 4/5, f2 = 1/2
Answer: D
(f) We need the approximation f(x) = ax + b, where a and b are to be determined so that
4
i =1
4
I
= 2 ( f ( xi ) axi b )xi = 0
a
i =1
or
x f (x ) a x
4
I
= 2 ( f ( xi ) axi b ) = 0
b
i =1
or
f (x ) a x
We have
= 10, f ( xi ) = 8,
2
i
= 30,
2
i
b xi = 0
4b = 0
x f (x ) = 30
i
Answer : A
Solving, we get a = 2, b = -3
(g) The truncation error associated with the given method is given by
TE = f ( x ) [ f ( x + h ) + af ( x) f ( x h)] /(2h)
f (x ) = 1 :
f (x ) = x :
dx = 1 / 2 + 3 / 2
2 = 2 which is true
x dx = 1 / 2 + 3a / 2
0 = 1 2 (3 a 1)
1
1
a = 1/ 3 .
Answer: C
x x n 1
Using the secant method x n +1 = x n n
f n , n = 1,2,........ , we get for
f n f n 1
x0 = 1, x1 = 0,
f 0 = f ( x0 ) = 1.3791, f1 = f ( x1 ) = 3
x x0
n = 1 : x 2 = x1 1
f 1 = 0.6851, f 2 = f ( x 2 ) = 0.4836
f
f
0
1
x x1
n = 2 : x3 = x 2 2
f 2 = 0.8167, f 3 = f ( x3 ) = 0.2468
f 2 f1
x x2
n = 3 : x 4 = x3 3
f 3 = 0.7723, f 4 = f ( x 4 ) = 0.0081
f3 f 2
x x3
n = 4 : x5 = x 4 4
f 4 = 0.7737, f 5 = f ( x5 ) = 0.0001
f4 f3
x x4
n = 5 : x6 = x5 5
f 5 = 0.7737 , which is correct to three decimal places.
f5 f4
(b) We have x = N . Take f(x) = x4 N = 0. Let be the exact root. Therefore, 4 = N.
Substituting x n +1 = + n +1 , x n = + n , N = 4 in the given formula, we get
+ n +1 = a( + n ) + b 4 / ( + n )3 + c 8 / ( + n )7
= a( + n ) + b [1+ n / ] + c [1+ n / ]
3
( )
( )
f / x
J n =
g / x
J n1 =
f / y
2 x + 2 y n
= n
g / y n 4 x n 5 y n
1 2 y n 5 x n
D ( 4 x n 5 y n )
6 yn + 2 xn
and
2 y n 5 x n
( 6 y n + 2 x n )
2 x n + 2 y n
D = (2 x n + 2 y n )(2 y n 5 x n ) (6 y n + 2 x n )(4 x n 5 y n )
x n +1 x n
f ( x n , y n )
= J n1
, n = 0,1,....... , we get
y n +1 y n
g (xn , y n )
y 0 = 1, f 0 = 0.26, g 0 = 0.17, D = 23.5
x0 = 1.5,
x1 1.5
1 9.5 3 0.26 1.3732
=
A = LLT where
l11
L = l 21
l31
0
l 22
l 32
0
0 .
l 33
We obtain
4
0
1 l11
3 = l 21
37/2 l31
0
4
3
l112
= l11l 21
l l
11 31
0 l11
0 0
l 33 0
0
l 22
l 32
l 21
l 22
0
l 31
l 32
l 33
l 21l 31 + l 22 l 32
l312 + l322 + l 332
l11l 21
l11l 31
l 212 + l 222
l 31l 21 + l32 l 22
2
2
l 21
+ l 22
= 4 l 222 = 4 l 22 = 2 ,
l 21l 31 + l 22 l 32 = 3 l32 = 3/2
Third row:
Hence, we obtain
0
0
4
0
2
3/2
LT x = z,
Lz=b
2
0
1/2
From L z = b, that is
0
2
3/2
0 z1 5
0 z 2 = 13
4 z 3 59
0
2
From L x = z, that is
2
0
0
0
we obtain using back substitution x3 = 3,
T
z 2 = 13 / 2,
1/2 x1 5 / 2
3/2 x 2 = 13 / 2
4 x3 12
x 2 = 1, x1 = 1 / 2
4
0
0
-3
15/2
-9/4
1
15/2
7/4
17/4
-25/8
31/16
z 3 = 12
-3
6
-3
1
8
2
4.25
-1
R2 R1/2
3
R3 R1/4
R3 + 3R2/10
4
-3
1
17/4
0
15/2 15/2 -25/8
0
0
4
1
Using back substitution, we get x3 = 1 / 4, x 2 = 2 / 3, x1 = 1 / 2
(b) We obtain from the augmented matrix
[ A I] =
2
1
2
1
2
4
2
-1
3
1
0
0
0
1
0
0
0
1
R2 R1/2
R3 R1
2
0
0
1
3/2
3
2
-2
1
1
-1/2
-1
0
1
0
0
0
1
R1 2R2/3
R3 2R2
2
0
0
0
3/2
0
10/3
-2
5
4/3
-1/2
0
-2/3
1
-2
0
0
1
R1 2R3/3
R2 + 2R3/5
2
0
0
0
3/2
0
0
0
5
4/3
-1/2
0
2/3
1/5
-2
-2/3
2/5
1
1
0
0
0
1
0
0
0
1
2/3
-1/3
0
1/3
2/15
-2/5
-1/3
4/15
1/5
2/3
1/3
-1/3
Hence, A-1 =
-1/3
2/15
4/15
-2/5
1/5
1
=
15
10
-5
-5
-6
[
)
= [5.5 3 x
( k +1)
1
+ 3 x 2( k +1) / 5, k = 0,1,..........
x 2( 0) = 0.2,
k = 1:
k = 2:
k = 3:
x3 = 0.502966
D+L=
1/4 0
-1/8 1/2
-9/40 3/10
-1
(D + L) =
H= -
0
2
-3
1/4
0
-1/8 1/2
-9/40 3/10
0
0
1/5
0
0
5
0
0
1/5
0
0
0
U=
0
0
0
-2
0
0
1
1
0
0
0
0
1/2
-1/4
-1/4 -3/8
-9/20 -3/40
. We obtain
-2
0
0
1
1
0
H I = 0
0
1/2
1/4
(1/4)
9 / 20
3/8
= 0 = (402 + 13 6)
(3/40) -
cos
Define S1 = 0
sin
1 / 2
A 1 = S AS1 = 0
1 / 2
1
0
0
T
1
1 / 2
0
1 / 2
1
0
1/
1/
sin 1 / 2
0
- 1/ 2
0 = 0
1
0 and
cos 1/ 2
0
1/ 2
2
2 1 / 2
1 / 2 2
0
1/ 2
0
4
2 0
1
0
2
1 / 2 2
2
2 1 / 2
0
1 / 2
2 2 2
2
0 4
2
0
4
0 = 2
4
0
2
0
0
2 2 2
2
0 0
0 1 / 2
0 = 1/ 2
1 0
sin
cos
0
1 / 2
1/
A 2 = S T2 A 1S 2 = 1 / 2 1 /
0
0
1 / 2
1/ 2
0 3
= 1 / 2 1 / 2
0 3
0
0
1 0
2
2
0 4
0 2
1 0
2
0
0 and
1
1/ 2
1/ 2
0
0 1 / 2
0 1 / 2
0 0
2
4
0
0 6
0 = 0
0 0
0
2
0
1/ 2
0
0
1
1/ 2
0
0
0
and
1
A-1 =
40
11
-4
-4
16
-4
-4
11
Vk +1 = Yk +1 / mk +1 ,
We obtain
1
40
k = 0 : Y1 =
11
-4
0.4
0.21
-4
16
-4
-0.9
-4
11
0.4
-0.44
0.21
1
k = 1 : Y2 =
40
11
-4
0.4773
-4
16
-4
-1
-4
11
0.4773
0.2432
=
-0.4955
0.2432
k = 2 : Y3 =
1
40
11
-4
0.4908
-4
16
-4
-1
-4
11
0.4908
0.2472
=
-0.4982
0.2472
and = 1/ = 2
1
Define S1 = 0
0
1
A 1 = S AS1 = 0
0
T
1
0
0
= 4 2
0
0
cos
sin
0
1/ 2
1/ 2
1/ 2
4 2
1
1/ 2 and
1/ 2
1/ 2
1/ 2
1
4
1/ 2 4
1
1/ 2 4 2
4 1
2 0
1 0
8/ 2
1
1/ 2 4
1/ 2
1/ 2 4
1/ 2
0 b1
c1
0 = c1
b2
3 0
c2
1/ 2
sin = 0
cos 0
0
0
1/ 2
1/ 2
1/ 2
1/ 2
0
3/ 2
3/ 2
0
0
c 2
b3
f 1 = b1 = 1
f0 = 1,
f 2 = ( b2 ) f1 c12 f 0 = ( + 1)( 1) 32 = 2 33 ,
f 3 = ( b3 ) f 2 c 22 f 1 = ( 3)(2 33)
Eigen values are the roots of f3 = 0. Hence, the eigen values are = 3, 33.
Therefore, the smallest eigen value in magnitude is = 3 .
7. (a) The maximum error in linear interpolation is given by h 2 M 2 / 8, where
3
M 2 = max f ( x ) = max 20(1 + x ) = 540
1 x 2
f ( x ) = a 0 x 3 + a1 x 2 + a 2 x + a 3
1
[v(x1 ){u (x1 ) u (x0 )} + u (x0 ){v(x1 ) v(x0 )}]
x1 x0
u (x ) u (x0 )
v( x1 ) v(x 0 )
= v( x1 ) 1
+ u ( x0 )
x1 x0
x1 x0
= v( x1 )u [x0 , x1 ] + u ( x0 )v[x0 , x1 ].
(b) We have = E 1 and = 1 E-1. We get
L.H.S. = + = E 1 + 1 E-1 = E E-1
E 1 1 E 1 E (1 E 1 ) E 1 (E 1)
R.H.S. = =
= E E 1 = L.H.S.
1
1
1 E
E 1
E 1
1 E
(c) Since the points are equispaced with h = 0.1, we can use Newton difference
interpolation. We first construct the forward difference table. We have
x
f(x)
f(x)
2 f(x)
3 f(x)
0.1
0.93
0.2
0.92 - 0.01
0.3
0.97 0.05
0.06
0.4
1.08 0.11
0.06
0
0.5
1.25 0.17
0.06
0
0.6
1.48 0.23
0.06
0
using the Newton forward difference interpolation and the given data, we obtain
f ( x ) = 0.93 +
9. (a) We need an approximation of the form y + a + (b/x). We determine a and b such that
5
i =1
I
b
= 2 y i a = 0
a
xi
or
5a b
1
=0
xi
b 1
I
= 2 y i a = 0
xi x i
b
or
(1 / x ) = 1.4636, ( y
yi
1
1
b 2 = 0
xi
xi
2
i
/ xi ) = 8.925
h = 0 .1 :
x1
x0
Writing x1 = x0 + h, we obtain
1
h
3hx02 + 3h 2 x0 + h 3 = 2 x02 + 2hx1 + h 2 2 ph 3 , which gives p = 1/12.
3
2
f (x ) dx as
a
xn
x1
x2
x0
x0
x1
f (x ) dx = f (x ) dx = f (x ) dx +
f ( x ) dx + ....... +
xn
xn 1
f ( x ) dx
Replacing each integral on the right side by the given formula, we get
10
xn
x0
2
h
h2
( f 0 f1) + h ( f1 + f 2 ) + h ( f1 f 2 )
f ( x ) dx = ( f 0 + f1 ) +
12
12
2
2
h2
( f n1 f n )
+ ......... + ( f n 1 + f n ) +
12
2
2
h
h
= [ f 0 + 2( f 1 + f 2 + .......... f n 1 ) + f n ] +
( f 0 f n )
2
12
which is the required composite rule.
(b) Using x = (t + 5) / 2 we change the limits of integration from [2, 3] to [-1, 1]. Hence,
1
we get I = f (t )dt ,
1
where f (t ) =
1 cos 2(t + 5)
2 1 + sin((t + 5) / 2)
f (x )dx =
1
f (1 / 3 ) + f (1 / 3 )
f (x )dx =[5 f (
1
3 / 5 + 8 f ( 0) + 5 f
)]
3/5 / 9
n = 0 : x0 = 0, y 0 = 1, y 0 = 1, y 0 = 4,
y 0 = 10 and
11
Subject
NUMERICAL COMPUTING
Code
Absolute error
= 0.000402
true value
Answer: A
7 5 3 5
, , = < 1 , Hence, ( A ) < 1
12 6 4 6
max
Answer: D
0 x / 4
Answer: D
2y 1
2 y 1
1
- 3
Answer: B
(f) Since f is a polynomial of degree k, all the divided differences of order k are equal and
divided differences of order greater than k are zeros.
Answer: C
Answer: C
Answer: B
12
x 2 = 0.607102
b) =
1-1/
2-1/
1
With pivoting
x2 =
(A
b) =
1- 1-2
1 2
1
1
, x1 = 2 x 2 =
=
1
1
1
Results in both cases are same, since we are using exact arithmetic.
13
(b) The iteration matrix in the Jacobi method is given by M = D(L + U ). We obtain
1
from the given matrix A, M =
0
0 0
1 2k
k 0 - k
=
.
0 - 2k 0
k
M I =
= 2 2k 2 = 0 or = 2k .
2k
For convergence of Jacobi method, we have
(M ) = 2 k < 1 . Hence, k < 1 2
4. (a) We obtain from the augmented matrix
(A b) =
4
2
1
5
1
-2
5
9
13
R2 R1/2
R3 R1/2
4
0
0
1
9/2
5/2
1
-5/2
11/2
5
13/2
21/2
R3 5R2/9
4
0
0
1
9/2
0
1
-5/2
62/9
5
13/2
62/9
x n +1 = (D + L ) U x n + (D + L ) b = H x n + c
From the given system of equations, we have
4
0
0
0
0
D+L=
0
5
0
U= 0
0
5
4
10
,
0
0
We obtain
50 0 0 0 0 2
0 0
1
1
H = (D + L ) U =
40 0 0 0 2 = 0 0
0
200
0 0
- 25 - 16 20 0 0 0
1
2
2
0
- 1/2
- 2/5
41/100
14
v = log10 ( (H )) = 0.3872 or
v = l n( (H )) = 0.8916
= 2
g / x 2 4 x 2 1 8 x1 x 2
f / x1
J = Jacobian matrix =
g / x1
J 1 =
1 8 x1 x 2
D 1 4 x 22
2 x2
2
2
, D = 64 x1 x 2 + 2 x 2 4 x 2 1
8 x1
(
(
x1 (n +1) x1 (n )
f x1 (n ) , x 2 (n )
=
J n 1
x 2 (n +1) x 2 (n )
g x1 (n ) , x 2 (n )
), n = 0,1,.......
)
we obtain
n = 0 : x1 (0 ) = 0, x 2 (0 ) = 1, f 0 = 1, g 0 = 1, D = 6
x1 (1) 0 1 0
=
x (1) 1 6 3
2
n = 1 : x1
(1)
= 1 / 3, x 2
2 1 1 / 3
=
0 1 1 / 2
(1)
= 1 / 2, f 1 = 7 / 36, g1 = 1, D = 32 / 9
x1 (2 ) 1 / 3 9 4 /3
=
x (2 ) 1 / 2 32 0
2
1 7 / 36 0.541667
8/3 1 1.25
l11 0
where L = l 21 l 22
l 31 l 32
(b) We write A = L L ,
0
0
l 33
We obtain
2
3
- 1
-1
2 =
- 1
3
1
2
l11 0
l
21 l 22
l 31 l 32
l11 2
0
0 =
l 33
l11l 21
l11l 31
l 21
l 22
0
l 31
l 32
l 33
l11 l 31
l11l 21
2
l 21
l11
0
2
+ l 22
l 21 l 31 + l 22 l 32
l 21l 31 + l 22 l 32
2
2
2
l 31
+ l 32
+ l 33
l11l 31 = -1 l 31 = 2 / 2
15
Note: For the use of Choleski method, the given coefficient matrix must be positive
definite. The given matrix A is not positive definite matrix since first leading
2
3
minor = 2 > 0 and second leading minor =
= 7 < 0
3
1
tan 2 =
= , or =
4
a11 a33
cos
Now define S1 = 0
sin
and
0
1
0
1 / 2 1
0
2
1 / 2 2
1 / 2
0
T
A 1 = S 1 A S 1 = 0
1
- 1 / 2 0
1 / 2
0
= 0
1
- 1 / 2 0
- sin 1 / 2
0 = 0
cos 1/ 2
1/ 2
1 / 2
3 / 2
2
3 / 2
2
3
2
1
0
2 1 / 2
2 0
1 1 / 2
2
3
2
- 1/ 2
0
1/ 2
1 / 2 3
0
= 2
- 1 / 2 0
0 -1/ 2
1
0
0 1 / 2
0
0
- 1
2
3
0
tan 2 =
= , or =
a11 a 22
4
cos
Now define S 2 = sin
0
- sin
cos
0
0 1 / 2
0 = 1 / 2
1 0
-1/ 2
0 3
0 2
1 0
0 1 / 2
0 1 / 2
- 1 0
1/ 2
0
0
1
and
1 / 2
T
A 2 = S 2 A 1 S 2 = - 1 / 2
0
1/ 2
1/ 2
0
2
3
0
1 / 2
1/ 2
0 5 / 2 - 1/ 2
0
0
5
= - 1 / 2 1 / 2
0 5 / 2 1/ 2
0 = 0
1
0
0
0
1 0
0
-1
0
-1/ 2
1/ 2
0
0
1
0
0
- 1
16
S = S 1S 2 = 0
1
0 1 / 2
1/ 2
0
1/ 2 0
0 1 / 2
- 1/2
0 = 1 / 2 1 / 2
1 1/2
- 1/2
- 1/ 2
1/ 2
0
] [
] [
- 1/ 2
1 / 2
respectively.
(corresponding to = 5, = 1, = 1 )
.
6. (b) We obtain using Givens method and the given matrix A
a
tan = 13 = 1, or =
a12
4
1
Define S1 = 0
0
- sin = 0
cos 0
0
cos
sin
- 1/ 2
1/ 2
1/ 2
1/ 2
and
A 1 = S 1 A S 1 = 0
0
= 0
0
0
1/ 2
-1/ 2
1/ 2
-1/ 2
1 / 2 2
1 / 2 2
0
1 / 2 2
1 / 2 2
0
2
1
2
2 1
2 0
1 0
1
1 / 2 = 2 2
- 1 / 2 0
4/ 2
3/ 2
3/ 2
0
1/ 2
1/ 2
2 2
3
0
- 1/ 2
1 / 2
0
0
- 1
1
2 2
From A 1 = 2 2 3
0
0
0 b1
0 = c1
- 1 0
c1
b2
c2
0
c 2 ,
b3
f0 = 1
f 1 = b1 = 1
f 2 = ( b2 ) f1 c12 f 0 = ( 3)( 1) 8 = 2 4 5
f 3 = ( b3 ) f 2 c 22 f 1 = ( + 1) 2 4 5 = ( + 1)( + 1)( 5)
The eigen values of A are -1, -1 and 5. The largest eigen values in magnitude of A is 5.
17
I (a, b) = ( y i a b / xi ) = minimum
2
i =1
I
b
1
= 2 y i a = 0, or y i 5a b = 0
a
xi
xi
y
I
b 1
1
1
= 2 y i a = 0, or i a b 2 = 0
b
xi x i
xi
xi
xi
18
(b) We have
TE = y ( x0 + sh ) ay ( x0 ) by ( x0 + h ) ch 2 y ( x0 ) dh 2 y ( x0 + h)
s2h2
s 3h3
s 4 h 4 iv
y ( x0 ) +
y ( x0 ) +
y ( x0 ) + .......
2
6
24
h2
h3
h 4 iv
b y ( x0 ) + hy ( x0 ) +
y ( x0 ) +
y ( x0 ) +
y ( x0 ) + ...........
2
6
24
= y ( x0 ) + s hy ( x0 ) +
a y (x 0 )
h 2 iv
ch 2 y ( x0 ) dh 2 y ( x 0 ) + hy ( x0 ) +
y ( x0 ) + ..........
2
2
s b
= (1 a b ) y ( x0 ) + (s b )hy( x0 ) + c d h 2 y( x0 )
2 2
s3 b
s4 b d
+ d h 3 y( x0 ) + h 4 y iv ( x0 ) + ........
6 6
24 24 2
(r)
Setting the coefficients of y ( x0 ) , r = 0, 1, 2, 3, equal tozero, we obtain
1 a b = 0,
s -b=0
2
s
b
s3 b
c d = 0,
d =0
2 2
6 6
Solving these equations, we get
9. (a) Let g ( x) = f ( x )dx be the quantity which is to be obtained and g h / 2 r denote the
a
approximate value of g ( x) obtained by using the given method with step length
h/2r, r = 0, 1, 2, . Thus we have
g (h) = g ( x) + c1h 4 + c 2 h 6 + c3 h 8 + ............
c1 h 4 c 2 h 6 c3 h 8
h
g = g (x ) +
+
+
+ .............
16
64
256
2
c3 h 8
c1 h 4 c 2 h 6
=
g
(
x
)
+
+
+
+ ............
M
Eliminating c1 from the above equations, we get
h
g 2
2
g (1) (h) =
4 2 g ( h / 2) g ( h )
2
4 1
= g ( x)
1c 2 6 1
h c 3 h 8 ..........
20
16
1c
4 2 g ( h / 2 2 ) g ( h / 2)
h
1
g (1) ( ) =
= g ( x) 2 h 6
c 3 h 8 ..........
2
2
1280
4096
4 1
M
Eliminating c2 from the above equations, we get
19
g ( 2) ( h) =
4 1
= g ( x) +
1
c 3 h 8 + ..................
1344
M
Thus successive higher order results can be obtained from the formula
4 m+1 g (m1) (h / 2) g (m 1) (h)
+ O h 2 m+ 4 , g ( 0) (h) = g (h )
m +1
4 1
g ( m ) (h) =
I =
x dx
01+ x + x2
1
x0 = 0,
x1 = 1 / 2,
x 2 = 1,
f 0 = 0,
f 1 = 2 / 7,
f 2 = 1/ 3
h
[ f 0 + 4 f1 + f 2 ] = 1 0 + 8 + 1 = 0.246032
3
6
7 3
h = 1 / 4 : x0 = 0, x1 = 1 / 4, x 2 = 2 / 4, x3 = 3 / 4, x 4 = 1,
I (h) =
f 0 = 0,
f 1 = 4 / 21, f 2 = 2 / 7, f 3 = 12 / 37, f 4 = 1 / 3
h
I ( h / 2) = [ f 0 + 4( f 1 + f 3 ) + 2 f 2 + f 4 ]
3
1
4 12 2 1
= 0 + 4 + + 2 + = 0.246997
12
21 37 7 3
16 I (h / 2) I (h)
Using Romberg integration, we obtain I =
= 0.247061
15
9. (b) The method is exact for f (x) = 1 and x. Making the method exact for f (x) = x2, we get
x1
h 2
2
2
2
x0 x dx = 2 x0 + x1 + ph (2 x0 2 x1 )
1 3
h
or
x1 x03 = x02 + x12 + 2 ph 2 ( x0 x1 )
3
2
Since x1 = x0 + h, we get
) (
1
h
3hx 02 + 3h 2 x 0 + h 3 = 2 x 02 + 2hx 0 + h 2 2 ph 3
3
2
where c = x 4 dx
x0
c
f
4!
iv
( )
h 4
h2
h5
x0 + x14
4 x03 4 x13 =
.
2
12
30
20
Hence, Error =
h 5 1v
f ( ) .
720
b
x1
x2
x0
x1
f ( x )dx +........... +
xN
x N 1
f ( x )dx
h2
h2
(
)
(
)
(
)
( f1 f 2 ) + ........
I = f 0 + f1 +
f 0 f1 + f 1 + f 2 +
12
12
2
2
h2
+ ( f N 1 + f N ) +
( f N 1 f N )
12
2
2
h
[ f 0 + 2( f1 + f 2 + ........ + f N 1 ) + f N ] + h ( f 0 f N )
2
12
3
h2
( 1 + 4 2 ) f 0 h ( 1 + 8 2 ) f 0..........
..
2
6
0 + 1 + 2 =0
1 + 2 2 = 1 / h
1 + 4 2 = 0
Solving the above system of equations ,we get
0 = 3 /(2h), 1 = 2 / h, 2 = 1 /(2h)
Hence, we obtain the differentiation method
f ( x0 ) =
1
[ 3 f ( x0 ) + 4 f ( x1 ) f ( x 2 )]
2h
1
1
x 1 x 2 sin x
1 x
2
h3
( 1 + 8 2 ) f ( ) = h f ( ), x0 < < x2
6
3
dx =
1
1
f (x )
1 x
21
f (x )
1 x2
I=
dx =
1
1
+ f
,
f
2
2
2
we get
1
1 1 1 1 1 1
1
sin
+
=
= 0.7215652
sin
sin
2
2 2 2
2
2 2 2
2 2
f (x )
1
1
1 x2
I=
dx =
3
3
+ f (0 ) + f
, we get
f
3 1 3
3 1
3
+0+
sin
2 4 sin 2
3 2 4 2
3
= 0.345420
sin
3 4
2
x0 = 0,
y0 = 1,
y1 y (0.2 ) = y 0 2(0.2) x0 y 02 = 1
i=1
x1 = 0.2, y1 = 1,
y 2 y (0.4 ) = y1 2(0.2) x1 y12 = 0.92
i=2
x2 = 0.4, y2 = 0.92,
y3 y (0.6 ) = y 2 2(0.2) x 2 y 22 = 0.784576
i=3
x3 = 0.6, y3 = 0.784576,
y 4 y (0.8) = y 3 2(0.2) x3 y 32 = 0.636842
i=4
x4 = 0.8, y4 = 0.636842,
y5 y (1.0 ) = y 4 2(0.2) x 4 y 42 = 0.507060
= h f n + h c2 f x + a 2 f f y
)n + h2 (c 22 f xx + 2c 2 a 2 f
f xy + a 22 f 2 f yy
+ ............
y n +1 = y n + (w1 + w2 )hf n + h 2 w2 c 2 f x + w2 a 2 f f y
22
h3
w2 c 22 f xx + 2c 2 a 2 ff xy + a 22 f 2 f yy
2
+ .........
(1)
We also have,
h2
h3
y n +1
yn +
y n + ............
2
6
h2
= y n + hf n +
fx + f fy n
2
h3
+
f xx + 2 f f xy + f 2 f yy + f y ( f x + f f y ) n + ............
6
= y n + hy n +
[(
(2)
a 2 = c 2 , w2 =
2c 1
1
and
, w1 = 2
2c 2
2c 2
c 2 0 is arbitrary.
1
y n +1 = y n + 1
2c 2
1
k1 +
k2
2c 2
k1 = hf ( x n , y n )
k 2 = hf ( x n + c 2 h, y n + c 2 k1 )
The truncation error is given by
TE = y ( x n +1 ) y n +1
1 c
1
= h 3 2 f xx + 2 f f xy + f 2 f yy + f y ( f x + f f y )n + O(h 4 )
6
6 4
23
1. (a) For one application of Simpsons rule, we require three nodal points. Since we have
2n +1, (odd) nodal points, the number of sub-intervals n must be even. Answer: A
x2 / 2
1+ x / 2 .
Answer: C
(c) The method produces exact results for polynomials of degree upto 1. The order of
convergence is 2.
Answer: D
) (
)(
Answer: D
= h 3 y ( x n ) / 3 + O (h 4 )
Answer: A
Answer: B
(A b) =
1
2
-3
1
1
-1
2
-3
8
1
0
A
1
0
0
1
-1
2
2
-7
14
1
-2
R3 + 2R2
A+3
1
0
0
1
-1
0
2
-7
0
1
-2
A-1
R2 2R1
R3 + 3R1
24
(A b) =
1
1/2
1/3
1/2
1/3
1/4
1/3
1/4
1/5
1
0
0
1
0
0
1/2
1/12
1/12
1/3
1/12
4/45
1
-1/2
-1/3
1
0
0
1/2
1/12
0
1/3
1
1/12 -1/2
1/180 1/6
R2 R1/2
R3 - R1/3
R3 - R2
f (x ) dx = f (x ) + f (x )
0
-1
f ( x ) =1 :
-1
f ( x ) =x :
-1
f ( x ) =x2 :
f ( x ) =x3 :
1
-1
1
-1
dx = 0 + 1 ,
x dx = 0 x0 + 1 x1 ,
or
or
x dx = 0 x02 + 1 x02 , or
3
x dx = 0 x03 + 1 x03 , or
0 + 1 = 2
0 x0 + 1 x1 = 0
(1)
(2)
(4)
1 x0 ( x02 x12 ) = 0
f (x ) dx = f (1 / 3 ) + f ( 1 / 3 )
1
-1
To evaluate the given integral using this method, we first change the limits of
integration from [-2, 2] to (-1, 1). Using the substitution x =2t, we obtain
25
I = e x / 2 dx = 2 e t dt = 2 e1 /
+ e 1 /
] = 4.685392
4. (a) We have x0 = 1, x1 = 3, f ( x ) = x 2 x 2, f 0 = f ( x0 ) = 2, f1 = f ( x1 ) = 4.
Since f 0 f 1 < 0, ( x0 , x1 ). Using the method of false position, we get
x2 =
First iteration:
x1 f 0 x0 f 1
= 1.6667,
f 0 f1
f 2 = f ( x 2 ) = 0.8888
x 2 f 1 x1 f 2
= 1.9091, f 3 = f ( x3 ) = 0.2644
f1 f 2
x4 =
Third iteration:
x3 f 1 x1 f 3
= 1.9767
f1 f 3
+
=
1 3
1
1
x 5 x 2 + 6 x (1.7183) x 3 4 x 2 + 3 x (6.3891) + x 3 3 x 2 + 2 x (19.0855)
2
2
6
x k x0
x k +1 = x k
f (x k )
f (x k ) f (x0 )
Substituting x k = + k and x0 = + 0 , we get
k 0
k +1 =k
f ( + k )
f ( + k ) f ( + 0 )
[k 0 ] [k f ( )+ k2 f ( ) / 2 + .............]
(k 0 ) f ( ) + (k2 02 ) f ( ) / 2 + .....
since f ( ) = 0. Cancelling (k 0 ), we get
1
k +1 =k [k +C 2 k2 +...............][1 + {(k + 0 )C 2 + ........}]
= k [k +C 2 k2 +...............] [1 (k + 0 )C 2 + .........]
=k
where C2 = f ( ) /(2 f ( ))
[
+ )
2
0
Hence, k +1 = c k , where c = C 2 0
Therefore, the method has linear rate of convergence.
6. (a) We have f ( x ) = x / sin x and f (0 ) = lim( x / sin x) = 1.
x 0
f0 = 1, f1 = 1.042915 and
I = h[ f 0 + f 1 ] / 2 = 0.510729
h = 1/4 :
f2 = 1.042915 and
I = h[ f 0 + 2 f1 + f 2 ] / 2 = 0.507988
h = 1/8 : x0 = 0, x1 = 1/8, x2 = 2/8, x3 =3/8, x4 = 1/2, f0 = 1, f1 = 1.002609,
f2 = 1.010493, f3 = 1.023828, f4 = 1.042915 and
I = h[ f 0 + 2( f 1 + f 2 + f 3 ) + f 4 ] / 2 = 0.507298
Using Romberg integration
I (m ) (h ) =
4 m I (m 1) (h / 2 ) I (m 1) (h)
, m = 1,2,........., I (0 ) (h ) = I (h ).
4m 1
27
1/2
0.510729
1/4
0.507988
1/8
0.507298
Hence, I 0.507068.
0(h4), m=1
0(h6), m = 2
0.507074
0.507068
0.507068
f f
f
g f f i g i +1
(b) (i) i = i +1 i = i i +1
g i g i +1
g i g i +1 g i
1
[g i f i f i g i ]
=
g i g i +1
1
[g i ( f i +1 f i ) f i (g i +1 g i )]
g i g i +1
1
f f i +1
f fi
f i
1
1
(ii) =
= i
. = i +1
=
.
f
f
f
f
f
f
f
f
f
i
i
+
1
i
i
i
+
1
i
i
+
1
i
i
+
1
7. (a) If is an eigen value of a matrix A, then 1/ is an eigen value of A-1. Thus the
smallest eigen value in magnitude of A is the largest eigen value in magnitude of A-1.
Thus, we use the power method on A-1 to obtain its largest eigen value in
magnitude. Then = 1/ is the smallest eigen value in magnitude of A.
We take an arbitrary vector V0 (non-zero) and generate
Yk+1 = A-1 Vk
V k+1 = Yk+1/ mk+1,
(Yk +1 )r
k (V )
k r
Then = lim
Let A be a given real symmetric matrix. The eigen values of A are real. There exists a
real orthogonal matrix S such that S-1 A S is a diagonal matrix D. The elements on the
diagonal of D are the eigen values of A. This diagonalization is done by applying a
sequence of orthogonal transformations, S1, S2, .., Sn, .. as follows:
Among the off diagonal elements, let a ik be the largest element in magnitude.
We define
28
1 0
cos
S =
sin
..
-sin
M
cos
ith row
0 ...
0
..
1
kth column
Thus S is an identity matrix in which the elements in positions (i, i) , (i, k) , (k, i) and
(k, k) are written as cos , - sin , sin and cos respectively. It can be verified that
S in an orthogonal matrix S11 = S 1T .
cos
sin
-sin
cos
cos
-sin
sin
cos
p11
p 21
aii
aik
-sin
cos
p12
p 22
cos
sin
aik
akk
29
In the given matrix, the largest off-diagonal element in magnitude is either a12 or a23.
We take this element as a23 (since a22 = a33 and exact arithmetic can be performed).
From
tan 2 = 2a 23 /(a 22 a33 ) = , we get = / 4. Now define
S1 =
1
0
0
0
cos
sin
0
-sin
cos
1
0
0
0
0
1/ 2 -1/ 2
1/ 2 1/ 2
A1 = S11 AS1 0
1/ 2 1/ 2
1/ 2 -1/ 2
-1/ 2 1/ 2
1/ 2 1/ 2
1
0
0
0
0
1/ 2 1/ 2
-1/ 2 1/ 2
2
1
0
1/ 2 -1/ 2
5/ 2 -3/ 2
5/ 2 3/ 2
2
1/ 2 -1/ 2
1/ 2 5 0
-1/ 2 0 3
Now, the largest off-diagonal element in magnitude in A1 is a12 (or a13). We find
tan 2 = 2a12 /(a11 a 22 ) = 2 / 3 = 0.2203
We obtain sin = -0.2184, cos = 0.9758. Now, define
S2 =
cos
sin
0
-sin 0
cos 0
0
1
0.9758
- 0.2184
0
0.2184
9578
0
0
0
1
A2 = S 21 A 1S 2
0.9758
0.2184
0
-0.2184
0.9758
0
0.9758
0.2184
0
-0.2184
0.9758
0
2
1/ 2 -1/ 2
1/ 2 5
0
-1/ 2 0
3
0
0
1
0
0
1
1.7971
-0.4020
-0.6900
1.1268
5.0334
-0.1544
0.9758
-0.2184
0
0.2184
0.9758
0
0
0
1
-1/ 2
0
3
30
1.8414 0.0002
0.0002 5.1577
-0.6900 -0.1544
-0.6900
-0.1544
3
Since A2 is not a diagonal matrix, we need more iterations. If we neglect the off-diagonal
elements, then eigen values after two iterations are obtained as
= 1.84,
= 5.16,
= 3.
= minimum
i =1
y
x
6a b xi c xi2 = 0 ,
x y
2
i
a xi b xi2 c xi3 = 0
x
y
i
i
x = 91, x
= 3060, x y = 6450
= 21,
2
i
3
i
= 441,
and
x
x y
4
i
= 2275,
= 17950
2
i
a = 1702.007924
31
y 0 = 1,
y 0 = 0,
y iv = 0
y 0 = 4,
n =1 :
x1 = 0.1,
y1 = 0.099333,
y1 = 0.980133, y1 = 0.394693,
y1 = 3.841593,
iv
y1 = 3.841593
(i) =
1
a
(1 + 2 ) 2 = a ,
2
2
1
(ii) = (3 ) 2 = a
2
a
1
2
(i) + n +1 = ( + n ) 1 +
2
2
( + n )
1
= ( + n )
2
1 + 1 + n
2
1
( + n ) 1 + 1 2 n + 3 n2 ............ = 1 ( + n )
2
2
2
2 2 n + 3 n2 ...........
2
We obtain, n +1 =n /(2 ) + O (3n ). Error constant = c = 1 / 2
Hence, the method has second order convergence.
=
(ii) + n +1 =
1
( + n )3 12 ( + n )2
2
(1)
1
( + n )2 2 n n2
(2)
Hence, the method has second order convergence. Comparing (1) and (2), we find
that error in the first method is about one third of that in the second method. If we
multiply the fist method by 3 and add to the second method, we obtain the method
4 x n +1 =
xn
2
3a
x n2
3
+
+
3
a
x n2
or xn +1 =
xn
8
x n2
3a
6
+
3
a
x n2
(3)
32
then
1/ 4
(b)
From A = LLT where L =
1
2
1
2
5
0
1
0
13
l112
l11
l21
l31
0
l22
l32
0
0
l33
l11
l21
l31
0
l22
l32
0
0
l33
l11
0
0
l11l21
2
21
we obtain
l21
l22
0
l31
l32
l33
l11l31
2
22
l11l21
l +l
l11l31
l31l21+l32l22
l21l31 + l22l32
l 312 + l 322 + l332
Second row:
2
l 21
+ l 222 = 5 l 222 = 1 or l 22 = 1;
Third row:
l 21l 31 + l 22 l 32 = 0 l 32 = 2
Hence, we obtain
L=
1
2
1
0
1
-2
0
0
2 2
33
1
2
1
0
1
-2
0
0
2 2
z1
z2
z3
0
-3
14
0
-3
2 2
1
0
0
2
1
0
2 =2 2
1
-2
2 2
x
y
z
34
Subject
NUMERICAL COMPUTING
Code
x x1
Second iteration : x3 = x 2 2
f 2 = 1.8555
f 2 f1
Answer: B
(1 / 4 ) 1 / 16 = 0, or 2 ( 1 / 2 ) = 0
2
Answer: C
(c) Since the points are not equispaced, we use Newtons divided difference
interpolation. We have
x
-3
-1
0
1
2
f(x)
7
1
1
3
7
First d.d
Second d.d
-3
0
2
4
1
1
1
Third d.d
0
0
Answer: B
Hence, p = 4.
Answer:
(e) Make the method exact for f(x) = 1, x and x2. We get
35
dx = 2a + b
f ( x ) = x : xdx = a + 0 + a
f ( x ) = x : x dx = a + 0 + a
f (x ) = 1 :
or
2a + b = 2
or
0=0
or
2a = 2/3
Hence, we get a = 1 / 3, b = 4 / 3
(f) Write the integral as I =
Answer: D
f (x )
1
1
f (x )
1 x
dx =
dx, where f ( x) = 1 x 2 .
1 x
Using the Gauss-Chebyshev two-point method
1
1
1
1 1
+ f
, we get I = + =
f
2
2 4 4 4
2
2
Answer: A
1
I
= 2 x 1 3 ax b x dx = 0
0
a
3 a b
=0
7 3 2
or
1
I
3 a
= 2 x 1 3 ax b dx = 0
or
b = 0
0
4 2
b
Solving (1) and (2), we get a = 9 / 14, b = 6 / 14
(1)
(2)
Answer: A
x0 = 1, y 0 = 2 , y1 = y 0 + h x0 + y 0 = 2.1732
n = 1:
Answer: C
f ( ) = f ( ) = f ( ) = 0 and f ( ) 0
Writing x n +1 = + n +1 , x n = + n in the given method, we get
f ( + n )
+ n +1 = + n
f ( + n )
3 f ( ) / 6+ n4 f 1v ( ) / 24 + .......
or, n +1 =n n 2
3
1v
n f ( ) / 2+ n f ( ) / 6 + ......
1
=n n / 3+ n2 c 4 / 12 + ........ [1 + {n c 4 / 3 + .......}]
36
n +1 =n n / 3+ n2 c 4 / 12 + ...... [1 n c 4 / 3 + ........]
1
=n n n2 c 4 + ......... = 1 n + n2 c 4 + O 3n
36
3
36
3
( )
( )
x0 = 1.5,
f ( x ) = 3 x 2 + 2 x + 1 . We obtain
f 0 = 1.375,
f 0 = 4.75
( )
( )
( )
( )
=
g / y n 8 x n
f / x
J n = Jacobian matrix =
g / x
J
1
n
1 10 y n
=
D 8 x n
12 y n2
10 y n
12 y n2
2
2
, D = 60 x n y n 96 x n y n .
2
6 x n
2 x n3 + 4 y n3 20
x n +1 x n
1
, we obtain
= J n
Using Newtons method
4 x 2 + 5 y 2 21
y
y
n +1 n
n
n
n = 0:
x0 = 1.9,
y 0 = 0.9,
x1 1.9
1 9
=
n = 1:
x1 = 2.0249,
D = 47.196
y1 = 0.9678,
x 2 2.0249
9.678
1
=
D = 56.0184
11.2396 0.2310 2.0019
=
24.6013 0.0841 0.9917
The iteration matrix associated with the Gauss-Jacobi iteration method is given by
H = D
(L + U )
3
0
0
0
1
0
0
0
7
0
- 4
-6
0
-3
2
- 1
0
37
1/3
= 0
0
0 0
0 4
1/7 - 1
0
1
0
- 2 0
1 = 4
0 - 1/7
6
0
3
0
3/7
- 2/3
1
0
3/7
- 1/7
We obtain 213 179 + 30 = 0
- 2/3
1 =0
( + 3)(212 63 + 10) = 0
or
u11
4. (a) Let U = 0
0
14
- 7
15
u13
u 23 . From A = U U T , we get
u 33
u12
u 22
0
15 u11
- 10 = 0
25 0
-7
5
- 10
u13 u11
u 23 u12
u 33 u13
u12
u 22
0
= u12 u 22 + u13u 23
u u
13 33
u 22
u 23
u13u 33
u 23u 33
2
u 33
u12 u 22 + u13 u 23
2
22
u +u
0
0
u 33
2
23
u 23 u 33
third column:
u13 u 33 = 15 u13 = 5
2
2
2
u 22
+ u 23
= 5 u 22
= 1 or u 22 = 1
second column:
first column:
2
Hence, U = 0
0
Now,
1
0
3
- 2 and U 1 =
5
-1
A 1 = U U T
( )
= UT
1 / 2
0
1/2
1
0
- 1/10
2/5
1/5
( )
U 1 = U 1 U 1 . We obtain
38
1 / 2
= 1/2
- 1/10
0 1 / 2
0 0
1/5 0
0
1
2/5
1 / 4
= 1/4
- 1/20
1/2
1
0
- 1/10
2/5
1/5
25
1
7/20 =
25
100
- 5
21/100
1/4
- 1/20
5/4
7/20
-5
35
21
25
125
35
[A b] =
1
2
3
1
3
2
-1
5
-3
2
-3
6
3
2
1
2
3
1
-3
5
-1
6
-3
2
R2 2R1/3
R3 R1/3
3
0
0
2
5/3
1/3
-3
7
0
6
-7
0
R3 R2/5
3
0
0
2
5/3
0
-3
7
-7/5
6
-7
7/5
R1 R3,
(pivoting)
cos
S1 = 0
sin
Define
1 / 2
0
A 1 = S A S 1 = 0
1
- 1 / 2 0
T
1
1 / 2
= 0
- 1 / 2
0
1
0
1/ 2
0
1/ 2
- sin 1 / 2
= 0
0
cos 1/ 2
0
1
0
1/ 2
0
1/ 2
5 / 2
- 4/ 2
5 / 2
- 2
4
-2
5
-2
0
1
0
- 1/ 2
0
and
1/ 2
4 1 / 2
0
5
- 2 0
1
-2
1 1 / 2
0
5
3/ 2
-2 2
0
= - 2 2 5
0
3 / 2 0
-2
-1/ 2
1 / 2
0
3
39
cos
S 2 = sin
0
Define
1 / 2
A 2 = S T2 A 1 S 2 = 1 / 2
0
0 1 / 2
0 = 1 / 2
1 0
- sin
cos
0
-1/ 2
1/ 2
0
0 5
-2 2
0 - 2 2 5
1 0
0
(
(
0 and
1
1/ 2
1/ 2
0
0 1 / 2
0 - 1 / 2
- 3 0
1/ 2
0
)
)
1 / 2
-1/ 2
0 5 + 2 2 / 2
5 2 2 / 2 0 5 + 2 2
= 1 / 2
1/ 2
0 5 + 2 2 / 2 5 2 2 / 2 0 = 0
- 0
0
1 0
0
- 3 0
Hence, the eigen values of A are 5 + 2 2 , 5 2 2 and -3.
1
(b) We have A 3I = 1
0
0
0
1
1
1 and B = (A 3I ) = 1
- 1
1
1
T
Starting with V0 = [1,
- 1,
1] , we get
1
Y1 = B V0 = [ 2,
3,
Y2 = B V1 = [5 / 3,
- 7/ 3,
Y3 = B V2 = [ 12 / 7,
- 2] ; m1 = 3 ; V1 = Y1 / m1 = [ 2 / 3,
T
1
-1
1
0
3
0
5-2 2
0
- 1
1
0
1,
5/3] ; m 2 = 7 / 3 ; V2 = Y2 / m 2 = [5 / 7,
17/7,
0
1
1/ 2
- 2/3]
- 1,
5/7 ]
- 12/7 ] T
(Y3 )r
(V2 )r
12 17 12
=
,
,
= [2.4, 3.4, 2.4]
5
5
5
We take 2.4 (we need more iterations for more accurate results.)
= 3 (1 / ) = 3 (1 / 2.4 ) or
= 3.4167, = 2.5833
40
Define
cos - sin = 0
1/3
- 2 2 / 3 and
sin
cos 0
2 2 / 3 1/3
0
0
2
4 1
1
2
A 1 = S1T A S1 = 0
1 /3
2 2 / 3 2
6
2 0
0
-2 2 /3
1/3 4
2
2 0
0
0
3 2
0
1
2
= 0
1 /3
2 2 / 3 2
10 /3
- 11 2 / 3
0
-2 2 /3
1/3 4
5 2 /3
- 2/3
1
S1 = 0
0
= 3 2
3 2
b
1
- 5 2 / 3 = c1
14/3 0
0
10 /3
-5 2 /3
c1
b2
c2
c2
b3
1/3
- 2 2 / 3
2 2 / 3 1/3
f 3 = ( b3 ) f 2 c 22 f 1 = ( 14 / 3)(2 16 / 3 34 / 3) 50( 2) / 9
= 3 102 + 8 + 64.
The characteristic equation of the given matrix is f 3 = 3 102 + 8 + 64 = 0
(b) From the given matrix, we write
[A I] =
4
1
3
1
4
2
1
-2
-4
1
0
0
0
1
0
0
0
1
R2 R1/4
R3 3R1/4
4
0
0
1
15/4
5/4
1
0
-9/4 -1/4
-19/4 -3/4
0
1
0
0
0
1
R1 4R2/15
R3 R2/3
4
0
0
0
15/4
0
8/5
-9/4
-4
16/15 -4/15 0
-1/4
1
0
-2/3
-1/3 1
R1 + 2R3/5
R2 9R3/16
41
4
0
0
1
= 0
0
Hence, A 1
0
15/4
0
0
1
0
1 / 5
= 1/30
1/6
0
0
-4
0
0
1
4/5
1/8
-2/3
1 / 5
1/30
1/6
-2/5 2/5
19/16 -9/16 R1/4, 4R2/15,
-1/3 1
-R3/4
- 1/10
19/60
1/12
1/10
- 9/60
- 1/4
1/10
12
1
2
- 9/60 =
60
10
- 1/4
- 1/10
19/60
1/12
-6
19
5
6
- 9
- 15
)]
4
I
254 15a
= 2 x 2 a x b / x x dx = 0 or
2b = 0
1
a
7
2
4
15
3
I
b1
or
2a b = 0
= 2 x 2 a x dx = 0,
1
2
4
b
x x
(1)
(2)
(x xn )
h
Substituting
f n +
(x xn )(x xn 1 )
2!h
2 fn +
(x xn )(x xn 1 )(x xn 2 )
3!h
3 f n + ......
x x n = hs, we get
f ( x n + hs ) = f n + sf n +
s (s + 1) 2
s (s + 1)(s + 2 ) 3
fn +
f n + ...........
2!
3!
We obtain
df df dx
2s + 1 2
3s 2 + 6 s + 2 3
=
. = f n +
fn +
f n + .........
ds dx ds
2!
3!
Now dx/ds = h and for x = x n , we get s = 0. We obtain
df 1
1
1
(1)
= f n + 2 f n + 3 f n + ............
dx h
2
3
We now construct the backward difference table from the given data. We get for h
=1
f
x
f(x)
2 f 3 f
1
1
2
3
2
3
7
4
2
f ( x n ) =
42
4
13
6
2
0
5
21
8
2
0
Substituting in (1) for xn= 5, we obtain f (5) = [8 + (2 / 2)] = 9
8. (a) Using Lagrange interpolation formula and the given data, we get
p( x ) =
+
=
(1 + 3)(1 + 1)(1)
29 3
1
1
3
(
x x ) (x 3 + 2 x 2 3 x ) (x 3 + 3 x 2 x 3) + (x 3 + 4 x 2 + 3 x )
24
4
3
8
= x3 + x + 1
f (0.5) p (0.5) = (0.5) 3 + (0.5) + 1 = 1.625
(b) we have f [x 0 , x1 ] =
1
[ f (x1 ) f (x0 )] = 1
x1 x0
x1 x0
1
1
1
( 1)1
=
x0 x1
x0 x1
x1 x 0
The result is true for n = 1. Assume that the result is true for n = k, that is
f [x 0 , x1 ......., x k , x k +1 ] =
=
1
x k +1 x0
1
{ f [x1 , x2 ,.........xk +1 ] f [x0 , x1 ,..........., x k ]}
x k +1 x0
( 1)k
( 1)k = ( 1)k +1
= f ( x 0 ) hf ( x0 ) + h 2 f ( x 0 ) / 2 + h 3 f ( x0 ) / 6 + ...........] / h
= hf (x 0 ) / 2 h 2 f ( x0 ) / 6 .........
Hence, we can write the error term as
TE = c1h + c 2 h 2 + .......... + c p h p + O h p +1 , where ci s are independent of h.
43
g (h ) = g ( x ) + c1 h + c 2 h 2 + c3 h 3 + ..........
g (h / 2 ) = g ( x ) + c1h / 2 + c 2 h 2 / 4 + c3 h 3 / 8 + ..........
g (h / 2 2 ) = g ( x ) + c1 h / 4 + c 2 h 2 / 16 + c3 h 3 / 64 + ............
M
Eliminating c1 from the above equations, we obtain
g (1) (h ) =
c h2 3
2 g (h / 2 ) g (h )
= g ( x ) 2 c3 h 3 ............
2 1
2
4
M
g (1) (h / 2 ) =
c h2 3
2 g h / 2 2 g (h / 2 )
= g ( x ) 2 c3 h 3 ............
2 1
8
32
M
Eliminating c2 from the above equations, we get
4 g (1) (h / 2 ) g (h ) 2 2 g (1) (h / 2 ) g (1) (h)
(2 )
g (h ) =
=
+ O h3
2
4 1
2 1
Thus the successive higher order results can be obtained from the formula
( )
g (m ) (h ) =
2 m g (m 1) (h / 2 ) g (m 1) (h)
, m = 1, 2, ......... , g (0 ) (h ) = g (h )
m
2 1
h = 1:
O(h)
31
13
7
O(h2)
O(h3)
-5
1
h3
h2
f ( ), x0 < < x 2 . Hence TE
M 3 , where M 3 = max f ( x )
x x x2
3
3
44
f ( x) = 1 :
f ( x) = x :
dx (0 + 1 + 2 ) = 0
[ (
xdx 0 3 / 5 + 2
x 2 dx 0 3 / 5
)]
3/5 = 0
+ 2
2
3/5 = 0
0 + 1 + 2 = 2 , ( 0 2 ) = 0 , (0 + 2 ) = 10 / 9
Solving these equations, we get 0 = 2 = 5 / 9 and 1 = 8 / 9
It can be verified that the method produces exact results for f ( x ) = x 3 , x 4 and x 5 .
The error term is given by Error = cf vi ( ) / 6!,
6
6
x 6 dx 0 3 / 5 + 2 3 / 5 =
2
27 2 10 27
8
(0 + 2 )
=
=
7
125 7 9 125 175
8 1 (6 )
1
Hence, Error =
f (6 ) ( ).
f ( ) =
175 720
15750
c=
x0 = 1,
x1 = 2,
f 0 = f ( x0 ) = 1,
f 1 = f (x1 ) = 1/3
I = h[ f 0 + f 1 ] / 2 = 0.666667
h = 1/ 2 :
x0 = 1,
x1 = 3 / 2,
x2 = 2
f 0 = 1,
I = h[ f 0 + 2 f 1 + f 2 ] / 2 = 0.619048
h = 1/ 4 :
x 0 = 1, x1 = 5 / 4, x 2 = 6 / 4 x3 = 7 / 4
f 0 = 1,
f 1 = 0.571429,
f 2 = f (x2 ) = 1 / 3
x4 = 2
f 1 = 0.761905, f 2 = 0.571429
f 3 = 0.432432, f 4 = 1 / 3
I = h[ f 0 + 2( f 1 + f 2 + f 3 ) + f 4 ] / 2 = 0.608108
Using Romberg integration I (m ) (h ) =
4 m I (m 1) (h / 2 ) I (m 1) (h )
, m = 1, 2, .........
4m 1
45
o(h2)
o(h4)
o(h6)
0.666667
0.619048
0.608108
0.603175
0.604461
0.604547
f ( x, y ) = x + 2 y , h = 0.1
46