And Integratio: Times

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Numerical Differentiati NUMERICAL D

4 and Integratio Now

which is th
Numerical Differentiation
value of
approximate numerical
4.1.
the process of calculating or evaluating
xe x0,In*p, if f(*) is not known derivative
explict eqn.
For
(5) b
a set ofIt is n, is of
1, 2,.....value
assigned
derivatives of afunction f(x)at some
numerical values (x;, y), i=0, known. this method we fit an interpolation
as many
values of the function and then differentiate it timesan
polynomial to the given set of
interpolation formula to be used depends on the assigned value of T
desired. The choice of the
which derivative or derivatives are required. of derivative or deri
equi-spaced and it is required to find the valueFurthermore if the d
If thevalues ofx are Newton's, Sterling's or Bessel's formula.
any one of the of the given se
tives,we shall use
the point near the beginning or at,the point near the endrespectively, Als
ative is required at forward or backward interpolation formula
values then we shall use Newton'spoint near the middle of the given set of values then we shall
the derivative is to be found at the
formulae. If the values of x are not equi-spaced, we
shall
any one of the central difference formula.
Newton's divided difference or Lagrange's
the
interpolation formula, we can derive a formula for
Hence cOFresponding to each of the
derivatives.

4.2. Formulae for Derivatives


formulae for the function y=fx) which is
In the following sections, we shall derive the
tabulated for the values x; =Xo + ih, i= 0, 1, 2,.... n
1.Berivatives using forward difference formula
We know that Newton's forward interpolation formula is
u(u - 1) u(u - 1) (u -2)
y=Yo t 1 Ayo + 2! .Ayo + 3!
yo

u(u- 1) (u - 2) (u - 3)
4!
Ayot ...

.2)
where x=Xn t uh i.e., u=

du 1 .3)
dx h
On differentiating both sides of (1), w.r.t. u, we get

dy =1.Ayo + 2u -1 A'yo + 3u-6u +2 -Ayot 4u8-18u + 22u 6 A yo t .... ...(4


du 24 3! 4!
NIIUMERICAL DIFFERENTIATION AND INTEGRATION 85

dy_ dy du
Now
dx du dx

dy_1 2u - 1 3u-Gu +2 4u'-18u' + 22u -6 ...5)


dx 2! 3! 4!

which is the general formula, to compute the value of dy for non-tabulated values of x.
dx
For tabulated value of x, the formula (5) takes a simpler form, for example for r =Xo =
eqn. (5) becomes
...6)
Jx=o

To fnd second derivative : On differentiating both sides of (5) w.r.t. x, we get


d'y d(dy X
du
da2 du d dx
6u -6 12u2 -36u + 22 ...(7)
3! 4!

Puttingx=xo in eq. (7), we get


11 ...(8)
'yo - Ayo + 12A'-...|
Jx=
get higher order derivatives. For example
Proceeding exactly on similar lines, we can ...(9)
1 3

Jx=
and (9) can also be obtained as follows:
Aliter : Theformulae (6), (8)
EehD
We know that 1+A=
A) =A-A'+,4°-+..
1
hD =log (1 + 2 3
...(10)

D=-; 2

3
...(11)

12
...(12)

and

Now Dyo l.e., dx Jx=Ko


11
12
ay-ay+...
Jx=Xo
86
NUMERICAL ANALYSIS
1 3
and D'y, ie., da3
Jx=X0
which are same as (6), (8) and (9).
2. Derivatives using backward difference formula
We know that Newton's backward formula is
u(u +1) 2, u(u +1) (u +2)
2! 3!
u(u + 1) (u + 2) (u +3)
+
4! y, t .. ...(1)

where X=, t U, i.e., u= ..2)

du_ 1 ..3)
da h
On differentiating both sides of (1) w.r.t. u, we get
2u + 1 3u' + 6u +2 4u' +18u'+22u +6
dy-Vynt
du 2! 3! 4! yy,t.... ...(4)

Now
dy dy. du
dx du dx

2u + 2y, t 3u2 +6u+2 4u² + 18u + 22u+6


2! 3! 4!,
...5)

