Numerical integration 439
Now try the following exercise
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.
1.
2
0
3
1 + t 2 dt
(Use 8 intervals)
[3.323]
2.
π
2
0
1
1 + sin θ
dθ (Use 6 intervals) [0.997]
3.
3
1
ln x
x
dx
(Use 10 intervals) [0.605]
4.
π
3
0
(cos 3 x) dx (Use 6 intervals) [0.799]
45.4 Simpson’s rule
The approximation made with the trapezoidal rule is to
join the top of two successive ordinates by a straight
line, i.e. by using a linear approximation of the form
a + bx. With Simpson’s rule, the approximation made
is to join the tops of three successive ordinates by a
parabola, i.e. by using a quadratic approximation of the
form a + bx + cx 2 .
Figure 45.3 shows a parabola y = a + bx + cx 2 with
ordinates y 1 , y 2 and y 3 at x =−d, x = 0 and x = d
respectively.
Thus the width of each of the two intervals is d. The
area enclosed by the parabola, the x-axis and ordinates
x = −d and x = d is given by:
d
−d
(a + bx + cx
2
)dx =
ax +
bx
2
2
+
cx
3
3
d
−d
=
ad +
bd 2
2
+
cd 3
3
−
−ad +
bd
2
2
−
cd
3
3
= 2ad +
2
3
cd
3 or
1
3
d(6a + 2cd
2
)
(3)
y
y 1
y 2
y 3
y ϭ a ϩ bx ϩcx 2
d
O
Ϫd
x
Figure 45.3
Since y = a + bx + cx 2 ,
at
x = −d, y 1 = a − bd + cd 2
at
x = 0, y 2 = a
and at x = d, y 3 = a + bd + cd 2
Hence y 1 + y 3 = 2a + 2cd
2
And
y 1 + 4y 2 + y 3 = 6a + 2cd 2
(4)
Thus the area under the parabola between x =−d
and x =d in Fig. 45.3 may be expressed as
1
3 d(y 1 + 4y 2 + y 3 ), from equations (3) and (4), and the
result is seen to be independent of the position of the
origin.
Let a definite integral be denoted by
b
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 in Fig. 45.4.
The range of integration, b − a, is divided into an even
number of intervals, say 2n, each of width d.
Since an even number of intervals is specified, an odd
number of ordinates, 2n + 1, exists. Let an approximation to the curve over the first two intervals be a parabola
of the form y = a + bx + cx 2 which passes through the
tops of the three ordinates y 1 , y 2 and y 3 . Similarly, let
an approximation to the curve over the next two intervals be the parabola which passes through the tops of
the ordinates y 3 , y 4 and y 5 , and so on.
Then
b
a
y dx
≈
1
3
d(y 1 + 4y 2 + y 3 ) +
1
3
d(y 3 + 4y 4 + y 5 )
+
1
3
d(y 2n−1 + 4y 2n + y 2n+1 )
Now try the following exercise
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.
1.
2
0
3
1 + t 2 dt
(Use 8 intervals)
[3.323]
2.
π
2
0
1
1 + sin θ
dθ (Use 6 intervals) [0.997]
3.
3
1
ln x
x
dx
(Use 10 intervals) [0.605]
4.
π
3
0
(cos 3 x) dx (Use 6 intervals) [0.799]
45.4 Simpson’s rule
The approximation made with the trapezoidal rule is to
join the top of two successive ordinates by a straight
line, i.e. by using a linear approximation of the form
a + bx. With Simpson’s rule, the approximation made
is to join the tops of three successive ordinates by a
parabola, i.e. by using a quadratic approximation of the
form a + bx + cx 2 .
Figure 45.3 shows a parabola y = a + bx + cx 2 with
ordinates y 1 , y 2 and y 3 at x =−d, x = 0 and x = d
respectively.
Thus the width of each of the two intervals is d. The
area enclosed by the parabola, the x-axis and ordinates
x = −d and x = d is given by:
d
−d
(a + bx + cx
2
)dx =
ax +
bx
2
2
+
cx
3
3
d
−d
=
ad +
bd 2
2
+
cd 3
3
−
−ad +
bd
2
2
−
cd
3
3
= 2ad +
2
3
cd
3 or
1
3
d(6a + 2cd
2
)
(3)
y
y 1
y 2
y 3
y ϭ a ϩ bx ϩcx 2
d
O
Ϫd
x
Figure 45.3
Since y = a + bx + cx 2 ,
at
x = −d, y 1 = a − bd + cd 2
at
x = 0, y 2 = a
and at x = d, y 3 = a + bd + cd 2
Hence y 1 + y 3 = 2a + 2cd
2
And
y 1 + 4y 2 + y 3 = 6a + 2cd 2
(4)
Thus the area under the parabola between x =−d
and x =d in Fig. 45.3 may be expressed as
1
3 d(y 1 + 4y 2 + y 3 ), from equations (3) and (4), and the
result is seen to be independent of the position of the
origin.
Let a definite integral be denoted by
b
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 in Fig. 45.4.
The range of integration, b − a, is divided into an even
number of intervals, say 2n, each of width d.
Since an even number of intervals is specified, an odd
number of ordinates, 2n + 1, exists. Let an approximation to the curve over the first two intervals be a parabola
of the form y = a + bx + cx 2 which passes through the
tops of the three ordinates y 1 , y 2 and y 3 . Similarly, let
an approximation to the curve over the next two intervals be the parabola which passes through the tops of
the ordinates y 3 , y 4 and y 5 , and so on.
Then
b
a
y dx
≈
1
3
d(y 1 + 4y 2 + y 3 ) +
1
3
d(y 3 + 4y 4 + y 5 )
+
1
3
d(y 2n−1 + 4y 2n + y 2n+1 )
