You are on page 1of 15

Numerical Methods-1V

286 55 56
53 54
52 3-8030 3-8259
50 51 3.7563 3-7798

3-7084 3.7325
3-6840 Newton's forward
50 we use
require f'x) at
=
x
Solution. Since we backward formula.
Newton's
at x 56 we use
and to get f'lx)
=
Tormula
Difference Table

Ay Ay

50 3.6840
00244 - 0-0003
51 3.7084
0-0241 - 00003
52 3.7325 0
0-0238 - 0-0003
53 3-7563 0
0-0235
- 00003
54 3-7798 0
0-0232
- 0-0003
55 3-8030
0-0229
56 3-8259

By Newton's forward formula,

dy dy
dx = dx=0

-0024-000+
=0-02455

d =
-a'h+-]
50
= 1 [-00003] =-0-0003.
By Newton's backward difference formula,

dy dy
dr dr
from equation (12)
(dy
dx r= 56
00229+0003) +0
0-02275

from equation (13)


llon and Integr
gration
287

the
Example 2. The population of
rqte of growth
=[-0-0003]=-0-0003
a
certain town
of the given below. Find is
Year X
population in
1931, 1941, 1961 and 1971.
1931 1941
Population 1951 1961 1971
inthousands 40-62 60-80 79.95 I03.56 132-65
Solution. We form the difference table.
Ay Ay ay
1931 40-62
y
1941
20-18
60-80
19.15
-
103
1-03 -

1951 79.95 5.49


4-46 - 4.47
23-61 -02
1961 103-56 5-48
29-09
1971 13265

We use the same table for backward and forward differences.


(i) To get f(1931) and f'(1941) we use forward formula,
= 1931, x^= 1941, . .

'.0=1931 corresponds u = 0.

(dy. {-f*-ja,-t-]
dx = 193

20
10L
18--103)+(649)--447)
=2018+0515+ 1-83+ 1-1175]

= 2-36425.

9 4 1 -1931 1
(i) If x = 1941, u= 10

1, in
Putting u =

dy +24 + 3u-6u+ZA'yo
6
4-18u+224-y
24

We get
d 2 0 - 1 8 + 1 0 3 ) - 6 4 9 ) + 1 7 - 4 4 7 )
288 Numerical Methods-1V

20 18-0-515-0915 - 0:3725]
= 1-83775 ...(2)
Note: If we neglect the data against 1931 and täke 1941 as xo, we have

Avo 1915, A yo = 4.46, A'yo=1-02.

Now using
dy
dx=1941
TO 1915-449)+(102)
= 17260. ..(3)
Evidently the values given by (2) and (3) are not same. In getting the
answer given by (2), we have assumed a polynomial of degree 4 whereas
in getting the answer given by (3), we have assumed the interpolating
polynomial of degree 3 only. In fact, both polynomials assumed are
different. Hence we see the difference in answers.
(iii) To get f' (1971), we'use the formula,

T 2909648-j00)-447)
dy
dr 1031-0525]=3-10525.
1971

(v) To get f (1961), we use v= _1961-1971


L=-1
h 10
dy dy
dx
Jx = 1961
dx
p=-1
= lv,3v tóv +2 v yn6

29.09 (548)(102)--447)
.
2909 -2.74 0-17+0.3725]
= 2-65525.

Example 3.Find the gradient of the road at the


middle point of the
elevation above a datum line of seven points
of road which are given
below:
Numerical Differentiation and Integration 289
0 300 600 900 1200 1500 1800
135 149 157 183 201 205 193

Solution. We require
x = 900

Table
Ay Ay A'y A'y A°y
0 135

300 149 14
6
157 8 24
600 18 50
900 183
26 - 8 26 20
70
- 86

18 14
16
1200 201 4 2
16
1500 205 - 12

1800 193

Since x =900 is in the middle of the table we use one of the central
difference formula, in particular Stirling's formula.

dydx(avo ) +Ay-2
x=Xp