which is the general formula tocompute the value of dx for non-tabulated value of x.
For tabulated value of x near the end of the tabulated value, the formula (5) takes a simpler
form.
For example, for x=X, u =u), the formula (5) becomes
...(6)

ofind:second derivative:Differentiating both sides of (5)w.r.t. x, we get


d'y d(dy X
du
d du dx
6u +6 12u +36u + 22 1 ...(7)
3! 4!
Putting x=%, in eqn. (7), we get
d'y + ...(8)
d Jx=, 12

Proceeding exactly on similar lines, we can obtain higher order derivatives. For example
dy 3 ..(9)
Jx=n
NUMERICAL
DIFFERENTIATION AND INTEGRATION 87

Aliter : The formulae (6), (8) and (9)can also be


obtained as folloWs :
We know that 1-VE-1=p-hD

- AD =log (1 -V)=-|v+++t.

D=+ ...
D²= 1 | V + 2 + +1+ . .

1 5 137
h 12 180 +...
3
D=

1
Now Dy, i.e., dx
Jx=
5 137
D'y, ie., dx| 2y, + oy, +12y , +y+
6 180
Jx=x
dyl
and D°y, i.e., dx3
Jx=*n
which are same as (6), (8) and (9).
&. Derivatives using Sterling centraldifference formula
By Sterling formula, we have
Ayo t Ay- 1 u2 u(u²-1) A°y-1+ A°y-2, uu'-1) Ay-2t.
2
+ 24,1t 3! 4!
2

Differentiating both sides w.r.t. u, we get


3u?-1 A°y-1+A y-2 4u3- 2u ..(1)
dy (Ayo + Ay -1 + uAy-1t g. +
4!
Ay-2t ....
2
du 2

Since U =

du
dx
dy_dy du
Now du dx
dx
3u2-1/ A°y+A'y-2 +
2u-u Ay-2t
A'y-1 6 2 12
2 ..(2)

tabulated values of x.
compute the value of dx for non
which is the general formula to
88
NUMERICAL ANALYSK
For tabulated value at x=X, we have u=0
1 Ayo +Ay-1 1 A'y-1 t A'y -2,
-

2 6 2
Jx=)
To find second derivative:
Differentiating (2) w.r.t. x, we get
d'y d (dy)du
da? du du dx
-ay. 6u Ay-1 +A°y-2 6u'-1 1
6! 12

(A°y_1tA°y. 2 6u-1
2 12 Ay.t.. ...3)
which is the general formula to compute the value of for non tabulated values ofx. For tabulated
value at x = t0, we have u = 0

Jx=0
4. Derivative using Bessel's central difference formula
From Bessel's formula, we have

2! 2
1
2 u(u -1)
3! Ay-1+ 4! 2
Differentiating w.r.t. u, we get
1
dy -= Ayo + 2u -1 4y-1+ A'yo 3u2-3u +,
du 2! 2 3! y-1
4u'-6u-2u +2|
4! ...(1)

Since
du
dx h
Now dy_dy du
dx dudx
1
1
2u -14y.j+4y) 3u- 3u +2
2! 2 3!:
4u-6u - 2u +2|A*y-1+A*y -2
4! ..2)
NUMERICAL DIFFERENTIATION AND INTEGRATION 89

which is the general formula for finding the value ofy atx near the middle of the tabulated values.
dx
Eor tabulated values at x=x0, we have u=0

[dy 1 1
dx
24
(a'y-+Ay-p) +.. ...(3)

ofind second derivative:


Differentiating (2) w.r.t. x, we get
d'y d dy du
dx? du |du dx
+Ayo.6u -3 6u-6u-1 (a*y+a'y.)t. ...(4)
6 Ay-1t 24

which is the general formula to compute the value of dy2 at x near the middle of the tabulated
values.

For tabulated values at x=Xo, We have u =0

2
4y-1-41 (ay+A'y-) +...
Jx=0
5. Derivative using Newton's divided difference formula
By Newton's divided difference formula, we have

fx) =fro) + (*-*)A f) +( -*)(* -x) A fro)

