Sie sind auf Seite 1von 31

by Lale Yurttas, Texas

A&M University
Chapter 5 1
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
NUMERICAL INTEGRATION &
DIFFERENTIATION :
NEWTON-COTES
INTEGRATION FORMULAS
2
Numerical Differentiation and
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:

x
x f x x f
dx
dy
x
x f x x f
x
y
i i
x
i i
A
A +
=
A
A +
=
A
A
A
) ( ) (
lim
) ( ) (
0
}
=
b
a
dx x f I ) (
Differentiation Integration
by Lale Yurttas, Texas
A&M University
Chapter 5 3
Figure PT6.2
The integral is
equivalent to the
area under the
curve.
by Lale Yurttas, Texas
A&M University
Chapter 5 4
Newton-Cotes Integration Formulas
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:

n
n
n
n n
b
a
n
b
a
x a x a x a a x f
dx x f dx x f I
+ + + + =
~ =

} }
1
1 1 0
) (
) ( ) (

by Lale Yurttas, Texas


A&M University
Chapter 5 5
Figure 21.1

Single straight line Single parabola
by Lale Yurttas, Texas
A&M University
Chapter 5 6
Three straight line
segments
7
The first of the Newton-Cotes closed integration
formulas.
Corresponds to the case where the polynomial is first
order:



The area under this first order polynomial is an
estimate of the integral of f(x) between the limits of a
and b:


} }
~ =
b
a
b
a
dx x f dx x f I ) ( ) (
1
2
) ( ) (
) (
b f a f
a b I
+
=
Trapezoidal rule
by Lale Yurttas, Texas
A&M University
Chapter 5 8
Figure 21.4
Graphical illustration of
the trapezoidal rule.
by Lale Yurttas, Texas
A&M University
Chapter 5 9
When we employ the integral under a straight line
segment to approximate the integral under a curve,
error may be substantial:



where x lies somewhere in the interval from a to b.




3
) )( (
12
1
a b f E
t

' '
=
Error of the Trapezoidal Rule
Truncation error
Use trapezoidal rule to numerically integrate
f(x) = 0.2 + 25x 200x
2
+ 675x
3
900x
4
+ 400x
5
from a = 0 to b = 0.8. The exact value of the
integral can be determined analytically to be
1.640533
by Lale Yurttas, Texas
A&M University
Chapter 5 10
by Lale Yurttas, Texas
A&M University
Chapter 5 11
f(x) = 0.2 + 25x 200x
2
+ 675x
3
900x
4
+ 400x
5
12
One way to improve the accuracy of the trapezoidal rule is to
divide the integration interval from a to b into a number of
segments and apply the method to each segment.
The areas of individual segments can then be added to yield the
integral for the entire interval.




Substituting the trapezoidal rule for each integral yields:


} } }

+ + + =
= =

=
n
n
x
x
x
x
x
x
n
dx x f dx x f dx x f I
x b x a
n
a b
h
1
2
1
1
0
) ( ) ( ) (
0

2
) ( ) (
2
) ( ) (
2
) ( ) (
1 2 1 1 0 n n
x f x f
h
x f x f
h
x f x f
h I
+
+ +
+
+
+
=

The Multiple-Application
Trapezoidal Rule
by Lale Yurttas, Texas
A&M University
Chapter 5 13
Figure 21.8
by Lale Yurttas, Texas
A&M University
Chapter 5 14
Can be obtained by summing the individual errors for
each segment:




Thus, if the number of segments (n) is doubled, the
truncation error will be quartered.

f
n
a b
E
f n i f
a
' '

=
' '
~
' '

2
3
12
) (
) (
Error of the Multiple-Application
Trapezoidal Rule
Use the two segment trapezoidal rule to estimate
the integral of
f(x) = 0.2 + 25x 200x
2
+ 675x
3
900x
4
+ 400x
5
from a = 0 to b = 0.8. The exact value of the
integral can be determined analytically to be
1.640533
by Lale Yurttas, Texas
A&M University
Chapter 5 15
by Lale Yurttas, Texas
A&M University
Chapter 5 16
More accurate estimate of an integral is obtained if a
high-order polynomial is used to connect the points.
The formulas that result from taking the integrals
under such polynomials are called Simpsons rules.

by Lale Yurttas, Texas
A&M University
Chapter 5 17
Simpsons 1/3 rule
(parabola connecting 3 points)
Simpsons 3/8 rule
(cubic equation connecting 4 points)

Results when a second-order interpolating
polynomial is used.

by Lale Yurttas, Texas
A&M University
Chapter 5 18
| |
2
) ( ) ( 4 ) (
3
) (
) )( (
) )( (
) (
) )( (
) )( (
) (
) )( (
) )( (
2 1 0
2
1 2 0 2
1 0
1
2 1 0 1
2 0
0
2 0 1 0
2 1
2 0
2
0
a b
h x f x f x f
h
I
dx x f
x x x x
x x x x
x f
x x x x
x x x x
x f
x x x x
x x x x
I
x b x a
x
x

= + + ~
(



+


+


=
= =
}
Simpsons 1/3 Rule
19
Single segment application of Simpsons 1/3 rule has a
truncation error of:

Simpsons 1/3 rule is more accurate than trapezoidal rule.
b a f
a b
E
t
) (
2880
) (
) 4 (
5

=
Error of the Simpsons 1/3 Rule
by Lale Yurttas, Texas
A&M University
Chapter 5
Use the Simpson's 1/3 rule to estimate the integral of
f(x) = 0.2 + 25x 200x
2
+ 675x
3
900x
4
+ 400x
5
from a = 0 to b = 0.8. The exact value of the integral
can be determined analytically to be 1.640533
by Lale Yurttas, Texas
A&M University
Chapter 5 20
by Lale Yurttas, Texas
A&M University
Chapter 5 21
Just as the trapezoidal rule, Simpsons rule can be
improved by dividing the integration interval into a
number of segments of equal width.
Yields accurate results and considered superior to
trapezoidal rule for most applications.
However, it is limited to cases where values are
equispaced.
Further, it is limited to situations where there are an
even number of segments and odd number of points.

The Multiple-Application
Simpsons 1/3 Rule
n
a b
h

=
22
Total integral:



Substituting the Simpsons 1/3 rule for each integral
yields:


} } }

