0% found this document useful (0 votes)
166 views27 pages

Wa0010.

This document discusses numerical differentiation and integration techniques. It provides examples of using divided difference tables and Newton's formulas to calculate derivatives and integrals at given points using unequally spaced data. Formulas and steps are shown to find velocity and acceleration from distance-time data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
166 views27 pages

Wa0010.

This document discusses numerical differentiation and integration techniques. It provides examples of using divided difference tables and Newton's formulas to calculate derivatives and integrals at given points using unequally spaced data. Formulas and steps are shown to find velocity and acceleration from distance-time data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

NUMERICAL DIFFERENTIATION AND INTEGRATION • 345

Derivatives using unequally spaced values of argument


(i) Lagranges’s interpolation formula is
( x  x1 )( x  x2 )( x  xn )
f ( x)  f ( x0 )
( x0  x1 )( x0  x2 )( x0  xn )
( x  x0 )( x  x2 )( x  xn )
 f ( x1 ) 
( x1  x0 )( x1  x2 )( x1  x n )
Differentiating both sides w.r.t. x, we get f (x).
(ii) Newton’s divided difference formula is
f  x   f ( x0 )  ( x – x0 )f ( x0 )  ( x – x0 )( x – x1 )2 f ( x0 )
( x – x0 )( x – x1 )( x – x2 )3 f ( x0 ) 
Differentiating both sides w.r.t. x, we obtain
f  x   f ( x0) [2 x – ( x0  x1 )] 2 f ( x0 ) [3 x2 – 2 x( x0  x1  x2 )
( x0 x1  x1 x2  x2 x3 )] 3 f ( x0 ) 

EXAMPLE 8.1
Given that
x: 1.0 1.1 1.2 1.3 1.4 1.5 1.6
y: 7.989 8.403 8.781 9.129 9.451 9.750 10.031
2
dy
find and d y at (a) x  1.1 (b) x  1.6.
dx dx2
Solution:
(a) The difference table is:
x y  2 3 4 5 6
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 9.451 – 0.023 0.002
346 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

x y  2 3 4 5 6
0.299 0.005
1.5 9.750 – 0.018
0.281
1.6 10.031
We have
 dy  1 1 2 1 3 1 4 1 5 1 6 
    y0   y0   y0   y0   y0   y0  (i)
 dx x 0 h 2 3 4 5 6 

 d2 y  1 2 11 5 137 6 
and 
 dx2   h2   y0  3 y0   4 y0   5 y0   y0  (ii)
 x 0  12 6 180 

Here h  0.1, x0  1.1, y0  0.378, 2y0  – 0.03 etc.


Substituting these values in (i) and (ii), we get
 dy  1  1 1 1 1 
   0.378  (0.03)  (0.004)  (0.001)  (0.003) 3.952
 dx  0.1 2 3 4 5 
 d2 y  1  11 5 
 2
  2
0.03  (0.004)  (0.001)  (0.003)3.74
 dx  (0.1)  12 6 

(b) We use the above difference table and the backward difference op-
erator  instead of .
 dy  1 1 2 1 3 1 5 1 6 
    yn   yn   yn   yn   yn  (i)
 dx x n
h 2 3 5 6 

 d2 y  1 2 11 5 137 6 
and 
 dx2   h2   yn  3 yn   4 yn   5 yn   yn  (ii)
 xn  12 6 180 

Here h  0.1, xn  1.6, yn  0.281, 2yn  – 0.018 etc.


Putting these values in (i) and (ii), we get
 dy  1 1 1 1
    0.281  (0.018)  (0.05)  (0.002)
 dx 1.6 0.1 2 3 4
1 1 
 (0.003)  (0.002)  2.75
5 6 
NUMERICAL DIFFERENTIATION AND INTEGRATION • 347

 d2 y  1  11 5

 dx2   (0.1)2 0.018  0.005  (0.002)  (0.003)
 1.6  12 6
137 
 (0.002) 0.715.
180 

EXAMPLE 8.2
The following data gives the velocity of a particle for twenty seconds
at an interval of five seconds. Find the initial acceleration using the entire
data:
Time t (sec): 0 5 10 15 20
Velocity v(m/sec): 0 3 14 69 228
Solution:
The difference table is:
t v v 2 v 3 v 4 v
0 0
3
5 3 8
11 36
10 14 44 24
55 60
15 69 104
159
20 228
 dv 
An initial acceleration i.e., at t  0 is required, we use Newton’s
 dt 
forward formula:
 dv  1 1 1 1 
    v0  2 v0  3 v0   4 v0 
 dt t0 h 2 3 4 
 dv  1 1 1 1 
     3  (8)  (36)  (24)
 dt t0 5 1 3 4 
1
 (3  4  12  6)  1
5
Hence the initial acceleration is 1 m/sec2.
348 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 8.3
Find the value of cos (1.74) from the following table:
x: 1.7 1.74 1.78 1.82 1.86
sin x: 0.9916 0.9857 0.9781 0.9691 0.9584
Solution:
Let y  f (x)  sin x. so that f (x)  cos x.
The difference table is
x y y 2y 3y 4y
1.7 0.9916
– 0.0059
1.74 0.9857 – 0.0017
– 0.0076 0.0003
1.78 0.9781 – 0.0014 – 0.0006
– 0.0090 – 0.0003
1.82 0.9691 – 0.0017
– 0.0107
1.84 0.9584
Since we require f (1.74), we use Newton’s forward formula
dy 1 1 1 1 
  y0  2 y0  3 y0   4 y0  (i)