+ (*- x0) (x-x) (x - *) fr)


...(1)
+ (* - x) ( -x) (* - x) (* - xg)

Differentiating w.r.t. x, we get


fxo)
f'(x) = A f) + (2x - x -X) &
+x, t xgol fzo)
+ (3r- 2c (xo +*1 t x) +xot|
xot) fr)
3r (o +x1 + *, t x4) + 2x (x*, +xg +*ggt xg0 +x1x3 +
+ [4x°-

value off'(r) when the values ofx are not equispaced.


which is the required formula for finding the
NUMERICAL ANALYSIS
Example 1. Find the first and second derivatives of thefunction y =fx) tabulated below atthe
point x = 1·1.
1-2 1:4 1-6 1-8 2-00

0-00 0-1280 0-5440 1-2960 2:4320 4-00


f(x):
Solution. Since the values of derivatives are required at x = 11 which lies near the tabulated
values, we shall use Newton's forward formula.

Ay A²y A'y
1 0-0000
0-1280

1-2 0-1280 0-2880


0.4160 0-0480

1.4 0-5440 0-3360 0

0-7520 0-0480

1-6 1-2960 0-3840


1-1360 0-0480

1-8 2-4320 0-4320


1-5680
2-0 4-0000

From Newton's forward formula, we have


2u -1 3u2- 6u+2
dx 2! 3!

and d'y 1
[A Yo+ (u - 1) 4' yl
11-1 1
Here h= 0-2, =1, x=11 and u= 0-2 . 2
1
10.1280 +0, 4x6 x00480=0.630
dz11 1 0-0480
and 0-2880 - 6-60
dr J11 (0-2)° 2

Example 2. Given that

1-0 1-1 1-2 13 1-4 1-5 1-6

y: 7-989 8-403 8-781 9-129 9.451 9.750 10-031

Find dy and at (i) x=1:1 (iü)x= 1-6.


dx
91
NIUMERICAL DIFFERENTIATION AND INTEGRATION

Solution. (i) The difference table is

Ay A?y A'y A°y


1-0 7:989

0.414
1-1 8.403 0-036
0-378 0-006
1-2 8.781 0-030 -0-002
0-348 0-004 0-001
1-3 9-129 -0-026 0-001 0-002
0-322 0-003 0-003
1.4 9951 -0.023 0-002
0-299 0-005
1-5 9.750 -0-018
0-281
1-6 10-031

From Newton's forward formula, we have


...(1)

...(.2)
and
Jx=0
Here h=0-1, to=11 (which belongs to the tabulated values)
yo=+0-003.
Ayo = 0-378, Ayo =-0-030, A° yo = 0-004, Ayo =-0-001, A°
Substituting these values in (1)and (2), we get
dy 1
(0-1)|"
0378-(- 0.080)+(0004)-(-0-001) +.
*=11
1
(0-378 + 0-015 + 0-0013 + 0-0002] = 3-945
0-1
1 +
and
= 0-030 - (0-004) +x(-0-001)
12
Jx= 11 (01)|
1
n0-0034] =34
end of
to find the values of derivatives at x= 16, which lies near the
formula,
(iüi) In this case, we have tabulated values. Hence from Newton's backward
tabulated values and also belongs to the
we have
92
NUMERICAL ANALYSIE
1

dx=x,
and
Jr=I,

Here h =0-1, , = 16, Vy, =0-281, Vy, = -0018, V'y, = 0.005


y, =0002, Vy, = 0003
On putting these values in (1) and (2), we get
dy 1 1 1

d=16 0-1

= 2.748
o281*>+,-0018) +,(0.005) + (0002) + (0.003) +

d"y 1 11
and
dr Jr=16 (0.1)°|
0-018 + 0-005 +
12 (-0001)+-0001) +..
=-1:47
Example 3. Find the value off '() at x=04 from the following table :
0-01 0-02 0-03 0-04 0-05 0-06
fx): 0-1023 0-1047 0-1071 0-1096 0-1122 0-1148

Solution. Since the value of derivative is required at x 04 which lies near the middle of the
tabulated values. Hence we shall use one of the central difference formula. In this question, we have
used Bessel's formula

