[go: up one dir, main page]

0% found this document useful (0 votes)
10 views8 pages

Numerical Integration

Cfi
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)
10 views8 pages

Numerical Integration

Cfi
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/ 8

Chapter 45

Numerical integration
y y  f(x )
45.1 Introduction
Even with advanced methods of integration there are
many mathematical functions which cannot be inte-
grated by analytical methods and thus approximate
methods have then to be used. Approximate methods of
definite integrals may be determined by what is termed
numerical integration.
It may be shown that determining the value of a definite
integral is, in fact, finding the area between a curve, the y1 y2 y3 y4 yn1
horizontal axis and the specified ordinates. Three meth-
ods of finding approximate areas under curves are the
trapezoidal rule, the mid-ordinate rule and Simpson’s
rule, and these rules are used as a basis for numerical
integration. O xa x b x

d d d

45.2 The trapezoidal rule Figure 45.1

b !
Let a required definite integral be denoted by a y dx and b 1 1
be represented by the area under the graph of y = f (x) y dx ≈ (y1 + y2 )d + (y2 + y3 )d
a 2 2
between the limits x = a and x = b as shown in Fig. 45.1. 1 1
Let the range of integration be divided into n equal + (y3 + y4 )d + · · · (yn + yn+1 )d
2 2
intervals each of width d, such that nd = b − a, i.e. 
1
b−a ≈ d y1 + y2 + y3 + y4 + · · · + yn
d= 2
n 1
The ordinates are labelled y1 , y2, y3, . . . , yn+1 as + yn+1
shown. 2
An approximation to the area under the curve may be i.e. the trapezoidal rule states:
determined by joining the tops of the ordinates by
straight lines. Each interval is thus a trapezium, and ! b    
width of 1 first + last
since the area of a trapezium is given by: y dx ≈
interval 2 ordinate
a
  (1)
1 sum of remaining
area = (sum of parallel sides) (perpendicular +
2 ordinates
distance between them) then
436 Higher Engineering Mathematics

Problem 1. (a) Use integration to evaluate, Problem 2. Use the trapezoidal rule with 8
! 3 ! 3
2 2
correct to 3 decimal places, √ dx (b) Use the intervals to evaluate, √ dx correct to 3
1 x 1 x
trapezoidal rule with 4 intervals to evaluate the decimal places.
integral in part (a), correct to 3 decimal places.
3−1
! ! With 8 intervals, the width of each is i.e. 0.25
3
2 3 1 8
(a) √ dx = 2x − 2 dx giving ordinates at 1.00, 1.25, 1.50, 1.75, 2.00, 2.25,
1 x 1 2
⎡ ⎤3 2.50, 2.75 and 3.00. Corresponding values of √ are
  x
 −1
2 +1
1 3 shown in the table below.
⎢ 2x ⎥
=⎣ ⎦ = 4x 2
1
− +1 1 2
2 1 x √
√ √  x
√ 3
= 4 x 1 = 4 3− 1
1.00 2.0000
= 2.928, correct to 3 decimal places 1.25 1.7889
(b) The range of integration is the difference between 1.50 1.6330
the upper and lower limits, i.e. 3 − 1 = 2. Using
the trapezoidal rule with 4 intervals gives an inter- 1.75 1.5119
3−1 2.00 1.4142
val width d = = 0.5 and ordinates situated
4
at 1.0, 1.5, 2.0, 2.5 and 3.0. Corresponding values 2.25 1.3333
2
of √ are shown in the table below, each correct 2.50 1.2649
x
to 4 decimal places (which is one more decimal
2.75 1.2060
place than required in the problem).
3.00 1.1547
2
x √
x From equation (1):
1.0 2.0000 ! 3 
2 1
√ dx ≈ (0.25) (2.000 + 1.1547) + 1.7889
1.5 1.6330 1 x 2

2.0 1.4142 + 1.6330 + 1.5119 + 1.4142



