Numerical Integration
Numerical Integration
© McGraw Hill 1
Numerical Integration
• Calculus is the mathematics of change. Because engineers must
continuously deal with systems and processes that change,
calculus is an essential tool of engineering.
• Standing in the heart of calculus are the mathematical concepts
of differentiation and integration:
y f ( xi x) f ( xi )
x x b
dy
lim
dx x 0
f ( xi x) f ( xi )
x
I f ( x)dx
a
Differentiation Integration
© McGraw Hill 2
Graphical representation of the integral
of f(x) between the limits x = a to b.
Figure PT6.2 The integral is equivalent to the area under the curve
Access the text alternative for slide images
© McGraw Hill 3
Types of Functions to be Integrated
The function to be differentiated or integrated will
typically be in one of the following three forms:
• A simple continuous function such as polynomial, an
exponential, or a trigonometric function.
• A complicated continuous function that is difficult or
impossible to differentiate or integrate directly.
• A tabulated function where values of x and f(x) are
given at a number of discrete points, as is often the case
with experimental or field data.
© McGraw Hill 4
Integrating a Function
A complicated, continuous function.
Figure PT6.7
Access the text alternative for slide images
© McGraw Hill 5
Newton-Cotes Integration Formulas
Chapter 21
• The Newton-Cotes formulas are the most common
numerical integration schemes.
• They are based on the strategy of replacing a
complicated function or tabulated data with an
approximating function that is easy to integrate: a
polynomial:
b b
I f ( x)dx f n ( x)dx
a a
f n ( x) a0 a1 x an 1 x n 1 an x n
© McGraw Hill 6
The approximation of an integral
by the area under simple polynomials
Figure 21.1
Access the text alternative for slide images
© McGraw Hill 7
The approximation of an integral by the
area under three straight-line segments.
Figure 21.2
Access the text alternative for slide images
© McGraw Hill 8
The Trapezoidal Rule
• The Trapezoidal rule is the first of the Newton-Cotes
closed integration formulas, corresponding to the case
where the polynomial is first order:
b b
I f ( x)dx f1 ( x)dx
a a
f (a) f (b)
I (b a)
2
The trapezoidal rule
© McGraw Hill 9
Graphical depiction of the trapezoidal
rule.
Figure 21.4
Access the text alternative for slide images
© McGraw Hill 10
Error of a Single Application of the
Trapezoidal Rule
• When we employ the integral under a straight line
segment to approximate the integral under a curve,
error may be substantial:
1
Et f b a
3
12
where lies somewhere in the interval from a to b.
© McGraw Hill 11
Sometimes the Trapezoidal Rule Can
Yield a Large Error
Figure 21.6
Access the text alternative for slide images
© McGraw Hill 12
Multiple Application Trapezoidal Rule 1
I f ( x)dx f ( x)dx
x0 x1
xn1
f ( x)dx
Figure 21.8
Access the text alternative for slide images
© McGraw Hill 14
Error of Multiple Application Trapezoidal
Rule
• An error for multiple-application trapezoidal rule can
be obtained by summing the individual errors for each
segment:
f (i ) nf
(b a )3
Ea 2
f
12n
© McGraw Hill 15
Simpson’s Rules 1
© McGraw Hill 16
Simpson’s Rules 2
h ba
I f ( x0 ) 4 f ( x1 ) f ( x2 ) h
3 2
(b a)5 ( 4)
Et f ( ) a b
2880
Simpson’s 1/3 rule is more accurate than trapezoidal rule.
© McGraw Hill 18
The Multiple-Application Simpson’s 1/3
Rule 1
© McGraw Hill 19
The Multiple-Application Simpson’s 1/3
Rule 2
Can only be
used for even
number of
segments
Figure 21.11 f ( x0 ) 4 f ( x1 ) f ( x2 ) f ( x2 ) 4 f ( x3 ) f ( x4 )
I 2h 2h
6 6
f ( xn 2 ) 4 f ( xn 1 ) f ( xn )
2h
6
Access the text alternative for slide images
© McGraw Hill 20
WEIGHTS
Figure 21.11
Access the text alternative for slide images
© McGraw Hill 21
The Multiple-Application Simpson’s 1/3
Rule 3
(b a ) 5
(4)
Ea 4
f
180n
Access the text alternative for slide images
© McGraw Hill 22
Simpson’s 3/8 Rule
• An odd-segment-even-point formula used in
conjunction with the 1/3 rule to permit evaluation of
both even and odd numbers of segments.
b b
I f ( x)dx f3 ( x)dx
a a
3h
I f ( x0 ) 3 f ( x1 ) 3 f ( x2 ) f ( x3 )
8
(b a )
h
3
(b a )5 (4)
Et f ( )
6480
More accurate
© McGraw Hill 23
Simpson’s 1∕3 and 3∕8 rules
Figure 21.12
Illustration of how
Simpson’s 1∕3 and 3∕8
rules can be applied in
tandem to handle
multiple applications
with odd numbers of
intervals.
© McGraw Hill 24