Here x=0-04, h=0-01,


.: Let I-0-04 du 1
h dx h
At x =0-04, u=0
d d du
Now
d fu) = du lu) xfw)
The difference table is

fu) Afu)
0-01 -3 0-1023
0-0024
0-02 -2 0-1047 0-0000
0-0024 0-0001
0-03 -1 0-1071 0-0001 -0-0001
0-0025 0-0000
0-04 0 0-1096
0-0001 0-0001
0-0026 -0-0001
0-05 1 0-1122 0-0000
0-0026
0-06 2 0-1148
NUMERICAL
DIFFERENTIATION AND INTEGRATION 93

From Bessel's formula, we have


1
fu) =, k0) +A1) |4 fO)+ 4(u- 1) 1 lAf- 1) +4'fO))
2!
1
9u(u - 1)

3! AA-)+ (4 +1) u(u4!- 1) (u-2).(af- 1) +A'A-2)1


Differentiating both sides w.rt. u and then putting u = 0, we have
1
f0) =AfO) -(Af-1) 1 IAf- 1) +A' f- 2))
+4² f0)) +121 4°-1)+:24
4
=0-0026-*(0-0001
4
+0-0000] + 121 (-0-0001] + 241 [-0-0001 - 0-0001]
0-0001 0-0001 0-0002
= 0-0026
4 12 24
0-03075
12

Now
d
f0-4)): f(0)_ 0.03075 =0-2561.
dx h 12x 0-01
Example 4. Given the values of an emperial function fx) for certain values of x, find f (93).
60 75 90 105 120

28.2 38-2 43-2 40-9 37-7


fx):
which lies near the middle of the
Solution. Since the value of derivative is required at x = 93formula. In this question we have
tabulated values. Hence we shalluse one of the central difference
used Stirling's formula.
X-90 du 1 here h= 15
Let dx h'
h
o3- 90
At x=93, u= =0.2
15

The difference table is

fu) Afu) Afu)


60 -2 28-2
10-0
38-2 -5-0
75 -1
5-0 -2-3
-7-3 8.7
43-2
90 6-4
-2-3
40-9 -0-9
105 1
- 3-2
2 37-7
120
94

formula is
We know that Sterling's
Af0) +Af-1) ,A'f- 1)
fu) =f(0) + u. 2 2!
1JAf- 1) + 4°f- 2),uu²- 12)
u(u- 4! f-2) +t..
3! 2

putting u =0-2, we get


Differentiating both sides w.r.t. u and then
Af-1),2(0-2) Af- 1) + S(0-2)°- 1A- 1) +Af- 2)|
f(u)= Af0) +2 2! 3!
4(0-2) - 2(0-2)
4! Af-2)
0-032 -0-4
-2-3 + 5-0 +0-2(-7-3) + 0-12-1
12 [6-4- 2-3] + 24
(8-7)
2
0-30067-0.1334 = -0-54407
= 1-35 - 1.46
1
x(-0-54407)
Now f()) t=93 U=0.2 15

=-0-03627
=fx) tabulated below at the point
Example 5. Find the first derivative of the function y
t= 10.

5 11 27 34

- 13 23 899 17315 35606


fx):
Newton's divided
Solution. Here the values of x are not equi-spaced. Hence we shall use
difference formula. The divided difference table is

fx) fx) f)
3 - 13
18
5 23 16
146 1
11 899 40
1026 1
27 17315 69
2613
34 35606

Since fourth difference is zero, Newton's divided difference formula is


fx) =fxo) +(*-*) A fxo) +(x- x) (x -x) A fxo) + (x- x) (x- *) (* - 2) T30)
+ (*- x0) (-*) (x-x) (x- g) fr) .(1)
NIIMERICAL DIFFERENTIATION AND INTEGRATION 95

On differentiating both sides


w.r.t. X, we get
f() = A To) + (Z--*) fx) + I3:2-2x (xn +X, +xo) +xo1t x*g +Xy Xo )