dx h 2 3 4 
Here h  0.04, x0  1.7, y0  – 0.0059, 2y0  – 0.0017 etc.
Substituting these values in (i), we get
 dy  1  1 1 1 
    0.0059  (0.0017)  (0.003)  (0.0006)
 dx 1.74 0.04 2 3 4 
1
 (0.007)  0.175
0.04
Hence cos (1.74)  0.175

EXAMPLE 8.4
A slider in a machine moves along a fixed straight rod. Its distance x cm.
along the rod is given below for various values of the time t seconds. Find
the velocity of the slider and its acceleration when t  0.3 second.
NUMERICAL DIFFERENTIATION AND INTEGRATION • 349

t 0 0.1 0.2 0.3 0.4 0.5 0.6


x 30.13 31.62 32.87 33.64 33.95 33.81 33.24
Solution:
The difference table is:
T x  2 3 4 5 6
0 30.13
1.49
0.1 31.62 – 0.24
1.25 – 0.24
0.2 32.87 – 0.48 0.26
0.77 0.02 – 0.27
0.3 33.64 – 0.46 – 0.01 0.29
0.31 0.01 0.02
0.4 33.95 – 0.45 0.01
– 0.14 0.02
0.5 33.81 – 0.43
– 0.57
0.6 33.24
As the derivatives are required near the middle of the table, we use
Stirling’s formulae:
 dx  1 x0  x1  1 3 x1  3 x2  1   5 x2   5 x3  (i)
        
 dt t0 h 2  6 2  30 2 
 d2 x  1  2 1 1 
 2  2   x1   4 x2  6 x3  (ii)
 dt  h  12 90 
Here h  0.1, t0  0.3, x0  0.31, x–1  0.77, 2x–1  – 0.46 etc.
Putting these values in (i) and (ii), we get

 dt  1  0.31  0.77 1 0.01  0.02  1  0.02  0.27  


         5.33
 dx 0.3 0.1 2 6 2  30 2  

 d2 x  1  1 1 
 2  2
0.46  (0.01)  (0.29) 45.6
 dt 0.3 (0.1)  12 90 
Hence the required velocity is 5.33 cm/sec and acceleration is
– 45.6 cm/sec2.
350 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 8.5
The elevation above a datum line of seven points of a road are given
below:
x: 0 300 600 900 1200 1500 1800
y: 135 149 157 183 201 205 193
Find the gradient of the road at the middle point.
Solution:
Here h  300, x0  0, y0  135, we require the gradient dy/dx at x  900.
The difference table is
x y y 2y 3y 4y 5y
0 135
14
300 149 –6
8 24
600 157 18 – 50
26 – 26 70
900 183 –8 20
18 –6 – 16
1200 201 – 14 4
4 –2
1500 205 – 16
– 12
1800 193
Using Stirling’s formula for the first derivative [(9) p. 000], we get

1 y0  y1  1  y1   y2  1   y2   y3 


3 3 5 5
y( x0 )    
 
  


h 26  6 2  30 2 

1 1 1 1 
  (18  26)  (6  26)  (16  70) 
300 2 12 60 
1
 (22  2.666  0.9)  0.085
300
Hence the gradient of the road at the middle point is 0.085.
NUMERICAL DIFFERENTIATION AND INTEGRATION • 351

EXAMPLE 8.6
Using Bessel’s formula, find f(7.5) from the following table:
x: 7.47 7.48 7.49 7.50 7.51 7.52 7.53
f(x): 0.193 0.195 0.198 0.201 0.203 0.206 0.208
Solution:
Taking x0  7.50, h  0.1, we have p  x  x0  x  7.50
h 0.01
The difference table is
x p yp  2 3 4 5 6
7.47 –3 0.193
0.002
7.48 –2 0.195 0.001
0.003 – 0.001
7.49 –1 0.198 0.000 0.000
0.003 – 0.001 0.003
7.50 0 0.201 – 0.001 0.003 – 0.01
0.002 0.002 – 0.007
7.51 1 0.203 0.001 – 0.004
0.003 – 0.002
7.52 2 0.206 – 0.001
0.002
7.53 3 0.208
Using Bessel’s formula for the first derivative [(11) p. 000], we get
 dy  1 1 1 1
    y0  (2 y1  2 y0 )  3 y1  ( 4 y2   4 y1 )
 dx x0 h 4 12 24
