You are on page 1of 13

Higher Technological Institute

Tenth of Ramadan City


6th October Branch
Department of Basic Science.
Subject: Numerical Method (MTH 103) Term: Jan.-May 2015
Examiner: Examiners Committee Time: 90 min.
Final written Examination.

Answer the following questions:


Question 1. (8-points)
-4
Use a fixed - point iteration to determine a solution accurate to within 10 for
the following equation in the given interval x3-7x+5=0, [0,1].
x3 + 5 −5
Hint: use one of the following functions: g 1 = 3 7 x − 5 , g2 = , g3 =
7 x −7
2

Question 2.
a) Use Lagrange's method to Construct polynomial of degree two using the
following table, and hence calculate f(0.2) (5 points)
X 0 0.4 0.5
F(x) 0.4 0.57 0.68

b) Consider the following table to approximate f(1.85), f '(2.05) and


f (2.15) (8 points)
X 1.8 1.9 2 2.1 2.2
F(x) 10.8 12.7 14.8 17.2 20

Question3. (9-points)
2
Use Romberg integration to compute R4,4 for the following integral. ∫ x ln( x ) dx
1

Question4. (10-points)
Use Taylor's method of order two to approximate the solution of the initial value
problem y '= y2+y where 0 ≤ t ≤0. 3 and y(0)=1 with h=0.1
The model Answer:
Question 1 (8 points)
Use a fixed - point iteration to determine a solution accurate to within
10 -4 for the following equation in the given interval x3-7x+5=0, [0,1].
Hint: use one of the following function
x3 + 5 −5
g1 = 3 7 x − 5 , g2 = , g3 =
7 x −72

g1'=7(7x-5)-2/3/3 |g1'(0.5)|=1.78>1 rejected


g2'=3x2/7 | g2'(0.5)|=0.107<1
g3'=10x(x2-7)-2 | g3'(0.5)|=0.1097<1
x3 + 5
Taking g 2 =
7
x0=0.5
i 0 1 2 3 4 5 6 7
x 0.73214 0.77035 0.77959 0.78197 0.78259 0.78276 0.78280 0.782811
ε=|(0.782811-0.78280)/0.782811|=0.0000149<10-4

Question 2. (13 points)

a) Use Lagrange's method to Construct polynomial of degree two using the


following table, and hence calculate f(0.2)
X 0 0.4 0.5
F(x) 0.4 0.57 0.68

( x − 0.4)( x − 0.5) ( x − 0)( x − 0.5) ( x − 0)( x − 0.4)


P2 ( x) = * 0.4 + * 0.57 + * 0.68 =
(0 − 0.4)(0 − 0.5) (0.4 − 0)(0.4 − 0.5) (0.5 − 0)(0.5 − 0.4)
1.35 x 2 − 0.115 x + 0.4
f (0.2) = 0.431

2
b) Consider the following table to approximate f(1.85), f '(2.05) and
f (2.15)
X 1.8 1.9 2 2.1 2.2
F(x) 10.8 12.7 14.8 17.2 20

X F(x)
1.8 10.8
1.9
1.9 12.7
0.2
2.1
0.1
2.0 14.8
0.3 0
2.4
0.1
2.1 17.2
0.4
2.8
2.2 20

h=0.1,r=(1.85-1.8)/0.1=0.5
r ( r − 1) 2 r ( r − 1)( r − 2 ) 3 r ( r − 1)( r − 2 )( r − 3 ) 4
f ( x ) = y 0 + r∆ y 0 + ∆ y0 + ∆ y0 + ∆ y0 +
2! 3! 4!
r ( r − 1)( r − 2 )( r − 3 )( r − 4 ) 5
∆ y0
5!
f(1.85)=10.8+0. 5*1.9+0. 5*-0. 5*0.2/2+0. 5*0.5*1.5*0.1/6=11.73125=1877/160
h=0.1,r=(2.15-2.2)/0.1=-0.5
r (r + 1) 2 r (r + 1)(r + 2) 3 r (r + 1)(r + 2)(r + 3) 4
f ( x ) = y n + r∇ y n + ∇ yn + ∇ yn + ∇ yn
2! 3! 4!
r (r + 1)(r + 2)(r + 3)(r + 4) 5
+ ∇ yn
5!
f(2.15)=20-0.5*2.8-0.5*0.5*0.4/2-0.5*0.5*1.5*0.1/6=2967/160=18.5437
h=0.1,r=(2.05-2)/0.1=0.5
(∆y 0 + ∆y −1 ) r 2 2 r (r 2 − 1) (∆3 y −1 + ∆3 y −2 ) r 2 (r 2 − 1) 4
f ( x) = y 0 + r + ∆ y −1 + + ∆ y−2 +
2 2! 3! 2 4!
r (r 2 − 1)(r 2 − 2 2 ) (∆5 y −2 + ∆5 y −3 )
5! 2
1 (∆y 0 + ∆y −1 ) (3r 2 − 1) (∆3 y −1 + ∆3 y −2 ) (4r 3 − 2r ) 4
f ' ( x) = ( + r∆2 y −1 + + ∆ y −2 )
h 2 3! 2 4!
1 ( 2.1 + 2.4) 0.5 (3 * 0.52 − 1) (0.1 + 0.1)
f ' ( 2.05) = ( + 0.3 + ) = 557 / 240 = 23‫ ز‬208333333
0.1 2 2! 3! 2

3
Question 3. (9 points)
Use Romberg integration to compute R4,4 for the following integral.
2

∫ x ln( x)dx .
1

X 1 1.125 1.25 1.375 1.5 1.625 1.75 1.875 2


F(x) 0 0.132506 0.278929 0.437874 0.608198 0.788950 0.979328 1.178641 1.386294

R1,1=T0=(0+1.386294)/2=0.693147 M1=0.608198
R2,1=T1=(0.693147+ 0.608198)/2=0.650673 M2=(0.278929+.979328)/2=0.629129
R3,1=T2=(0.650673 +0.629129)/2=0.639901 M3=0.634493
R4,1=T3=0.637197
0.693147
0.636515
0.650673 0.636296
0.636310 0.636295
0.639901 0.636295
0.636296
0.637197

Question 4. (8 points)

Use Taylor's method of order two to approximate the solution of the initial value
problem y '= y2+y where 0 ≤ t ≤0. 3 and y(0)=1 with h=0.1
2 2
f' =2yy'+y'=(2y+1)(y +y)=2y3+2y2 +y +y = 2y3+3y2 +y

n=(0.3-0)/0.1=3
w0=1,t0=0
wi+1=wi+h(wi2+wi)+h2(2wi3+3wi2+wi)/2
w1=1+.1(1+1)+.12(2+3+1)/2=1.23
w2=1.23+.1(1.232+123)+.12(2*1.233+3*1.232+1.23)/2=1.5517
w3=1.5517+.1(1.55172+1.5517)+.12(2*1.55173+3*1.55172+1.5517)/2=2.0762

4
Higher Technological Institute
Tenth of Ramadan City
6th October Branch
Department of Basic Science.
Subject: Numerical Method (MTH 103) Term: Oct.-
Jan.2015/2016
Examiner: Examiners Committee Time: 90 min.
Final written Examination.

Answer the following questions:

Question 1. (7-points)
Use Newton's method to approximate to within 10 -4 the root of the following
equation in the given interval 6-x2+sin2x=0, [2,3].
Question 2. (12-points)
(a) Obtain the third Taylor polynomial for f(x) =(2+3x)-2 about x0=0, and use this
polynomial to approximate (2.15)-2 (6-points)
(b) Approximate f (0.5) , f '(0.5), f'' (0.5) using the following data by Newton
divided difference formulas (6-points)
X 0 0.2 0.4 0.6 0.8
F(x) 1.0 1.22140 1.49182 1.82212 2.22554

Question3. (13-points)
3
(a)Evaluate ∫ x(9 − x 2 ) 3 / 2 dx by using Simpson's rule take h=0.25
1

∫ xe
x
(b) Use Romberg integration to compute R3, 3 for the following integral dx
1

