Numerical Integration
Numerical Integration
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
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
+ 0.58579 + 0.53590
d d d
! 3 2 1
y f(x) √ dx ≈ (0.5) [(2.0000 + 1.1547)
1 x 3
1
= (0.5)[3.1547 + 11.5916
3
+ 2.8284]
y1 y2 y3 y4 y2n1
= 2.929, correct to 3 decimal places.
π
−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
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]