...(.2)
Putting x0 =3, *1=5,* = 11, x = 27, x, =34 and x= 10 in
(2), we get
f(10)= 18 +12 x16+ 23x1=233.
EXERCISE 4(a)
1 Findy'(0) and y"(0) from the following table:
0 2 4
f(«): 4 15 7 6
[M.D.U. 2006]
2. Find the first and second derivatives offc) atx = 1-5 if
1-5 2-0 2-5 3-0 3-5 4-0

fr): 3-375. 7-000 13-625 24-000 38-875 59-000

3. Find the first and second derivatives of the function tabulated below at
()x=1-00. (ü) x=1-25 (iiü)x = 115

1:05 110 1.15 1-20 1-25 130

1-0247 1-0488 1-0723 1-0954 1-1180 1-1401


fe): 1-0000

4. Find the derivative off(x) at 0-4 given the following table:


0-1 0-2 0-3 0-4
1-10517 1-22140 1-34986 1.49182
fr):
following table:
Using Bessel's formula, findf'(7-50) from the
7-50 7-51 7-52 7-53
7-47 7.48 7.49
0-201 0-203 0-206 0-208
0-193 0-195 0-198
fe):
pointx = 1,
tabulated in the scheme below. Find the derivative at the
6. The function y = sin x is
1·1 1-2 1:3
0-9 1-0
0-7 0-8
0-891207|0-932039 |0-963558
0-644218 |0-717356|0-783327|0-841471
fx) :
ofx andy =fr):
7. Given the foilowing pair ofvalues 8 10
2 4
1 27
5 21
1
y=f):
derivative atx=4. f(7) = 1-690, f(9) =1908,
Determine numerically the first f(8), given that f6) = 1-556,
Using divided difference, find the value of
8.
f12)= 2-158.
NUMERICAL ANALYSk
96

NUMERICAL DIE
time (t) is given in the following table:
The distance (s) covered by a car in a given
18 20 24
Time (Minutes) 12 14 Alsotak
23 25 34
Distance (Km) 14 18

Find the acceleration of the car at t = 17


minutes.
IM.D.U. 2005
1 13-5: 57-6667 2. 4-75: 9
ANSWERS and

0-2732 (iü)0-4473; 0-1583 (iii)0.4662: 0-2043


3. (i) 0-5005:
6. 0-54030 We h
1-4913 5. 0-22666
4.
2-883 8. 0-10859 9. -0-1334 Km/minute
7.

4.3. Numerical Integration (K.U. 2005,


numerical value of the definite inte
It is the process of calculatingor evaluating approximate integrand is a single variable
ral from a given set of numerical values of the integrand. If the quadrature. The nr
process is called quadrature or numerical quadrature or mechanical Here we als
cess of numerical integration is similar to the process of numnerical differentiation.
approximate the integrand by a polynomial with the help ofa suitable interpolation formula and
then integrate this expression between the desired limits.
Sometime fx) is known but it is not possible or easy to find the integral off(x) by the analytical
et
methods of integration. For example, when fx) = . e etc. In such cases, the approximate value
of $he definite integral can be calculated by applying the technique of numerical integration.
In the following section, we shall derive some simple and useful quadrature formulae.
44. Newton-Cotes Quadrature Formula

Let y dx, where y =f*), be the integral which is tobe evaluated numerically, when a
a

set of tabulatedvalues (x;, y), i=0, 1, 2,...n has been given. Let the values of the argumentsx,
Ij,...*, be equi-spaced with x =a, X =*o + h, x =* + 2h,.... * =*0 +nh =b.
w
Clearly with these arguments the interval (a, b) has been divided into n equal sub-intervals th
b-a
each of width h=

Yn-1

Yo

X
X,+h x% +2h X+ (n-1)h x+ nh
Fig.
NUMERICAL DIFFERENTIATION AND INTEGRATION 97

Also taking a new variate u such that

U=

Or x=X +h.u ...(1)


and dx = hdu
ot nh
We have ydu =| fx) dx

fo + hu) h . du

=h ülu - 1) u(u - 1)(u- 2)


: 2! yo +
0 3!

ulu - 1) (u- 2) (u - 3) u(u- 1) (u - 2) (u - 3) (u -A)