2.5 1.2649
+ 1.3333 + 1.2649 + 1.2060
3.0 1.1547
= 2.932, correct to 3 decimal places.
From equation (1):
! 3  This problem demonstrates that the greater the number
2 1 of intervals chosen (i.e. the smaller the interval width)
√ dx ≈ (0.5) (2.0000 + 1.1547)
x 2 the more accurate will be the value of the definite inte-
1

gral. The exact value is found when the number of
+ 1.6330 + 1.4142 + 1.2649 intervals is infinite, which is, of course, what the process
of integration is based upon.
= 2.945, correct to 3 decimal places
This problem demonstrates that even with just 4 inter-
vals a close approximation to the true value of 2.928 Problem 3. Use the trapezoidal rule to evaluate
! π
(correct to 3 decimal places) is obtained using the 2 1
dx using 6 intervals. Give the answer
trapezoidal rule. 0 1 + sin x
correct to 4 significant figures.
Numerical integration 437
π
−0 !
With 6 intervals, each will have a width of 2 1 2
6 1. dx (Use 8 intervals) [1.569]
π 1 + x2
i.e. rad (or 15◦) and the ordinates occur at 0
12 ! 3
π π π π 5π π 2. 2 ln 3x dx (Use 8 intervals) [6.979]
0, , , , , and
12 6 4 3 12 2 1
1 ! π
Corresponding values of are shown in the 3 
1 + sin x 3. (sin θ) dθ (Use 6 intervals) [0.672]
table below. 0
! 1.4
e−x dx
2
1 4. (Use 7 intervals) [0.843]
x 0
1 + sin x
0 1.0000
π
(or 15◦) 0.79440 45.3 The mid-ordinate rule
12
π Let a required definite integral be denoted again
(or 30◦ ) 0.66667 b
6 by a y dx and represented by the area under the graph
π of y = f (x) between the limits x = a and x = b, as shown
(or 45◦) 0.58579 in Fig. 45.2.
4
π y
(or 60◦ ) 0.53590 y  f(x)
3

(or 75◦) 0.50867
12
π
(or 90◦ ) 0.50000
2

From equation (1): y1 y2 y3 yn


! π
2 1  π 1
dx ≈ (1.00000 + 0.50000)
0 1 + sin x 12 2
+ 0.79440 + 0.66667 O a b x

+ 0.58579 + 0.53590 
d d d

+ 0.50867 Figure 45.2

= 1.006, correct to 4 With the mid-ordinate rule each interval of width d is


assumed to be replaced by a rectangle of height equal to
significant figures. the ordinate at the middle point of each interval, shown
as y1 , y2, y3 , . . . , yn in Fig. 45.2.
! b
Now try the following exercise y dx ≈ d y1 + d y2 + d y3 + · · · + d yn
Thus a
≈ d( y1 + y2 + y3 + · · · + yn )
Exercise 173 Further problems on the
i.e. the mid-ordinate rule states:
trapezoidal rule
In Problems 1 to 4, evaluate the definite integrals ! b
y dx ≈ (width of interval) (sum
using the trapezoidal rule, giving the answers
a
(2)
correct to 3 decimal places. of mid-ordinates)
438 Higher Engineering Mathematics

From equation (2):


Problem 4. Use the mid-ordinate rule
! 3 with (a) 4
2 !
intervals, (b) 8 intervals, to evaluate √ dx, 3
2
1 x √ dx ≈ (0.25)[1.8856 + 1.7056
correct to 3 decimal places. 1 x

3−1 + 1.5689 + 1.4606 + 1.3720


(a) With 4 intervals, each will have a width of ,
4
i.e. 0.5 and the ordinates will occur at 1.0, 1.5, 2.0, + 1.2978 + 1.2344 + 1.1795]
2.5 and 3.0. Hence the mid-ordinates y1 , y2, y3
and y4 occur at 1.25, 1.75, 2.25 and 2.75. Corre- = 2.926, correct to 3 decimal places.
2
sponding values of √ are shown in the following
x As previously, the greater the number of intervals
table.
the nearer the result is to the true value (of 2.928, correct
to 3 decimal places).
2
x √
x
! 2.4
1.25 1.7889 −x 2
Problem 5. Evaluate e 3 dx, correct to 4
0
1.75 1.5119 significant figures, using the mid-ordinate rule with
2.25 1.3333 6 intervals.