18+
300 26)--6-
12 26)+ 60 70-16
30
300
22+26666 +09
0-085222
Hence the gradient of the road at the
middle poinit is 0-084776.
results of an observation;
xample 4. The table below gives the
i s the observed temperature in degrees centigrade of a vessel of cooling
water; t is the time in minutes from the beginning of observation.
B 5 7 9

74:5 67.0 60.5 543


85-3
Find the approximate rate of cooling at t = and 3.5.
290 Numerical Methods-V

Solution. We form below the difference table.


Ae A°e
85-3
- 10-8
74-5 3.3
- 7:5 - 2:3
67-0 1-0
- 0-7
.6
65
60-5 03
- 6-2
9 54-3
de
represents the rate of cooling.
dt

At t3, u=1 At t=35, u = 125


h
(i) Putting u = 1 in equation (2),

di -108+ 03)--23)+1
-10-8+ 165+0:38333 +0 13333|
(de =-4:31667
dt3
(i) Putting u= 1-25 in (2). de
dt =125 =l-108+0-75 (3.3)
-

(0.1354)(-2:3) + (0.04948) (1.6)] = -

4-0067
dt -3-96718
dt
=35
Example 5. Find the value of f (0-5) using Stirling's formula from
the foRDuing data:
35 ()-40 0-45 0-50 0-55 0-60 0-65
y=f(x) /52 1 506 1488 -467 1-444 1.418 1-389
Solution.
Ay Ay A'y A"y A'y
0-35 1521 0015 0-003
0-40 1-506 - 0-018 -0003
0-001
0-001
0-45 1-488-0-021 (A'y-2) (A'y2)
- 0-003

0-50 1-467 (Ay) -0-002 0-001 -0-002 (AY-3)


0-55
(yo) -0-023 (A'y-1) 0-001
-0-001
0-003
1444 (Avo)
060
1-418-
0-026 0003 (&y) (Ay)
(Ay-) (A°y)
-0-029 - 0-003
0-65 1-389
nLE8rlon 299
21. From the table given below, find f' (30), f" (31) and f' (35).
X 30 31 32 33 34 35 36
f(x) 85-90 86-85 87.73 88-64 89.52 90-37 91-1
22. Find y and y" at 1-2
x =
given.
1-0 1-2 1.4 1-6 18 2-0 2-2
2.7183 3.3201 4-0552 4-9530 6-0496 7-3891 9.0250
23. Find the maximum value of
f(x) given the table.
1-2 1:3 1.4 15 1-6
0-9320 0.9636 0.9855 09975 0.9996

NUMERICAL INTEGRATION
9:7. Introduction

We know that f(x) dx represents the area between y =f(x), x-axis


and the ordinates x = a andx=b. This
integration is possible only if the
f ) is explicitly given and if it is integrable. The problem of numerical
integration can be stated as follows: Given a set of (n+ 1) paired values
(x y), i =0, 1,2,.. n of the function y=f(x), where f(x) is not knowwn

explicitly, it is required to compute ydx.

As we did in the case of interpolation or numerical differentiation,


we replace f ) by an interpolating polynomial P, ) and obtain

P,(x) dx which is approximately taken as the value for f(x) dx.

98. A general quadrature formula for equidistant ordinates


(of Nehton-cote's formula)
For equally spaced intervals, we have Newton's forward difference
formula as

y)=y (to+ uh) =Yot+uAyo +u(u- yo+ u(u-1)


yu
3!
(u - 2)Ayo+
..(1)
Now, instead of f(r), we will replace it by this interpolating formula
of Newton.
x-3
Here, u= where
h
h is interval of differencing.
Since A =X0+
+nh, and u =- we have n=u.

otnh
300 Numerical Methods-V
+ nh
where P, () is interpolating polynomial
P. (t) dx
of degreen.
" (u- 1) V
otuAyn uu-Dyo
2!
(u-)(u-2)
3!

+ hdu
Since dr hdu, and when x = X, u = 0 and when x=0tnh, u =n

hotu Ayp+ Ay+-3u+2u


3! +2yo du
2 a'yt

The equation (2), called


-+ 2)