4! 5! yo
u(u - 1)(u - 2) (u - 3) (u - 4) (u -
5) A6 Na t..to (n + 1)terms du
6!

[ByNewton's forward interpolation formula]


n n) Ayo + n n5 3n 11n3 -3n2)4yo
I=h|nyo t Ayo+ 3 2 2! -n³ +n 3! 5 2
+
3 4!

+
n - 2n + 35n 50n + 12n
6 4 5!

n 15n6 + 17n5 225n 274n3 60n2


7 6 4 3 6! ...(2)

which is the general quadrature formula and is known as Newton-Cotes quadrature formula. From
this general formula by putting n = 1, 2, 3, 4, ... we get number of quadrature formuBae.
Now, we shall derive some important quadrature formulae taking n = 1, 2, 3, 4 and 6.
Tapezoidal Rule: Putting n = 1in (2) and neglecting the second and higher order differ
ences*, we get

...(3)

When n =lwe get only two values Yo Yi corresponding to x, and x,. From these we can find the
differences upto first order only. Also from given two set of values ( Yo), (1, y) we can fit a
polynomial of degreeone (i.e., a straight line) and hence all difference above order one are zero.
98 NUMERICAL ANALYS
Eq. (3)gives the area of one strip bound by x=Xo and x= to +h.
Similarly using the formula (3), we find that

t 3h
fr) dx = l', +yal

fr) dx = ly, -tyn


pt (n - 1)h

Pto th ot nh
Hence fr)dx : fo) dx t..+| fx) dx
Xo + (n - 1) h

2 l(o +y)+ 2 ('1 +y, t ... +yn-1)!


h [(Sum of first and last ordinates) +2 (Sum of allthe intermediate ordinates)) ..6)

Thi_rule is called trapezoidalrule.


mpson's one-third rule: [K.U. 2005)
Putting n = 2in (2) and neglecting the third and higher order differences*, we get
rp + 2h
22 (23 22) 4 yo
3 2 2!

....6)

Clearly, equation (6)determines the area of two strips bounded by the


o+ 2h, at a time. ordinates at x, o +h,
Similarly using the formula (6)by taking n a multiple of 2, we find that

When n =2, the polynomial to be fitted is of degree 2i.e., a


differences above second order are zero. parabolay=at bx+ cr² and hence a.
NUMERICAL DIFFERENTIATION AND
INTEGRATION 99

x+ 4}h
fx) da h

fx) dx = ly, +4y; +ydl ...(7)

eto t nh
fx) dx = ly,-2+4yn -1 t)
to t (n - 2) h

On adding all these results, we get


o+ 4h ot nh
fx) dx + flc) dx +... fx) dx
o + 2h 0 + (n- 2) h

=, lyo t yn)+4 (Ë t y3 +y5 +... +yn-) +2 (y2 + y4 + Y6t... +yn-2)I


h
=[(Sum of first and last ordinates) +4(Sum of odd ordinates)
+2 (Sum of even ordinates)] ...8)
This ryBeis c¡lledSimpson's one third rule or simply Simpson's rule and is commonly used.
Simpsors three-eighth rule: [M.D.U. 2005]
Putting n=3 in (2) and neglecting ll differences above third order, we get
Pto + 3h
fx) dx =h| 3y, + Ayo + (38 g2)4yo(34 -33 + 32
3 2 2! 4 3!

9 3
=h| 3yo +,2 o1-Yo)+(2 -2y1 +yo) + - 9, +3y, -yo)
- 3 Yo + 3y +3y, +y] ...(9)

Clearly, equation (9) determines the area of three strips bounded by the ordinates at
0, o + h, to + 2h, xo + 3h, at a time. Similarly using the fomula (9) by taking n a multiple of 3, we
find that
3
f) dx = lyg +3y4 +3y; +yd
fo + 9h
fe) dx =ly6+3y, +3ys +y¡l ..(10)

ro t nh
fx) dx = bn-gt3yh-2+3y,-1t yl
to + (n -3) h
NUMERICAL
100
N
results, we get
Onadding all these o t 3h
ko t nh