1 5 1 
  y2  (6 y3  6 y2 
120 240 

 dy  1  1 1 1
    0.002  (0.001  0.001)  (0.002)  (0.004  0.003)
 dx 7.5 0.01 4 12 24
1 1 

(0.007)  (0.010  0)
120 240 
[ 6 y–2  0]
 0.2  0  0.01666 – 0.0416  0.00583  0.00416  0.223.
352 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 8.7
Find f (10) from the following data:
x: 3 5 11 27 34
f(x): – 13 23 899 17315 35606
Solution:
As the values of x are not equispaced, we shall use Newton’s divided
difference formula. The divided difference table is
x f(x) 1st div 2nd div. 3rd div. 4th div.
diff. diff. diff. diff.
3 – 13
18
5 23 16
146 0.998
11 899 39.96 0.0002
1025 1.003
27 17315 69.04
2613
34 35606
Fifth differences being zero, Newton’s divided difference formula for
the first derivative (p. 274), we get
f(x)  f(x0, x1)  (2x – x0 – x1)f(x0, x1, x2)
  [3x2 – 2x(x0  x1  x2)  x0x1  x1x2  x2x0)] × f(x0, x1, x2, x3)
  [4x3 – 3x2(x0  x1  x2  x3)  2x(x0x1  x1x2  x2x3  x3x0  x1x3  x0x2)
– (x0x1x2  x1x2x3  x2x3x0  x0x1x3)] f(x0, x1, x2, x3, x4)
Putting x0  3, x1  5, x2  11, x3  27 and x  10, we obtain
f (0)  18  12 × 16  23 × 0.998 – 426 × 0.0002  232.869.

8.3 Maxima and Minima of a Tabulated Function


Newton’s forward interpolation formula is
p(p  1) 2 p(p  1)(p  2) 3
y  y0  py0   y0   y0 
2! 3!
NUMERICAL DIFFERENTIATION AND INTEGRATION • 353

Differentiating it w.r.t. p, we get


dy 2 p 1 2 3 p2  6 p  2 3
 y0   y0   y0  (1)
dp 2 6
For maxima or minima, dy/dp  0. Hence equating the right-hand side
of (1) to zero and retaining only up to third differences, we obtain
2 p 1 2 3 p2  6 p  2 3
y0   y0   y0  0
2 6
1 3  2 1 1
i.e.,   y0 p   2 y0  3 y0  p  (y0  2 y0 3 y0 )  0.
2  2 3
Substituting the values of y0, 2y0, 3y0 from the difference table, we
solve this quadratic for p. Then the corresponding values of x are given by
x  x0  ph at which y is maximum or minimum.

EXAMPLE 8.8
From the table below, for what value of x, y is minimum? Also find this
value of y.
x: 3 4 5 6 7 8
y: 0.205 0.240 0.259 0.262 0.250 0.224
Solution:
The difference table is
x y  2 3
3 0.205
0.035
4 0.240 – 0.016
0.019 0.000
5 0.259 – 0.016
0.003 0.001
6 0.262 – 0.015
– 0.012 0.001
7 0.250 – 0.014
– 0.026
8 0.224
354 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

Taking x0  3, we have y0  0.205, y0  0.035, 2y0  – 0.016 and


3y0  0.
 Newton’s forward difference formula gives
p(p  1)
y  0.205  p(0.035)  (0.016) (i)
2
Differentiating it w.r.t. p, we have
dy 29  1
 0.035  (0.016)
dp 2
For y to be minimum, dy/dp  0
 0.035 – 0.008(2p – 1)  0
which gives p  2.6875
 x  x0  ph  3  2.6875 × 1  5.6875.
Hence y is minimum when x  5.6875.
Putting p  2.6875 in (i), the minimum value of y
1
 0.205  2.6875  0.035  2.6875  1.6875 – 0.016   0.2628.
2

EXAMPLE 8.9
Find the maximum and minimum value of y from the following data:
x: –2 –1 0 1 2 3 4
y: 2 – 0.25 0 – 0.25 2 15.75 56
Solution:
The difference table is
x y y 2y 3y 4y 5y
–2 2
– 2.25
–1 – 0.25 2.5
0.25 –3
0 0 – 0.5 6
– 0.25 3 0
1 – 0.25 2.5 6
NUMERICAL DIFFERENTIATION AND INTEGRATION • 355

x y y 2y 3y 4y 5y


2.25 9 0
2 2 11.5 6
13.75 15
3 15.75 26.5
40.25
4 56
Taking x0  0, we have y0  0, y0  – 0.25, 2y0  2.5, 3y0  9, 4y0  6.
Newton’s forward difference formula for the first derivative gives
dy 1 (2 p  1) 2 3 p2  6 p  2 3 4 p3  18 p2  22 p  6 4 
  y0   y0   y0   y0 
dx h 2! 3! 4! 
1 2 x 1 1 1
  0.25  (2.5)  (3 x2  6 x  2)(9)  (4 x3  18 x2  22 x  6)(6)