general quadrature formula. GivingNewton-Cote's


various
quadrature
values for n, we
formula is a
of special formula. get a number
99. Trapezoidal rule
By putting n =
1, in the
quadrature formula (i.e.,
paired values and there are only two
interpolating polynomial is linear.)
oth
f ) d =ho+ Avo since other
differences
if n= 1.
do not exist

..3)
otn
sdr- flx) dr
=s)dx+ o+2h
f) dr++ otnh - 1 ) AS
) ) dr

0o+)+0+*+-1+y,)
Numerical Differentiation and Integration 301

C%+yn+201+t+t+yn-1
=[(Sumofthe first and thelastordinates)
+2 (Sum oftheremaining ordinates)
This is known as Trapezoidal Rule.
9-10. Geometrical interpretation

Geometrically, if the ordered y


pairs ) , i=0, 1,2,... nare
plotted, and if any two consecutive
points are joined by straight lines, Yo Ya
we get the figure as shown.
The area between f(x), x-axis° 2 X
o
and ordinates x = o and x=x, is

approximated to the sum of the


trapeziums as shown in the figure.
Note: Though this method is very simple for calculation purposes of
numerical integration, the error in this case is significant. The
accuracy of the result can be improved by increasing the number of
intervals and decreasing the value of h.

9-11. Truncation error in Trapezoidal rule


In the neighbourhood of x = Xo» we can expand y=f) by Taylor
series in powers ofx-o. That is,

y(a)=yo+ + 2! -y"++. .(1)


where Y=y -

ydx-o 1!

3! %+.

YoCa)+2Yo+ Yo+

(2)
if h is the equal interval length.
Also ydr=50o+y) area ofthefirst trapezium. =Ap
=
.(3)
308 Numerical Methods-v

Ele-a)h.M.
180
Hence, the error in Simpson's one-third rule is of the order hf

Example 1. Evaluate dx by using (1) Trapezoidal rule


(2) Simpson's rule. Verify your results by actual integration.
Solution. Here y (x) =r*. Interval length (b-a) =6. So, we
divide 6
equal intervals with h=>=1. We form below the table
3 -2 1 0 1 2 3
81 16 16 81
(i) By Trapezoidal rule,
y dx (sum
2 of the first and last ordinates
+2 (sum of the remaining ordinates)|
L(81+
2 81)+2 (16+1 +0+ 1 +16)]
115
(ii) By Simpson's one-third rule (since number of
ordinates is odd)
Jy dx-I(81 +81)+2 (1+ 1) +4 (16+0+ 16)]
98.
(ii) Since n =
6, (multiple of
three-eighths rule. By this rule, three), we can also use
Simpson's
y dx(81 +81)+3
(16+1+1+16) +2 (0)] =99.
(iv) By actual integration,
Md=2x 2x524397-2.
From the results obtained
rule by various methods, we
gives better result than see that
Simpson's
always-refer example 8). Trapezoidal rule (It is true in
general; but not
Eyámple 2. Evaluate dr usine
h0-2. Hence o42
+x* Stng Trapezoidal rule with
obtain an
formulae in this case. approximate value of t. Can you other
use
Solution. Let (MS. Ap. 92)
y (x) = -
1+2
Numerical Differentiation and Integration 309

Interval is (1-*) = 1 : The value of y are calculated as points


taking h =02
0-2 0.4 0-6 0-8 1-0
y
1+2 096154 0-86207 0-73529 0-60976 0-50000

() By trapezoidal rule,

o 1+xI0%+y,)+2 (1 +t+ Yn -1
(1+0-5) +2 (096154 +0-86207+0-73529 +0-60976)1
=
(0.1) [1-5 +6-33732
= 0-7837332

Byactual integration,..
=(tan(tan )=t/4
o1+

=0-783732
4
T 3-13493 (approximately.
In this case, we cannot use Simpson's rule (both) and Weddle's rule.

(since number of intervals is 5).


Example 3. From the following table, find the area bounded by the
curve and the x-axis from x = 747 to x=752.

x 7-47 7-48 7-49 7-50 7-51 7.52


y=f) 193 1-95 1.98 2-01 2-03 2-06
Solution. Since only 6 ordinates (n = 5) are given, we cannot use
Simpson's rule or Weddle's rule. So, we will use Trapezoidal rule.
7-52
Area= f(x) dx = 0-01 (193+206) +2(1.95+198 + 2-01+2-03)]
7.47
= 0-09965.
52
PExample 4. Evaluate the integral i=], log,x dr using Trapezoidal,

Simpson's and Weddle's rules.


Solution. Here b-a =5-2-4 1-2. We shall divide the interval into
6 equal parts.

Hence, h= 02. We form the table.


4 4-2 4-4 4-6 4-8 S-0 5-2
sa)=logx 13862944 14350845 1 4816045 15260563 15686159 16094379 1-6486586
310 Numerical Methods-/v