fx) dx + f(x) dx + .... + fx) dx


fx) dx =
I= to t 3h Xo +(n -3) h

3h t yn-2) +3(9 +y; +yg t ... vn-1


[(yo + y,)+ 3(y; ty4 t y, t ,
8
+2 (ya tY%t 9t t yn -)]

3h + Yn-2 + Yn -1)+Z Y3 +ystYg t .ty, l


or I= [(vo+ y,)+ 3(y1 + y t y4 t y6 + y t

three-eighth rule.
This rule is called Simpson's 11.
NUMERICAL DIFFERENTIATION AND 101
INTEGRATION
3h
Similarly, fr) da = 10

and so on.
Adding all these integrals from x,to Xh t nh, where n is a multiple of 6, we get
3h
fx) dr =
10
(16)
This rule is called Weddle's rule.
Error in quadrature formulae. The error in the quadrature formulae is given by
E y dx P(x)dx [M.D.U. 2005)

where P(x) is the polynomial representing the function y=fx) in the interval la, b|.
SOL VED EXAMPLES

5-2
log x dx, given that
Example 1. Using trapezoidal rule, caleulate the value of the integral

4-0 4-2 4-4 4-6 4-8 5-0 5-2

13863 1-4351 1-4816 1-5260 1-5686 1-6094 1-6486


log, x

Compare it with the exact value.


Solution. Here width of interval h = 0-2, xo =4-0, x, =to +h=4-2,.., xo +6h = 5-2
and corresponding values are given yo Yly yg
Now by Trapezoidal rule, we get
.5-2
log, xdx =yo
2
+ys)+ 2 ('1 +y2 +y3 +y4 ty)l

1-6094)
((1-3863 + 1-6486) + 2 (1-4351 + 1-4816 + 1-5260 + 1-5686 +

= 01[3-0349 + 15-2414] = 1-8276


Also exact value is given by
5-2 q52 [On integrating by partsl
log, xdx =*. log, z-*
= (5-2 log, 5-2 - 5-2)-(4 log, 4 - 4)
= (5-2 × 1-6486 - 5-2) - (4 x 1-3863- 4) = 1-8275
b
Hence error ydx - Plx) dx = 1-8275 - 1-8276 = 0-0001
102

NUMERICAL ANA
1
Example 2. Evaluate dx by using
0

()Trapezoidal rule (ü) Simpson's one-third rule


(o) Simpson's three-eighth rule (iv)Weddle's rule
and compare the result with its actual value.
Solution. We divide the interval (0, 6) into6 equal partseach of width h
1 =1. The yalue
function y =fx) = 1++2 at each point of the sub-division are given below:

1 2 3 4 5 6
y: 1-0 0-500 0-2000 0-1000 0-0588
0-0385 0-0270
Yo

(i) By Trapezoidal rule.,


1

=(1+ 0-0270) +2 (0-5 +0-2 +0-1 +0-0588 +0-0385)1


= 1-4108

(ü) By Simpson's 31 rule,


6
1
1+:2 dx = l(yo +y;) +4 (y; +y3 +ys) +2 (y2 +
y4)l

;(1+0.027) +4(0-5 + 0-1 +


0-0385) + 2 (0-2 + 0-0588)]
= 1:366:2

(iiü) By Simpson's 3 rule,


1
3h8 (yo+y)
+3 (1 +2 ty4 + ys) + 2y3l
3 (1+ 0-027) + 3 (0-5
+0-2 + 0-0588 + 0-0385) + 2
(0-1)1
=13571
NUMERICAL DIFFERENTIATION AND INTEGRATION 103

(iv) By Weddle's rule,


3h
dx = l'o + 5y +y, +6yg t y4 +5y; +y¡l
1+x' 10

=0-3 |1 + 5(0-5)+0-2 + 6(0-1)+ 0-0588 + 5(0-0385) + 0-027|


= 13735