+ + + =
n
n
x
x
x
x
x
x
dx x f dx x f dx x f I
2
4
2
2
0
) ( ) ( ) (
6
) ( ) ( 4 ) (
2
6
) ( ) ( 4 ) (
2
6
) ( ) ( 4 ) (
2
1 2
4 3 2 2 1 0
n n n
x f x f x f
h
x f x f x f
h
x f x f x f
h I
+ +
+ +
+ +
+
+ +
=

by Lale Yurttas, Texas


A&M University
Chapter 5
by Lale Yurttas, Texas
A&M University
Chapter 5 23
Can be obtained by summing the individual errors for
each segment.
The estimated error:



) 4 (
4
5
180
) (
f
n
a b
E
a

=
Error of the Multiple-Application
Simpsons 1/3 Rule
by Lale Yurttas, Texas
A&M University
Chapter 5 24
Notes: Only can be used if the number of segments is even.

Use the multiple-application Simpson's 1/3 rule with
n=4 to estimate the integral of
f(x) = 0.2 + 25x 200x
2
+ 675x
3
900x
4
+ 400x
5
from a = 0 to b = 0.8. The exact value of the integral
can be determined analytically to be 1.640533
by Lale Yurttas, Texas
A&M University
Chapter 5 25
26
Utilizes when the number of segments is odd.

| |
3
) (
) ( ) ( 3 ) ( 3 ) (
8
3
) ( ) (
3 2 1 0
3
a b
h
x f x f x f x f
h
I
dx x f dx x f I
b
a
b
a

=
+ + + ~
~ =
} }
Simpsons 3/8 Rule
by Lale Yurttas, Texas
A&M University
Chapter 5

Estimated error:




The 3/8 rule is more accurate than the 1/3 rule.
by Lale Yurttas, Texas
A&M University
Chapter 5 27
) (
6480
) (
) 4 (
5
f
a b
E
t

=
More accurate
a) Use the Simpson's 3/8 rule to estimate the integral
of f(x) = 0.2 + 25x 200x
2
+ 675x
3
900x
4
+ 400x
5
from a = 0 to b = 0.8. The exact value of the integral
can be determined analytically to be 1.640533.
b) Use it in conjunction with Simpsons 1/3 rule to
integrate the same function for five segments.

by Lale Yurttas, Texas
A&M University
Chapter 5 28
by Lale Yurttas, Texas
A&M University
Chapter 5 29
Simpsons 1/3 and 3/8
rules can be applied in
tandem to handle
multiple applications with
odd numbers of intervals.
INTEGRATION WITH UNEQUAL
SEGMENTS
In practice, many situations where does not based on
equally spaced data points and must deal with unequal-
sized segments.
For example: experimental data.
For these cases:
i. Apply the trapezoidal rule to each segment and sum
the results.
ii. Apply appropriate Simpson's rule for these
segments make sure equal length for each segments.
by Lale Yurttas, Texas
A&M University
Chapter 5 30

The information in table 1 was
generated using
f(x) = 0.2 + 25x 200x
2
+ 675x
3

900x
4
+ 400x
5
from a = 0 to b = 0.8.
a)Use trapezoidal rule to integral this
data.
b)Use Simpsons rules for those
segments where they are
appropriate.


by Lale Yurttas, Texas
A&M University
Chapter 5 31
x f(x)
0.0 0.200000
0.12 1.309729
0.22 1.305241
0.32 1.743393
0.36 2.074903
0.40 2.456000
0.44 2.842985
0.54 3.507297
0.64 3.181929
0.70 2.363000
0.80 0.232000
Table 1

Das könnte Ihnen auch gefallen