Newton-Cotes Integration
Learning outcome
Recognizing that Newton-Cotes integration formulas are based on the strategy of
replacing a complicated function or tabulated data with a polynomial that is easy to
integrate.
Knowing how to implement the following single application Newton-Cotes
formulas:
Trapezoidal rule
Simpsons 1/3 rule
Simpsons 3/8 rule
Knowing how to implement the following composite Newton-Cotes formulas:
Trapezoidal rule
Simpsons 3/8 rule
Recognizing that even-segment-odd-point formulas like Simpsons 1/3 rule achieve
higher than expected accuracy.
Knowing how to use the trapezoidal rule to integrate unequally spaced data.
Introduction
Differentiation?
Process of finding derivative (dy/dx) - rate of change of a dependent variable
with respect to an independent variable.
y f(xi x) f(xi )
x
x
f(xi x) f(xi )
dy
x lim 0
dx
x
Integration?
Process of finding integral, I - the area under a function plotted on a graph.
f(x)
Area,A I f x dx
Introduction
Why? engineering deals with systems/processes that are changing.
derivative and integral calculus are used to describe physical worlds such as...
Derivative - finding the velocity of a body from acceleration functions, and
displacement of a body from velocity data.
Integral - finding area under the curves, centroid, moment of inertia, work
by variable force (Hookes Law), electric charge, average value, force by
liquid pressure.
Numerical integration
Numerical Integration (i.e. QUADRATURE)
Integral,I A f x dx
f(x)
f(x) = integrand
x = variable
a, b = integration limits
Methods of numerical integration
Newton-Cotes integration formula
1. Trapezoidal rule
2. Simpsons rule
Simpsons 1/3rule
Romberg integration
Gauss quadrature
I f(x)dx f n (x)dx
a
f n (x) a 0 a1x a n 1x n 1 a n x n
Integrating function
i.e. interpolating
polynomial
f x dx
b
Multiple-application
repeatedly apply single integral for each
sub-interval of data points
higher accuracy
I f(x) dx I1 I 2 I3 .... I n
a
I f(x)dx f1 (x)dx
f1 (x) a 0 a 1x
b
Parallelsides
(Height)
f(a) f(b)
I (b a)
Trapezoidal for
single integral
1
3
E t f b a
12
Where, is somewhere between a
and b.
error is dependent upon the secondderivative of the actual function
It is 1st order accurate give exact result
if the actual function is linear.
error is dependent on the third power of
the step size
Error can thus be reduced by breaking the
curve into parts
Use multiple-application/composite
f(a) f(b)
0.2 0.232
I (b a)
(
0
.
8
0
)
0.1728
2
2
t 89.5%
ba
n
a x0
b xn
x2
xn
x0
x1
x n 1
I f(x)dx f(x)dx
f(x)dx
Ih
f(x 0 ) f(x1 )
f(x ) f(x 2 )
f(x ) f(x n )
h 1
h n 1
2
2
2
h
I f(xo ) 2 f(xi ) f(xn )
2
i 1
(b a) 3
Ea
f
2
12n
Problem
For high accuracy, need more segments more computations more
round-off errors!
Solution
Use higher-order polynomial as the integrating function!
t 34.9%
2. Simpsons Rules
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.
a) Simpsons 1/3 rule use 2nd-order interpolating polynomial
b) Simpsons 3/8 rule use 3rd-order interpolating polynomial
I f(x)dx f 2 (x)dx
a
f 2 (x) a 0 a 1x a 2 x 2
Using the Lagrange form for a quadratic fit of three points:
f n x
x x1 x x 2 f x x x 0 x x 2 f x x x 0 x x1 f x
x 0 x1 x 0 x 2 0 x1 x 0 x1 x 2 1 x 2 x 0 x 2 x1 2
f 2 x dx
h
f x 0 4f x1 f x 2
3
x0
ba
h
2
Sub-interval is
equally spaced
Et
b a 4
2880
ba
n
ax
bx
x2
x4
xn
x0
x2
x n 2
h
f x 0 4f x1 f x 2 h f x 2 4f x 3 f x 4 h f x n 2 4f x n 1 f x n
3
3
3
n 1
n 2
h
I f x 0 4 f x i 2
f x i f x n
3
i 1
j 2
i,
odd
j, even
Ea
(b a ) 5
180n 4
f (4)
n 1
n 2
h
I f x 0 4 f x i 2
f x i f x n
3
i 1
j 2
i,
odd
j, even
Ea
(b a ) 5
180n 4
f (4)
I f(x)dx f 3 (x)dx
a
f 3 (x) a 0 a1x a 2 x 2 a 3 x 3
Using the Lagrange form for a 3rd-order polynomial to fit of four points:
Integration over the three points simplifies to:
f x dx
x2
x0
ba
h
3
3h
I f x 0 3f x1 3f x 2 f x 3
8
Where, x0 = a , x1=(a+b)/3, x2=(2a+2b)/3 & x2 = b
Sub-interval is
equally spaced
Et
b a 4
6480
ba
n
a x0
b xn
xn
x6
I f(x)dx f(x)dx
x0
x3
f(x)dx
x n 3
3h
I
(f x i f x i 1 ) 2
f x i f x n
f x 0 3
8
i 2,5,7..
j 4,7,10...
2. Simpsons Rule
FINAL REMARKS
Simpsons 1/3
for EVEN number of segments
3rd order accuracy (although based on 2nd order polynomial) thus it is a
preferred method!
Simpsons 3/8
For ODD number of segments & segment must be divisible by 3.
Can be used in combination with 1/3 rule to solve for ODD number of
segments
Simpsons rules are sufficient for most applications.
Higher-order Newton-Cotes formulas may also be used - in general, the higher the
order of the polynomial used, the higher the derivative of the function in the error
estimate and the higher the power of the step size. more accurate but rarely
used
2. Simpsons Rule
FINAL REMARKS
Simpsons 1/3
for EVEN number of segments
3rd order accuracy (although based on 2nd order polynomial) thus it is a
preferred method!
Simpsons 3/8
For ODD number of segments & segment must be divisible by 3.
Can be used in combination with 1/3 rule to solve for ODD number of
segments
Simpsons rules are sufficient for most applications.
Higher-order Newton-Cotes formulas may also be used - in general, the higher the
order of the polynomial used, the higher the derivative of the function in the error
estimate and the higher the power of the step size. more accurate but rarely
used
2. Simpsons Rule
For unequal segments, one method is to
apply trapezoidal rule to each segment and
sum the results
f(x0 ) f(x1 )
f(x1 ) f(x2 )
f(xn 1 ) f(xn )
I h1
h2
hn
2
2
2
Where hi = the width of segment i
Replace tabulated data and complicated function (i.e. integrand) with an nth
order integrating polynomial across the integration interval
b
I f(x)dx f n (x)dx
Accuracy;
Higher order polynomial more accurate
Method of application:
Single application not accurate
Multiple application more accurate (need more data values!)