6
1
=tan 6= 1-4056
Also 1+** ;dr =[tan1, Jo

Example 3. Evaluate e dx, by Simpson's rule using the data

e=2-72, e=7-39, e =20-09, e =54-60


[K.U. 2006]
actual value.
and compare it with the
the interval (0, 4) has been divided intofour equalsub-intervals. Hence width
Solution. Here
of each interval

h=
4-0 =1 and cÍ =0,x =1, , =2, xg =3, *4=4.
4

1
By Simpson'srule,we have
pto t 4h
4
+y9) +2y2l
e dx= y dx = lão +y) +4 (1

20-09)+2 (7-39)]
= (1+54-60) +4(2-72 +
1 [55-60 + 91-24 + 14-78]

=;(161-62) =53-873

is
The actual value of integral
=|e= let - el =(5460 - 1] =5360
dz

Example 4. Evaluate e dx bySimpson's rule.


1-0
equal parts each of width h =. 10 =0-1.
interval(0, 1) into 10
Solution. Let us dividethe
104
NUMERICAL
The values of function at each point of sub-intervals are as given below :
NU

y= y (for odd) y (for even)


0-0 0-0 1-00000
0-1 0-01 0-99005 0-99005
0-2 0-04 0-96080 0-96080
0-3 0-09 0-91393 0-91393
0-4 0-16 0-85214 0-85214
0-5 0-25 0.77880 0.77880
0-6 0-36 0-69768 0-69768
0-7 0.49 0-61263 0-61263
0-8 0-64 0-5273 0-52730
0.9 0-81 0-4449 0.4449
1-0 1-00 0-36788
Total 3-74031 3-03792
1
By Simpson's 3 rule,

f e dx = [(Sum of first and last


ordinates)

+4 (Sum of odd ordinates) + 2 (Sum of even ordinates


0-1
[(1 + -36788) + 4 (3-74031) + 2 (3-03792))
0-1
[1-36788 + 14-96124 +6-07584]
=0-746832.
0.7
Example 5. Evaluate * e dx approximately by using suitable formula.
05
Solution. Divide the range of integration (0-5,0-7) into 4 equal parts
h= 0-7-0-5 each of widtn
4
= 0-05.

Thevalues ofy for each point of


sub-division are given below :
y=x/2e*
0-5
0-4288818
0-55
0-4278774
0-60 0-4251076
0-65 0-4208867
0-70 0.4154730
NUMERICAL DIFFERENTIATION AND INTEGRATION 105

1
On using Simpson's rule, we get
3
0.7
12e dx = 3 l(yo +y) +4 (y; +y3) +2y2)
0-5
0-05 ((0-4288818 + 0-4154730) + 4 (0-4278774 + 0-4208867) + 2(0-4251076)]
3
0-05 [0-8443548 + 3-3950564 +0-8502152|
3
= 0-0848271.
starts from rest, is given at fixed intervals
Example 6. The velocity v(kmImin) of abike which
of time (min.)as follows :
14 16 18 20
4 8 10 12
t: 2
11 5 2
18 25 29 32 20
10

covered in 20minutes.
Estimateapproximately the distance
covered in t (min.).
Solution, Let S (km)be the distance
dS
We know that =U
dt
covered in 20 minutes is given by
Hence required distance S
t Vg)l
t Us t U, t Ug) + 2 (V, + V4 + Vg
20
h
vdt =3 I(vo + U10) +4 (uj + Ug
(By Simpson's 1 /3 rule]

Here h=2, at t=0, v=0


Ug = 25 etc.
Vo=0, Vj= 10, Vg = 18,
2 (18 +29 + 20 +5))
S=[0+4 (10 + 25 +32 + 1l+2) +
2
=(320+ 144] = 309-3333 km.
between
formed by rotating about the x-axis, the area
is :
Example 7. A solid of revolution
curve through the points with the followingco-ordinates
and a
X-axis, the lines x=0and x = l
0-50 0-75 1-00
0-00 0-25
0-9089 0-8415
0-9896 0.9589
1-0000
y:
formed using Simpson's rule.
Estimate the volume of the solid
interval
Solution. Here width of the
y, = 0-8415
yo =1, y1=0-9896, y, =0-9589, y, = 0-9089,
h=0-25,

You might also like