2.75 1.2060 2.4 − 0


With 6 intervals each will have a width of , i.e.
6
From equation (2): 0.40 and the ordinates will occur at 0, 0.40, 0.80, 1.20,
! 3 1.60, 2.00 and 2.40 and thus mid-ordinates at 0.20, 0.60,
2 −x 2
√ dx ≈ (0.5)[1.7889 + 1.5119 1.00, 1.40, 1.80 and 2.20. Corresponding values of e 3
1 x
+ 1.3333 + 1.2060] are shown in the following table.
= 2.920, correct to 3 decimal places.
(b) With 8 intervals, each will have a width of 0.25 −x 2
x e 3
and the ordinates will occur at 1.00, 1.25, 1.50,
1.75, . . . and thus mid-ordinates at 1.125, 1.375, 0.20 0.98676
1.625, 1.875 . . .
2 0.60 0.88692
Corresponding values of √ are shown in the
x 1.00 0.71653
following table.
1.40 0.52031
2
x √ 1.80 0.33960
x
2.20 0.19922
1.125 1.8856
1.375 1.7056 From equation (2):
1.625 1.5689 ! 2.4 −x 2
1.875 1.4606 e 3 dx ≈ (0.40)[0.98676 + 0.88692
0
2.125 1.3720 + 0.71653 + 0.52031
2.375 1.2978 + 0.33960 + 0.19922]
2.625 1.2344
= 1.460, correct to 4 significant figures.
2.875 1.1795
Numerical integration 439

Now try the following exercise y


y  a  bx cx 2

Exercise 174 Further problems on the


mid-ordinate rule
In Problems 1 to 4, evaluate the definite integrals
using the mid-ordinate rule, giving the answers
correct to 3 decimal places.
y1 y2 y3
! 2 3
1. dt (Use 8 intervals) [3.323]
0 1 + t2
d O d x
! π
2 1
2. dθ (Use 6 intervals) [0.997]
0 1 + sin θ
! Figure 45.3
3 ln x
3. dx (Use 10 intervals) [0.605]
1 x
! π Since y = a + bx + cx 2 ,
3 
4. (cos3 x) dx (Use 6 intervals) [0.799] at x = −d, y1 = a − bd + cd 2
0 at x = 0, y2 = a
and at x = d, y3 = a + bd + cd 2
Hence y1 + y3 = 2a + 2cd 2
45.4 Simpson’s rule And y1 + 4y2 + y3 = 6a + 2cd 2 (4)
The approximation made with the trapezoidal rule is to Thus the area under the parabola between x = −d
join the top of two successive ordinates by a straight and x =d in Fig. 45.3 may be expressed as
3 d(y1 + 4y2 + y3 ), from equations (3) and (4), and the
line, i.e. by using a linear approximation of the form 1
a + bx. With Simpson’s rule, the approximation made result is seen to be independent of the position of the
is to join the tops of three successive ordinates by a origin.
parabola, i.e. by using a quadratic approximation of the b
Let a definite integral be denoted by a y dx and
form a + bx + cx 2 . represented by the area under the graph of y = f (x)
Figure 45.3 shows a parabola y = a + bx + cx 2 with between the limits x = a and x = b, as shown in Fig. 45.4.
ordinates y1 , y2 and y3 at x = −d, x = 0 and x = d The range of integration, b − a, is divided into an even
respectively. number of intervals, say 2n, each of width d.
Thus the width of each of the two intervals is d. The Since an even number of intervals is specified, an odd
area enclosed by the parabola, the x-axis and ordinates number of ordinates, 2n + 1, exists. Let an approxima-
x = −d and x = d is given by: tion to the curve over the first two intervals be a parabola
! d  d of the form y = a + bx + cx 2 which passes through the
bx 2 cx 3
2 tops of the three ordinates y1, y2 and y3. Similarly, let
(a + bx + cx )dx = ax + +
−d 2 3 −d an approximation to the curve over the next two inter-
  vals be the parabola which passes through the tops of