1 2 6 24
1
 [0.25  2.5 x  1.25  4.5 x2  9 x  3  x3  4.5 x2  5.5 x  1.5  x3  x
2
dy
For y to be maximum or minimum,  0 i.e., x3  x  0
dx
i.e., x  0, 1, – 1
d2 y
Now 2
 3 x2  1 ve for x  0
dx
ve for x  1
ve for x 1.
x( x  1) 2
Since y  y0  xy0   y0 , y(0)  0
2!
Thus y is maximum for x  0, and maximum value  y(0)  0.
Also y is minimum for x  1 and minimum value  y(0)  – 0.25

Exercises 8.1

1. Find y (0) and y (0) from the following table:


x: 0 1 2 3 4 5
y: 4 8 15 7 6 2
NUMERICAL DIFFERENTIATION AND INTEGRATION • 363

V. Weddle’s rule. Putting n  6 in (1) above and neglecting all differ-


ences above the sixth, we obtain
x0 6 h  9 123 4
x0
f ( x)dx  6h y0  3y0  2 y0  43 y0 
 2 60
 y0

11 1 41 6 
  5 x0    y0 
20 6 140 
41 6 3
If we replace  y0 by 6 y0 , the error made will be negligible.
140 10
x0 6 h 3h
  x0
f ( x)dx  (y  5 y1  y2  6 y3  y4  5 y5  y6 )
10 0
Similarly
x0 12 h 3h
 x0 6 h
f ( x)dx  (y  5 y7  y8  6 y9  y10  5 y11  y12 ) and so on.
10 6
Adding all these integrals from x0 to x0  nh, where n is a multiple of 6,
we get
x0 nh 3h
 x0
f ( x)dx  (y0  5 y1  y2  6 y3  y4  5 y5  2 y6  5 y7  y8 ) (6)
10
This is known as Weddle’s rule.

Obs. While applying (6), the number of sub-intervals should


NOTE be taken as a multiple of 6. Weddle’s rule is generally more
accurate than any of the others. Of the two Simpson rules, the
1/3 rule is better.

EXAMPLE 8.10
dx 6
Evaluate 
0 1  x2
by using

(i) Trapezoidal rule,


(ii) Simpson’s 1/3 rule,
(iii) Simpson’s 3/8 rule,
(iv) Weddle’s rule and compare the results with its actual value.
Solution:
Divide the interval (0, 6) into six parts each of width h  1. The values
1
of f ( x)  are given below:
1  x2
364 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

x 0 1 2 3 4 5 6
f(x) 1 0.5 0.2 0.1 0.0588 0.0385 0.027
y y0 y1 y2 y3 y4 y5 y6
(i) By Trapezoidal rule,
dx h
 [(y  y6 )  2(y1  y2  y3  y4  y5 )]
6 1 x 2
2 0
 0 1
 [(1  0.027)  2(0.5  0.2  0.1  0.0588  0.0385)]  1.4108.
2
(ii) By Simpson’s 1/3 rule,
6 dx h
 0 1 x 2
 [(y0  y6 )  4(y1  y 3  y5 )  2(y2  y4
3
1
 [(1  0.027)  4(0.5  0.1  0.0385)  2(0.2  0.0588)]  1.3662.
3
(iii) By Simpson’s 3/8 rule,
6 dx 3h
 0 1 x 2
 [(y0  y6 )  3(y 1  y2  y4  y5 )  2 y3 ]
8
3
 [(1  0.027)  3(0.5  0.2  0.0588  0.0385)  2(0.1)]  1.3571
8
(iv) By Weddle’s rule,
6 dx 3h
 0 1 x 2
 [y0  5 y1  y2  6 y3  y4  5 y5  y6 ]
10
 0.3[1  5(0.5)  0.2  6(0.1)  0.0588  5(0.0385)  0.027]  1.3735
dx
6
Also 
0 1  x2
 tan1 x 60  tan1 6  1.4056

This shows that the value of the integral found by Weddle’s rule is the
nearest to the actual value followed by its value given by Simpson’s 1/3 rule.

EXAMPLE 8.11
1 x2
Evaluate the integral 
0 1  x3
dx using Simpson’s 1/3 rule. Compare
the error with the exact value.
Solution:
Let us divide the interval (0, 1) into 4 equal parts so that h  0.25.
2
Taking y  x , we have
(1  x3 )
NUMERICAL DIFFERENTIATION AND INTEGRATION • 365

x: 0 0.25 0.50 0.75 1.00


y: 0 0.06153 0.22222 0.39560 0.5
y0 y1 y2 y3 y4
By Simpson’s 1/3 rule, we have
x2
1 h
 0 1 x 3
dx  [(y0  y4 )  2(y2 )  4(y1  y3 )]
3
0.25
 [(0  0.5)  2(0.22222)  4(0.06153  0.3956)]
3
0.25
 [0.5  0.44444  1.82852]  0.23108
3
1
x2 1 1 1
Also 
0 1  x3
dx 
3
log(1  x 3
)
0

3
log e2  0.23108

Thus the error  0.23108 – 0.23105  – 0.00003.

EXAMPLE 8.12
2
Use the Trapezoidal rule to estimate the integral  0
ex2 dx taking the
number 10 intervals.
Solution:
Let y  ex2 , h  0.2 and n  10.
The values of x and y are as follows:
x: 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
y: 1 1.0408 1.1735 1.4333 1.8964 2.1782 4.2206 7.0993 12.9358 25.5337 54.5981
y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10

By the Trapezoidal rule, we have


1 h
0
e x 2 dx  [(y0  y10 )  2(y1  y2  y3  y4  y5  y6  y7  y8  y9 )]
2
0.2
 [(1  54.5981)  2(1.0408  1.1735  1.8964  2.1782
2
4.2206  7.0993  12.9358  25.5337)]
2

2
Hence e x dx  17.0621.
0
366 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 8.13
0.6
Use Simpson’s 1/3rd rule to find 0
ex 2 dx by taking seven ordinates.
Solution:
Divide the interval (0, 0.6) into six parts each of width h  0.1. The val-
2
ues of y  f  x   e– x are given below:
x 0 0.1 0.2 0.3 0.4 0.5 0.6
x2 0 0.01 0.04 0.09 0.16 0.25 0.36
y 1 0.9900 0.9608 0.9139 0.8521 0.7788 0.6977
y0 y1 y2 y3 y4 y5 y6

By Simpson’s 1/3rd rule, we have


2 h
ex dx  [(y0  y6 )  4(y1  y3  y5 )  2(y2  y4 )]
3
0.6 0.1
 0

3
[(1  0.6977)  4(0.99  0.9139  0.7788)  2(0.9608  0.8521)]
0.1 0.1
 [1.6977  10.7308  3.6258]  (16.0543)  0.5351.
3 3

EXAMPLE 8.14
1.4
Compute the value of 0.2
(sin x  log x  e x )dx using Simpson’s 3/8
rule.
Solution:
Let y  sin x – loge x  ex and h  0.2, n  6.
The values of y are as given below:
x: 0.2 0.4 0.6 0.8 1.0 1.2 1.4
y: 3.0295 2.7975 2.8976 3.1660 3.5597 4.0698 4.4042
y0 y1 y2 y3 y4 y5 y6
By Simpson’s 3/8 rule, we have
1.4 3h

0.2
ydx 
8
[(y0  y6 )  2(y3 )  3(y1  y2  y4  y5 )]
3
 (0.2)[7.7336  2(3.1660)  3(13.3247)]  4.053
8
NUMERICAL DIFFERENTIATION AND INTEGRATION • 367

1.4
Hence  0.2
(sin x  log e x  e x )dx  4.053.

Obs. Applications of Simpson’s rule. If the various ordinates


NOTE in Section 8.5 represent equispaced cross-sectional areas, then
Simpson’s rule gives the volume of the solid. As such, Simpson’s
rule is very useful to civil engineers for calculating the amount
of earth that must be moved to fill a depression or make a dam.
Similarly if the ordinates denote velocities at equal intervals
of time, the Simpson’s rule gives the distance travelled. The
following Examples illustrate these applications.

EXAMPLE 8.15
The velocity v(km/min) of a moped which starts from rest, is given at
fixed intervals of time t (min) as follows:
t: 2 4 6 8 10 12 14 16 18 20
v: 10 18 25 29 32 20 11 5 2 0
Estimate approximately the distance covered in twenty minutes.
Solution:
ds
If s (km) be the distance covered in t (min), then v
dt
20 h

20
s t0 
0

v dt  [ X  4.0  2.E], by Simpson’s rule
3
Here h  2, v0  0, v1  10, v2  18, v3  25 etc.
 X  v0  v10  0  0  0
O  v1  v3  v5  v7  v9  10  25  32  11  2  80
E  v2  v4  v6  v8  18  29  20  5  72
2
Hence the required distance  s 20
t0  (0  4  80  2  72)  309.33 km.
3

EXAMPLE 8.16
The velocity v of a particle at distance s from a point on its linear path
is given by the following table:
s (m): 0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0
v (m/sec): 16 19 21 22 20 17 13 11 9
368 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

Estimate the time taken by the particle to traverse the distance of 20


meter, using Boole’s rule.
Solution:
ds
If t sec be the time taken to traverse a distance s (m) then v
dt
dr 1
or   y (say),
ds v
20
then
s20
t s0  
0
yds
Here h  2.5 and n  8.
1 1 1 1 1
Also y0  , y1  , y2  , y3  , y4  ,
16 19 4 22 20
1 1 1 1
y5  , y6  y7  , y8  .
17 13 11 9
 By Boole’s Rules, we have
20 2h
s20
t s0   0
yds 
[7 y  32 y1  312 y2  14 y3  32 y5  12 y6  32 y7  14 y8 ]
45 0
2(2.5)  1  1 1 1 1 1
  7  32  12  32  14  32 
45   16   19   21   22   20   17 
1 1  1 
12  32  14 
3  11   9 
1
 (12.11776)  1.35
9
Hence the required time  1.35 sec.

EXAMPLE 8.17
A solid of revolution is formed by rotating about the x-axis, the area
between the x-axis, the lines x  0 and x  1 and a curve through the points
with the following co-ordinates:
x: 0.00 0.25 0.50 0.75 1.00
y: 1.0000 0.9896 0.9589 0.9089 0.8415
Estimate the volume of the solid formed using Simpson’s rule.
376 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

1
To evaluate I systematically, we take h1  h and h2  h
2
2 2
I (h / 2)  I2 h2 4I  I1
so that (3) gives I  1 2 2
 2
(h / 2)  h 3
1
i.e., I(h, h / 2)  [4I(h / 2)  I(h)] (4)
3
Now we use the trapezoidal rule several times successively halving h
and apply (4) to each pair of values as per the following scheme:
I(h)
I(h, h/2)
I(h/2) I(h, h/2, h/4)
I(h/2, h/4) I(h, h/2, h/4, h/8)
I(h/4) I(h/2, h/4, h/8)
I(h/4, h/8)
I(h/8)
The computation is continued until successive values are close to each oth-
er. This method is called Richardson’s deferred approach to the limit and
its systematic refinement is called Romberg’s method.

EXAMPLE 8.18
dx 1
Evaluate 
0 1 x
correct to three decimal places using Romberg’s

method. Hence find the value of loge 2.


Solution:
Taking h  0.5, 0.25, and 0.125 successively, let us evaluate the given inte-
gral by the Trapezoidal rule.
(i) When h  0.5, the values of y  (1  x)–1 are:
x: 0 0.5 1
y: 1 0.6666 0.5
0.5
 I (1  0.5  2  0.6666)  0.7083.
2
(ii) When h  0.25, the values of y  (1  x)–1 are:
x: 0 0.25 0.5 0.75 1
y: 1 0.8 0.6666 0.5714 0.5
NUMERICAL DIFFERENTIATION AND INTEGRATION • 377

0.25
 I [(1  0.5)  2(0.8  0.666  0.5714)]  0.697
2
(iii) When h  0.125, the values of y  (1  x)–1 are:
x: 0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1
y: 1 0.8889 0.8 0. 7272 0.6667 0.6153 0.5714 0.5333 0.5

0.125
I [(1  0.5)  2(0.8889  0.8  0.7272  0.6667
 2
0.6513  0.5714  0.5333)]
 0.6941
Using Romberg’s formulae, we obtain
1 1
I(h, h / 2)  [4I(h / 2)  I(h)]  [4  0.697  0.7083]  0.6932
3 3
1 1
I(h / 2, h / 4)  [4I(h / 4)  I(h / 2)]  [4  0.6941  0.697]  0.6931
3 3
1
I(h, h / 2, h / 4)  [4I(h / 2, h / 4)  I(h, h / 2)]  0.6931
3
dx
1
Hence the value of the integral 
0 1 x
 0.693 (i)

dx
1
Also 
0 1 x
1
 log(1  x) 0  log 2 (ii)

Hence from (i) and (ii), we have


loge 2  0.693.

EXAMPLE 8.19
1 dx correct to four decimal
Use Romberg’s method to compute  0 1  x2
places.
Solution:
We take h  0.5, 0.25 and 0.125 successively and evaluate the given
integral using the Trapezoidal rule.
(i) When h  0.5, the values of y  (1  x2)–1 are
x: 0 0.5 1.0
y: 1 0.8 0.5
378 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

 0.5
I [1  2  0.8  0.5)  0.775
2
(ii) When h  0.25, the values of y  (1  x2)–1 are
x: 0 0.25 0.5 0.75 1.0
y: 1 0.9412 0.8 0.64 0.5
0.25
I [1  2(0.9412  0.8  0.64)  0.5]  0.7828
2
(iii) When h  0.125, we find that I  0.7848
Thus we have
I(h)  0.7750, I(h/2)  0.7828, I(h/4)  0.7848
Now using (4) above, we obtain
1 1
I(h, h / 2)  [4I(h / 2)  I(h)]  (3.1312  0.775)  0.7854
3 3
1 1
I(h / 2, h / 4)  [(4I(h / 4)  I(h / 2)]  (3.1392  0.7828)  0.7855
3 2
1 1
I(h, h / 2, h / 4)  [4I(h / 2, h / 4)  I(h, h / 2)]  (3.142  0.7854)  0.7855
3 3
 The table of these values is
0.7750
0.7854
0.7828 0.7855
0.7855
0.7848
Hence the value of the integral  0.7855.

EXAMPLE 8.20
0.5  x 
Evaluate the integral  0
 dx using Romberg’s method, correct
 sin x 
to three decimal places.
Solution:
Taking h  0.25, 0.125, 0.0625 successively, let us evaluate the given
integral by using Simpson’s 1/3 rule.
NUMERICAL DIFFERENTIATION AND INTEGRATION • 379

x
(i) When h  0.25, the values of y  are
sin x
x: 0 0.25 0.5
y: 1 1.0105 1.0429
y0 y1 y2

 By Simpson’s rule,
h 0.25
I  [(y0  y2 )  4 y1 ]  [(1  1.0429)  1.0105]
3 3
 0.5071

(ii) When h  0.125, the values of y are


x: 0 0.125 0.25 0.375 0.5
y: 1 1.0026 1.0105 1.1003 1.0429
y0 y1 y2 y3 y4
 By Simpson’s rule
h
I  [(y 0  y4 )  4(y 1  y3 )  2 y2 ]
3
0.125
 [(1  1.0429)  4(1.0026  1.1003)  2(1.0105)]
3
 0.5198
(iii) When h  0.0625, the values of y are
x: 0 0.0625 0.125 0.1875 0.25 0.3125 0.1875 0.4375 0.5
y: 1 0.0006 1.0026 1.0059 1.0157 1.0165 1.1003 1.0326 1.0429
y0 y1 y2 y3 y4 y5 y6 y7 y8
 By Simpson’s rule:
h
I  [(y0  y8 )  4(y1  y3  y5  y7 )  2(y2  y4  y6 )]
3
0.0625
 [(1  1.0429)  4(1.0006  1.0059  1.0165  1.0326
3
2(1.0026  1.0105  1.1003)]
 0.510253
NUMERICAL DIFFERENTIATION AND INTEGRATION • 381

Putting x  xn and x  x0 in (3) and then subtracting, we get


1 xn 1 h
F( xn )  F( x0 ) 
h x0

f ( x)dx  [ f ( xn )  f ( x0 )]  [ f ( xn )
2 12
(4)
h3
 f ( x0 )] [ f ( xn )  f ( x0 )] 
720
 From (2) and (4), we have
n1

 f (x )  h1  1 h
xn
i f ( x)dx  [ f ( xn )  f ( x0 )]  [ f ( xn )
i0
x0 2 12
h3
 f ( x0 )] [ f ( xn )  f ( x0 )] 
720
n1
i.e., 1 
xn
f ( x)dx   f (x )  12 [ f (x )  f (x )] 12h [ f (x )
i n 0 n
h x0
i0

h3
 f ( x0 )]  [ f ( xn )  f ( x0 )] 
720
1
 [ f ( x0 )  2 f ( x1 )  2 f ( x2 )   2 f ( xn1 )  f ( xn )]
2
h h3
 [ f ( xn )  f ( x0 )]  [ f ( xn)  f ( x0 )] 
12 720
x0 _ nh h
Hence  x0
y dx  [y0  2 y1  2 y2   2 yn1  yn ]
2
(5)

h2 h4
 (yn  y0)  (y   y0) 
12 720 n
which is called the Euler-Maclaurin formula.

Obs. The first term on the right-hand side of (5) represents the
NOTE approximate value of the integral obtained from trapezoidal
rule and the other terms denote the successive corrections to
this value. This formula is often used to find the sum of a series
of the form
y(x0)  y(x0  h)  ...  y(x0  nh).

EXAMPLE 8.21
Using the Euler-Maclaurin formula, find the value of loge 2 from
1dx
 0 1 x
382 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

Solution:
1
Taking y  , x  0, n  10, h  0.1, we have
(1  x) 0
1 6
y and y 
 .
(1  x)2 (1  x)4
Then the Euler-Maclaurin formula gives
1 dx 0.1 1 2 2 2 2
 0 1 x
     
2  1  0 1  0.1 1  0.2 1  0.3 1  0.1
2 2 2 2 2 1 
     
1  0.5 1  0.6 1  0.7 1  0.8 1  0.9 1  1 

(0.1)2  1 1  (0.1)4  6 6 
      
12  (1  1)2 (1  0)2  720  1  14 (1  0)4 
 0.693773  0.000625  0.000002  0.693149
dx 1
Also 
0 1 x
1
 log(1  x) 0  log e2
Hence loge 2  0.693149 approx.

EXAMPLE 8.22
Apply the Euler-Maclaurin formula to evaluate
1 1 1 1
2
 2  2   2
51 53 55 99
Solution:
1 2 24
Taking y  2 , x0  51, h  2, n  24, we have y  3 , y  5
x x x
Then the Euler-Maclaurin formula gives
99 dx 2 1 2 2 2 1 
 51 x 2
  2  2  2   2  2 
2 51 53 55 97 99 
(2)2  2 2  (2)4  24 24 
    5
12  993 513  720
 99 5 51 
1 1 1 1 1 99 dx
  
512 532 552
    
992 2 51 x2
1 1 1  1 1 1  8 1 1 
  2  2   3  3   5  5 
2 51 99  3 51 99  30 51 99 
99
1 1
  0.000243 + 0.0000022   0.00499 approx.
2 x 51
388 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

EXAMPLE 8.23
dx 1
Evaluate

1 1  x 2
using Gauss formula for n  2 and n  3.
Solution:
(i) Gauss formula for n  2 is
1 dx  1   1  1
I  1 1  x 2
 f   f   where f ( x) 
 3  3 1  x2
1 1 3 3
I  2
 2
   1.5.
1  (1 3) 1  (1 / 3) 4 4
(ii) Gauss formula for n  3 is

8 5  3   3  1
I f (0)   f   f   where f ( x) 
9 9  5   5  1  x2

8 5 5 5  8 50
Thus I  (1)       1.5833 .
9 9 8 8  9 72

EXAMPLE 8.24
1 dx
Using the three-point Gaussian quadrature formula, evaluate
 0 1 x
Solution:
We first change the limits (0, 1) to – 1 to 1 by (8) above, so that
1 1 1
x  (1  0) u (1  0)  ( u  1).
2 2 2
1
1 dx 1
du 1 du
 I  0 
1 x
 1
2
1
 
1 u  3
1  ( u  1)
2
Gauss-formula for n  3 is
8 5  3  3 1
I  f (0)  f   f   where f ( x) 
9 9  5  5 1  x2

8 1  5 
 1 1 

Thus I      
9 3  9 
 (3 / 5)  3 (3 / 5)  3 

NUMERICAL DIFFERENTIATION AND INTEGRATION • 389

8 25
   0.29629  0.39682  0.6931
27 63
Otherwise (using the table):
1
I  w1 f ( u1 )  w2 f ( u2 )  w3 f ( u3 ) where f ( ui ) 
ui  3
Using the abscissae and weights corresponding to n  3 in the above table,
we obtain
1 1 1
I (0.555)  (0.8889)  (0.555)
3  0.7746 30 3  0.7746
1
 0.4497  0.5555  (0.8889)  0.2649  0.5555  0.6931.
3

EXAMPLE 8.25
2 x2  2 x  1
Evaluate  0 1  ( x  1)4
dx by the Gaussian three-point formula.
Solution:
Changing the limits of integration 0 to 2 to – 1 to 1 by
1 1 20 20
x  (b  a) u  (b  a)  u  u 1
2 2 2 2
2 x2  2 x  1 ( u  1)2  2( u  1)  1
1
 I  0 1  ( x  1)4
dx  
1 1  ( u  1  u)4
du [ dx  du]

u2  4 u  4
1 1
 
1 ( u  2)4  1
du   1
f ( u)du

u2i  4 ui  4
 w1 f ( u1 )  w2 f ( u2 )  w3 f ( u3 ) where f ( ui ) 
( ui  2)4  1
4 4
Now f (0)  4

2  1 17
 3  ( (3 / 5)  2)2 15016
f     0.4614
 5  [ (3 / 5)  2]4  1 3.2548
 3 (3 / 5)  2 7.6984
f   4
  0.1277
 5  [ (3 / 5)  2]  1 60.2652
390 • NUMERICAL METHODS IN ENGINEERING AND SCIENCE

Using the three-point Gaussian formula, we have


1 8 5  3   3 
I
1

f ( u)du  f (0)  f   f  
9 9  5   5 

8 4  5
   [0.4614  0.1277]  0.5365
9 17  9
Solution:
Changing the limits of integration (0.2 to 1.5) to (– 1, 1) by
1 1 1 1
x  (b  a) u  (b  a)  (1.5  0.2) u  (1.5  0.2)
2 2 2 2
 0.65 u  0.85
1.5 1 1
  
2
 I ex dx  0.65 e(0.65 u0.85)2 du  0.65 f ( u)du
0.2 1 1

so that f(u)  e−(0.65u  0.85)2


Now f(0)  e−[0.65(0)  0.85]2 0.4855,
2
f ( 3 / 5)  f (0.7746)  e[0.65(0.7746)0.85]  0.8869
2
f ( 3 / 5)  f (0.7746)  e[0.65(0.7746)0.85]  0.1601.
Using the Gauss three-point formula, we have

I  f ( u)du  f (0)[ f ( 3 / 5)  f ( 3 / 5)]


5 5
 (0.4855)  [0.8869  0.1601]  0.4316  0.5187  1.0133
9 9
1.5

2
Hence ex dx  0.65(1.0133)  0.65865.
0.2

Exercises 8.3

1. Obtain an estimate of the number of sub-intervals that should be cho-


2
sen so as to guarantee that the error committed in evaluating
1
dx/ x by 
trapezoidal rule is less than 0.001.
2. Evaluate 2 dx using the Romberg’s method. Hence obtain an ap-

0 x2  4

proximate value of .
NUMERICAL DIFFERENTIATION AND INTEGRATION • 393

EXAMPLE 8.27
Using trapezoidal rule, evaluate taking four sub-inter-
vals.
Solution:
Taking h  k  0.25 so that m  n  4, we obtain
1
I  [ f(1,1)  f(1,2)  2( f(1,1.25)  f (1,1.5)  f(1,1.75) )
64
 f(2,1)  f(2,2)  2( f(2,1.25)  f(2,1.5)  f (2,1.75)
2{ f(1.25,1)  f(1.25,2)  2 f (1.25,1.25)  f (1.25,1.5)  f(1.25,1.75) )
 f(1.5,1)  f(1.5,2)  2( f(1.5,1.25)  f(1.5,1.5)  f(1.5,1.75) )
 f(1.75,1)  f(1.75,2)  2( f(1.75,1.25)  f(1.75,1.5)  f(1.75,1.75) )}]
 0.3407

EXAMPLE 8.28
Apply Simpson’s rule to evaluate the integral
2.6 4.4 dxdy
I
2 4
 
xy
Solution:
Taking h  0.2 and k  0.3 so that m  n  2, we get
hk
I [ f (4,2)  4 f (4,2.3)  f (4,2.6)
91
4{ f (4.2,2)  4 f (4.2,2.3)  f (4.2,2.6)}
 f (4.4,2)  4 f (4.4,2.3)  f (4.4,2.6)]
0.06
 [0.6559  4(0.6246)  0.5962]
9
0.02
  3.7505  0.025
3
Exercises 8.4
1 1
1. Evaluate 
0 0
xe y dxdy using the Trapezoidal rule (h  k  0.5).
2. Apply the Trapezoidal rule to evaluate
5 5 dxdy
(a) 
1 1
x2  y2 )
, taking two sub-intervals.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy