Beruflich Dokumente
Kultur Dokumente
Integration
• Integration:
f x dx
b
I a
f x dx
b
I n
a
f b f a
I a f (a)
b
x adx
ba
f a f b
I b a
2
Error of the Trapezoidal Rule
• An estimate for the local truncation
error of a single application of the
trapezoidal rule is:
1
Et f b a
3
12
where is somewhere between a
and b.
• This formula indicates that the error
is dependent upon the curvature of
the actual function as well as the
distance between the points.
• Error can thus be reduced by
breaking the curve into parts.
MATLAB Program
Simpson’s Rules
• One drawback of the trapezoidal rule is that the error is related to
the second derivative of the function.
• More complicated approximation formulas can improve the
accuracy for curves - these include using (a) 2nd and (b) 3rd order
polynomials.
• The formulas that result from taking the integrals under these
polynomials are called Simpson’s rules.
Simpson’s 1/3 Rule
• Simpson’s 1/3 rule corresponds to using
second-order polynomials. Using the
Lagrange form for a quadratic fit of three
points:
xx
fn x
1 2 f x 0 2 f x 0 1 f x
xx xx xx xx xx
0 1 2
0 1 0 2
x x x x 1 0 1 2
x x x x 2 0 2 1
x x x x
x0 n
h
I
3
f x0 4 f x1 f x2
Composite Simpson’s 1/3 Rule
• Simpson’s 1/3 rule can be used on a
set of subintervals in much the same
way the trapezoidal rule was, except
there must be an odd number of
points.
• Because of the heavy weighting of
the internal points, the formula is a
little more complicated than for the
trapezoidal rule:
xn x2 x4 xn
I x0
fn x dx x0
fn x dx x2
fn x dx x n2
fn x dx
h h h
I
3
f 0
x 4 f 1 2 f x2 4 f x3 f x4
x f x
3
3
f xn2 4 f xn1 f xn
n1 n2
h
I f x0 4 f xi 2 f xi f xn
3
i1
i, odd
j2
j, even
Simpson’s 3/8 Rule
• Simpson’s 3/8 rule corresponds to
using third-order polynomials to fit
four points. Integration over the
four points simplifies to:
x3
I x0
fn x dx
3h
I
8
f x0 3 f x1 3 f x2 f x3