bd 2 cd 3
= ad + + the ordinates y3, y4 and y5 , and so on.
2 3
  !
bd 2 cd 3 b
− −ad + − Then y dx
2 3 a
2 1 1
= 2ad + cd 3 or ≈ d(y1 + 4y2 + y3 ) + d(y3 + 4y4 + y5 )
3 3 3
1 1
d(6a + 2cd 2 ) (3) + d(y2n−1 + 4y2n + y2n+1 )
3 3
440 Higher Engineering Mathematics

y Thus, from equation (5):

! 3 2 1
y f(x) √ dx ≈ (0.5) [(2.0000 + 1.1547)
1 x 3

+ 4(1.6330 + 1.2649) + 2(1.4142)]

1
= (0.5)[3.1547 + 11.5916
3
+ 2.8284]
y1 y2 y3 y4 y2n1
= 2.929, correct to 3 decimal places.

(b) With 8 intervals, each will have a width of


O a b x 3−1
, i.e. 0.25 and the ordinates occur at 1.00,
8
d d d 1.25, 1.50, 1.75, . . . , 3.0. The values of the ordi-
nates are as shown in the table in Problem 2,
Figure 45.4
page 436.
Thus, from equation (5):
1 !
≈ d[(y1 + y2n+1 ) + 4(y2 + y4 + · · · + y2n ) 3 2 1
3 √ dx ≈ (0.25) [(2.0000 + 1.1547)
+ 2(y3 + y5 + · · · + y2n−1 )] 1 x 3

i.e. Simpson’s rule states: + 4(1.7889 + 1.5119 + 1.3333

! b     + 1.2060) + 2(1.6330 + 1.4142


1 width of first + last
y dx ≈ + 1.2649)]
a 3 interval ordinate
 
sum of even 1
+4 (5) = (0.25)[3.1547 + 23.3604
ordinates 3
  + 8.6242]
sum of remaining
+2
odd ordinates
= 2.928, correct to 3 decimal places.

Note that Simpson’s rule can only be applied when an


It is noted that the latter answer is exactly the same as
even number of intervals is chosen, i.e. an odd number
that obtained by integration. In general, Simpson’s rule
of ordinates.
is regarded as the most accurate of the three approximate
methods used in numerical integration.
Problem 6. Use Simpson’s rule with (a) 4
! 3
2
intervals, (b) 8 intervals, to evaluate √ dx, Problem 7. Evaluate
1 x
correct to 3 decimal places.
! π  
3 1
3−1 1 − sin2 θ dθ,
(a) With 4 intervals, each will have a width of , 0 3
4
i.e. 0.5 and the ordinates will occur at 1.0, 1.5,
correct to 3 decimal places, using Simpson’s
2.0, 2.5 and 3.0. The values of the ordinates are as
rule with 6 intervals.
shown in the table of Problem 1(b), page 436.
Numerical integration 441

π
−0
With 6 intervals, each will have a width of 3 8.0 7.3
6
π ◦ 10.0 2.0
i.e. rad (or 10 ), and the ordinates will occur at
18
π π π 2π 5π π 12.0 0
0, , , , , and
18 9 6 9 18 3
  Charge, q, in millicoulombs, is given by