Question4. (8-points)
Use Runge Kutta method of order two to approximate the solution of the initial
value problem y′ = t + 3 y where 0 ≤ t ≤ 0.3 and y(0)=1 with h=0.1

5
The model Answer:
Answer the following questions:
Question 1 (7-
points)
Use Newton's method to approximate to within10 -4 the root of the following
equation in the given interval 6-x2+sin2x=0, [2,3].
xi+1=xi-(6-x2+sin2x)/( -2xi+2cosxisinxi)
i 0 1 2 3
x 2.5 2.518152422 2.518113616 2.518113616

Question 2. (12-
points)
a) Obtain the third Taylor polynomial for f(x) =(2+3x)-2 about x0=0, and use this
polynomial to approximate (2.15)-2
f(x) = (2+3x)-2 f(0) = 0.25
f'(x) =-2*3 (2+3x)-3 f'(0)=-0.75
f''(x) =-6*3*-3(2+3x)-4 f''(0)=3.375
f'''(x) =54*-4*3(2+3x)-5 f'''(0) =-20.25
P3(x)=0.25-0.75x+3.375x2/2-20.25x3/6=0.25-0.75x+1.6875x2-3.375x3
2+3x=2.15 then x=0.05
(2.15)-2=0.216296875
b) Approximate f (0.5) , f '(0.5), f'' (0.5) using the following data by Newton
divided difference formulas
X 0 0.2 0.4 0.6 0.8
F(x) 1.0 1.22140 1.49182 1.82212 2.22554

X F(x)
0 1.0
0.22140
0.2 1.22140 0.04902
0.27042 0.01086
0.4 1.49182 0.05988 0.00238
6
0.3303 0.01324
0.6 1.82212 0.07312
0.40342
0.8 2.22554

f (t ) = 1.49182 + t (0.27042 + 0.3303) / 2 + t 2 (0.05988) / 2


+ t (t 2 − 1)(0.1086 + 0.0131) /(2 * 6) + t 2 (t 2 − 1)(0.00224) / 24
h=0.2,r=(.5-0.4)/0.2=0.5
f(0.5)=1.49182+0.5*(0.27042+0.3303)/2+0.52*0.05988/2+0.5*(0.52-
1)*(0.01086+0.0131)/(2* 6)+0.52*(0.52-1)*0.00224/24=1.64871

f'(0.5)= ((0.27042+0.3303)/2+2*0.5*0.05988/2+(3*0.52-
1)*(0.01086+0.0131)/(2* 6)+(4*0.53-2*0.5)*0.00224/24)/0.2=1.64874
-
f''(0.5)= (2*0.05988/2+(6*0.5)*(0.01086+0.0131)/(2* 6)+(12*0.52-
2)*0.00224/24)/0.22=1.650104167

Question 3. (13-
points)
3
a) Evaluate ∫ x(9 − x 2 ) 3 / 2 dx by using Simpson's rule take h=0.25 (6- points)
1

X 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3


X(9- 22.62742 25.35423 26.30552 25.31882 22.36068 17.57978 11.40090 4.73963 0
x2)3/2
3
0.25
∫ x(9 − x dx = (22.62742 + 0 + 2 * (26.30552 + 22.36068 + 11 .40090) +
2 3/ 2
)
1
3
4(25.35423 + 25.31882 + 17.57978)) = 36.22762

b) Use Romberg integration to compute R3, 3 for the following integral (6-
points)
2

∫ xe
x
dx
1

x 1 1.25 1.5 1.75 2


xex 2.71828 4.36293 6.72253 10.07056 14.77811
h=1.0
T0=R1,1=1.0*(2.71828+14.77811)/2=8.748195

7
T1=R2,1=(8.748195+6.72253*1)/2=7.73536
T2=R3,1=(7.73536+1.0*(4.36295+10.07056)/2)/2=7.47605
R2,2=7.73536+(7.73536-8.748195)/3=7.39775
R3,2=7.47605+(7.47605-7.73536)/3=7.38962
R3,3=7.38962+(7.38962-7.39775)/15=7.38907

Question 4. (8 -
points)

Use Runge Kutta method of order two to approximate the solution of the initial
value problem y\=t+3y where 0 ≤ t ≤ 0.3 and y(0)=1 with h=0.1
w0=1,t0=0,h=0.1
k1=(0+3)*0.1=0.3 w0+ k1=1.3,t0+h=0.1
k2=(0.1+3*1.3)*0.1=0.4
kave=0.35
w1=1.35
w1=1.35,t1=0.1,h=0.1
k1=(0.1+3*1.35)*0.1=0.415 w1+ k1=1.765, t0+h=0.2
k2=(0.2+3*1.765)/3=0.595
kave=0.4823
w2=1.8323

w2=1.8323,t1=0.2,h=0.1
k1=(0.2+3*1.8323)*0.1=0.5697 w1+ k1=2.4020,t0+h=0.3
k2=(0.3+3*2.4020)*0.1=0.7506
kave=0.6601
w3=2.4924

8
T 0.0 0.1 0.2 0.3
Y 1 1.35 1.8323 2.4924

9
Higher Technological Institute
Tenth of Ramadan City
6th October Branch
Department of Basic Science.
Subject: Numerical Method (MTH 103) Term: Oct.-Jan. 2014/2015
Examiner: Examiners Committee Time: 90 min.
Final written Examination.

Answer the following questions:

Question 1. (7-points)
Use the Newton-Rhaphson method to approximate a solution of the equation
x = 2 −3 x in the given interval (0, 1) within 10-6 accuracy.
Question 2.
(a)Use Lagrange's method to Construct polynomial of degree two using the
following table, and hence calculate f(1.5) and f '(1.5) (8-points)
X 0 2 3
F(x) 1.0 9 27
(b) Given the following table: (10-points)
X 0 2 4 6 8 10
F(x) 3 5 9 16 30 48

Approximate f(0.5),f(4.3),f(9.8),f '(4.3) and f ''(4.3)


Question3. (7-points)
3
Use Simpson's rules integration to compute the following integral ∫ xe x dx .
2

(Take h=0.25 )

Question4. (8-points)
Use Runge Kutta method of order two to approximate the solution of the initial
value problem y′ = ( y 2 + y ) / t where 1 ≤ t ≤ 3 and y(1)=-2 with h=0.5

10
The model Answer:
Question 1 (7 points)
-4
Use Newton's method to approximate to within10 the root of the following
−3 x
equation in the given interval x − 2 =0, [0, 1].
xi +1 = xi − ( xi − 2 −3 xi ) /(1 + 3(ln 2)2 −3 xi )
i 0 1 2 3 4
x 0.5 0.4156021502 0.4186816112 0.4186862198 0.4186862198
Question 2. (8 points)
a)Use Lagrange's method to Construct polynomial of degree two using the
following table, and hence calculate f(1.5) and f '(1.5)
X 0 2 3
F(x) 1.0 9 27
( x − 2)( x − 3) ( x − 0)( x − 3) ( x − 0)( x − 2) 14 16
P2 ( x) = *1 + *9 + * 27 = x 2 − x + 1
(0 − 2)(0 − 3) (2 − 0)(2 − 3) (3 − 0)(3 − 2) 3 3
14 16
f (1.5) = *1.5 2 − * 1.5 + 1 = 7 / 2 = 3.5
3 3
f ' (1.5) = 2 * 14 * 1.5 / 3 − 16 / 3 = 26 / 3 = 8.6666667

b) Consider the following table to approximate f(0.5),f(4.3),f(9.8),f '(4.3) and f


''
(4.3) (10 points)
X 0 2 4 6 8 10
F(x) 3 5 9 16 30 48

X F(x)
0 3
2
2 5 2
4 1
4 9 3 3
7 4 -10
6 16 7 -7
14 -3
8 30 4
18
10 48
11
h=2,r=(.5-0)/2=0.25
r (r − 1) 2 r (r − 1)(r − 2) 3 r (r − 1)(r − 2)(r − 3) 4
f ( x) = y 0 + r∆y 0 + ∆ y0 + ∆ y0 + ∆ y0 +
2! 3! 4!
r (r − 1)(r − 2)(r − 3)(r − 4) 5
∆ y0
5!
f(0.5)=3+0.25*2+0.25*-0.75*2/2+0.25*-0.75*-1.75*1/6+0.25*-0.75*-1.75*-
2.75*3/24+0.25*-0.75*-1.75*-2.75*-3.75*-10/120=3217/1024=2.9724121
h=2,r=(9.8-10)/2=-0.1
r (r + 1) 2 r (r + 1)(r + 2) 3 r (r + 1)(r + 2)(r + 3) 4
f ( x ) = y n + r∇ y n + ∇ yn + ∇ yn + ∇ yn
2! 3! 4!
r (r + 1)(r + 2)(r + 3)(r + 4) 5
+ ∇ yn
5!
f(9.8)=48-0.1*18-0.1*0.9*4/2-0.1*0.9*1.9*3/6-0.1*0.9*1.9*2.9*-3/24-
0.1*0.9*1.9*2.9*3.9*-10/120=3217/1024=46.157655
h=2,r=(4.3-4)/2=0.15
(∆y 0 + ∆y −1 ) r 2 2 r (r 2 − 1) (∆3 y −1 + ∆3 y − 2 ) r 2 (r 2 − 1) 4
f ( x) = y 0 + r + ∆ y −1 + + ∆ y−2 +
2 2! 3! 2 4!
r (r 2 − 1)(r 2 − 2 2 ) (∆5 y − 2 + ∆5 y −3 )
5! 2
(4 + 7) 0.15 2 0.15(0.15 2 − 1) (4 + 1) 0.15 2 (0.15 2 − 1)
f (4.3) = 9 + 0.15 + 3+ + 3 = 9.794907031
2 2! 3! 2 4!
1 (∆y 0 + ∆y −1 ) (3r 2 − 1) (∆3 y −1 + ∆3 y −2 ) (4r 3 − 2r ) 4
f ' ( x) = ( + r∆2 y −1 + + ∆ y −2 )
h 2 3! 2 4!
1 (4 + 7) 0.15 (3 * 0.15 2 − 1) (4 + 1) (0.15 3 − 2 * 0.15)
f ' (4.3) = ( + 3+ + 3) = 35.32920139
0.15 2 2! 3! 2 4!
1 2 (∆3 y −1 + ∆3 y −2 ) (12r 2 − 2) 4
f ' ' ( x) = ( ∆ y −1 + r + ∆ y −2 )
h2 2 4!

1 (4 + 1) (12 * 0.15 2 − 2)
f ' ' ( 4.3) = (3 + 0. 15 + 3) = 2527 / 18 = 140.3888889
0.15 2 2 4!

Question 3. (7 points)
3
b) Use Simpson's rules integration to compute the following integral ∫ xe x dx
2

Take h=0.25.
X 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3
F(x) 2.718282 5.9634165 14.231604 37.41665 109.196300 355.466217 1295.032062 5292.790612 24309.25178

I=0.25(2.718282+24309.25178+4{5.9634165+37.41665+355.466217+5292.790612
}+2[14.231604+109.196300+1295.032062])/3=4159.619798
12
Question 4. (8 points)

Use Runge Kutta method of order two to approximate the solution of the initial
value problem y '= (y2+y)/t where 1 ≤ t ≤ 3 and y(1)=-2 with h=0.5
k1=0.5(-22-2)/1=1
k2=0.5(-12-1)/1.5=0
kave=0.5
y=-2+0.5=-1.5

k1=0.5(-1.52-1.5)/1.5=0.25
k2=0.5(-1.252-1.25)/2=5/64
kave=21/128=0.1640625
y=-171/128=-1.3359375

k1=0.5((-171/128)2-171/128))/2=0.780166626
k2=0.5(-0.5557708742-0.555770874)/2.5=0.1729304277
kave=0.4765485268
y=-0.8593889732

k1=0.5(-0.85938897322-0.8593889732)/2.5=0.3195876761
k2=0.5(-0.53980129712-0.5398012971)/3=0.1385311229
kave=0.2290593995
y=-0.6303295737

13

You might also like