() By Trapezoidal rule,

logx dx =(1-3862944+ 1-6486586 +2(14350845


+1-4816045+ 15260563 + 15686159+ 1-60943791
= 1-82765512
(i) Since n =6, we can use Simpson's rule and Weddle's rule also.
By Simpson's one-third rule,
I=[(13862944+ 1 6486586) +2 (14816045+1-5686159)
+4 (14350845+ 1:5260563)]
= 1-82784724

(iii) By Simpson, three-eighths rule,


I 8
[(1:3862944+ 1648658 +3 (1-4350845 + 14816045
+1-5686159+ 1-6094379+2 (1-5260563)]
= 1-82784705

(iv) By Weddle's rule,


I- 10 [13862944 +5 (1-4350845) + 1-4816045
+6 (1-5260563) + 1:5686159+ 5 (1-6094379) +1-6486586]
= 1-82784739

Note: If the number of intervals is a multiple of six, we can use all the above
formulae.

Example 5. Evaluate I= 4dx using (i) Trapezoidal rule


(it) Simpson's rule (both) (iii) Weddle's rule. Also, check
integration. up direct by
Solution. Take the number of intervals as 6.
h= =1.
2 3 4
6
y Xx 0-5

(i) By Trapezoidal rule,

=2-02142857
Numerical Diferentiation and Integration 311

(i) By Simpson's one-third rule,

-1 =195873016
(ii) By Simpson's three-eighth's rule,

= 1-96607143

(iv) By Weddle's rule,

I31+5
10 (05)++
= 195285714

(v) By actual integration,

194591015.
dx =[log (1 +x)1=log,7 =

Example 6. By dividing the range into ten equal parts, evaluate


sin x dx by Trapezoidal and Simpson's rule. Verify your answer with

integration.
Solution. Range =T-0=T
Hence h10
We tabulate below the values of y at different x's.

0
10
2T
10
310 10 10
y= sin x 0-0 0-3090 0-5878 0-8090 0-9511 1-0
X 6 T 81
10
9E
10
TT

y sin x 0.9511 0-8090 0-5878 03090 0

Note that the values are symmetrical about x=

() By Trapezoidal rule,

I=90+0)+2(0-3090+0-5878+0-8090 +0.9511+10
+0.9511+0.8090+ 0-5878+0-3090)1
= 1-9843 nearly.
312
Numerical Methods-1V
(i) By Simpson's one-third rule (since three 11
are
ordinates),
16 C0+0)+2 (0-5878 +09511 +0.9511+ 0 5878)

= 2-0009 1
+4 (0-3090 +08090+ 1+0.8090+0.3090)1
Note: We cannot use
Simpson's three-eighth's rule or Weddle's rule here.
(iii) By actual
integration, I =(-cos x)6 =2
Hence, Simpson's rule is more accurate than the
Trapezoidal rule.
Example 7. Evaluate e dx by Simpson's one-third rule correct
to
five decimal places, by
proper choice of h.
Solution. Here, interval
length =b-a= 1

y=e:y= e.
Error = | El< 180 M, where M =Max (e) in the range.

180 e
We require (E) < 10
h'e
< 106
180
/4
h< 180x 10
h< 0.148
Hence we take h=01o have the
accuracy required.
0.1
dx=I(1 +e)+2 (++6+8
= 17182883
+4 (+3+5+ e7+]

By actual integration, J e dx=


(e%=e -

1=
171828183
Correct to five
decimal places, the answer
is 171828.
Example 8. Evaluate J, dx
by () Trapezoidal rule
rule (ii) Weddle's rule. Also (ii) Simpson's
check up the
Solution. Here, b-a=6-0=6. results by actual integration
Divide into 6
h==1. Hence, the table is equal parts

1 2
3 4
5
S 1-00 0-500 0200 0-100
0-058824.
6

0-038462 0-027027
316 Numerical Methods-y
d' in metres
12. A river is 80 metres wide. The depth at
Example
A distance x metres from one bank is given by the following tahi
Calculate the area of cross-section of the river using SImpson's rule.
40 50 60 70 80
0 10 20 30
9 12 14 8 3
d 4
(A.M.I.E.
Solution. Here h = 10. Area of cross-section is ydr

15
A O+3) +2 (7+ 12 +14) +4 (4+9+ +8)]
10
=3+66+ 144] =710 sq. metres.
Exámple 13. The table below gives the velocity v of a moving
Particle at time t seconds. Find the distance covered by the particle in 12
seconds and also the acceleration at t = 2 seconds.
0 2 4 6 8 10 12
4 6 16 34 60 94 136
(MS 1971)
ds dv
Solution. We know and
dt v, a dt
S=vdt
To get S, we have to integråtev
l2
S = . vdt=[(4+ 136) +2 (16+ 60) +4 (6+34+94)]|
(using Simpson's one-third rule)
= [140+152+536] =552 metres
Acceleration =a =|dv

Hence we require differentiation.


dt-2
Now we form difference table.
t Av
A
6
2
2 8
16 10
4
18 8
6 34
26 8
8 60 0
8
10 94 34
42 8
12 136
Numerical Differentiation and Integration 317

taking v=6
dt=2
10-3m/
EXERCISE 9.2

1. Evaluate taking h=0-2, using Trapezoidal rule. Can you use


1+
Simpson's rule ? Give reasons. (BR. B.Sc Ap. '91)

2. Compute the value of,using Simpson's rule and Trapezoidal rule. Take

h 0-25. (MKU 1972)


3. Evaluate d x to three decimals, dividing the range of integration into
o+x+1
8 equal parts using Simpson's nule. (MS 1992)
4. Evaluate Vsin x+ cos x dx correct to two decimal places using seven

ordinates.
2
5. Calculate sin x d by dividing the interval into ten equal parts, using

Trapezoidal rule and Simpson's rule. (B.Sc. BR. Nov. '94)

6. Findthe value of log2 from dr using Simpson's one-third rule

with h= 0-25. (MS. Ap. 1991)


1-4
7. Compute the value of J (sin x- logx+e) dr taking h=02 and using
0-2
Trapezoidal rule, Simpson's rule and Weddle's rule. Compare your results by
integration.
8. Work out the problem in question 7 by taking h= 01.
9. The velocity v of a particle at distance S from a point on its path is given by
the table below.
S in metre 10 20 30 40 50 60
V m/sec 47 58 64 65 61 52 38
Estimate the time taken to travel 60 metres by using Simpson's one-third rule.
Compare your answer with Simpson's 3/8 rule and Weddle's rule.

Hlint: v - dt 0 Takey
10. When a train is moving at 30
m/sec. steam is shut off and brakes are applied.
The speed of the train per second after seconds is given by
Time (): 5 10 15 20 25 30 35 40
Speed (): 30 24 195 16 13-6 117 10-0 85 70

You might also like