1  12.0
Corresponding values of 1 − sin2 θ are shown in q = 0 i dt.
3
the table below. Use Simpson’s rule to determine the approximate
charge in the 12 millisecond period.
π π π
θ 0
18 9 6
(or 10◦ ) (or 20◦) (or 30◦) From equation (5):
  ! 12.0
1 2 1
1 − sin θ 1.0000 0.9950 0.9803 0.9574 Charge, q = i dt ≈ (2.0) [(0 + 0) + 4(3.5
3 0 3
+10.0 + 2.0) + 2(8.2 + 7.3)]
2π 5π π
θ = 62 mC
9 18 3
(or 40◦) (or 50◦) (or 60◦)
  Now try the following exercise
1
1 − sin2 θ 0.9286 0.8969 0.8660
3
Exercise 175 Further problems on
From Equation (5) Simpson’s rule

! π   In Problems 1 to 5, evaluate the definite integrals


3 1 2 using Simpson’s rule, giving the answers correct
1 − sin θ dθ
0 3 to 3 decimal places.

1π  ! π

≈ [(1.0000 + 0.8660) + 4(0.9950 2
3 18 1. (sin x) dx (Use 6 intervals) [1.187]
0
+ 0.9574 + 0.8969)
!
+ 2(0.9803 + 0.9286)] 1.6 1
2. dθ (Use 8 intervals) [1.034]
1π  0 1 + θ4
= [1.8660 + 11.3972 + 3.8178]
3 18
!
= 0.994, correct to 3 decimal places.
1.0 sin θ
3. dθ (Use 8 intervals) [0.747]
0.2 θ
Problem 8. An alternating current i has the
following values at equal intervals of ! π
2
2.0 milliseconds: 4. x cos x dx (Use 6 intervals) [0.571]
0
Time (ms) Current i (A)
! π
0 0 3 2
5. ex sin 2x dx (Use 10 intervals)
0
2.0 3.5 [1.260]
4.0 8.2 In Problems 6 and 7 evaluate the definite inte-
grals using (a) integration, (b) the trapezoidal rule,
6.0 10.0
442 Higher Engineering Mathematics

(c) the mid-ordinate rule, (d) Simpson’s rule. Give 4.0 2.9
answers correct to 3 decimal places.
! 4 5.0 4.1
4
6. 3
dx (Use 6 intervals) 6.0 6.2
1 x 
(a) 1.875 (b) 2.107 7.0 8.0
(c) 1.765 (d) 1.916
8.0 9.4
! 6 1
7. √ dx (Use 8 intervals) The distance travelled in 8.0 s is given by
2 (2x − 1)   8.0
(a) 1.585 (b) 1.588 0 v dt
(c) 1.583 (d) 1.585
Estimate this distance using Simpson’s rule,
giving the answer correct to 3 significant
In Problems 8 and 9 evaluate the definite integrals figures. [28.8 m]
using (a) the trapezoidal rule, (b) the mid-ordinate
rule, (c) Simpson’s rule. Use 6 intervals in each
case and give answers correct to 3 decimal places. 11. A pin moves along a straight guide so that its
! 3 velocity v (m/s) when it is a distance x(m)
from the beginning of the guide at time t (s) is
8. (1 + x 4 ) dx
0  given in the table below.
(a) 10.194 (b) 10.007
(c) 10.070 t (s) v (m/s)
! 0.7 0 0
1
9.  dy
0.1 (1 − y 2 ) 0.5 0.052

(a) 0.677 (b) 0.674 1.0 0.082
(c) 0.675
1.5 0.125
10. A vehicle starts from rest and its velocity is 2.0 0.162
measured every second for 8 s, with values as
follows: 2.5 0.175
3.0 0.186
time t (s) velocity v (ms−1 )
3.5 0.160
0 0
4.0 0
1.0 0.4
2.0 1.0 Use Simpson’s rule with 8 intervals to deter-
mine the approximate total distance travelled
3.0 1.7 by the pin in the 4.0 s period. [0.485 m]

You might also like