Gerald Recktenwald
Portland State University
Mechanical Engineering Department
gerry@me.pdx.edu
The latest version of this PDF file, along with other supplemental material
for the book, can be found at www.prenhall.com/recktenwald.
• Basic concepts
• Newton Cotes Rules
Trapezoid rule
Simpson’s rule
• Gaussian Quadrature
• Adaptive Quadrature
• Improper Integrals
f (x )
a b
1 2 ... N
a b
1 2 ... m
f(x)
f2
f1 P1(x)
h = x2 –x1
x1 x2
fn–1
fn–2
f3 fn
f2
f1
h h h h
x1 x2 x3 xn–2 xn–1 xn
a b
0.4
3 panels error = -0.208654
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.4
4 panels error = -0.124097
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.4
5 panels error = -0.081554
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
P2(x)
f(x) f2 f3
f1
h h
x1 x2 x3
f5 fn–3
fn–2
f3 fn
f1
h h h h
x1 x3 x5 xn–3 xn–2 xn
0.4
3 panels error = -0.007070
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.4
4 panels error = -0.002368
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.4
5 panels error = -0.000997
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
f2 f3 f3
f2
f1
f1
h h h h h h
x1 x2 x3 a x1 x2 x3 b
a b
Order 2
1.0000 1.0000
Order 3
0.5556 0.8889 0.5556
Order 4
0.3479 0.6521 0.6521 0.3479
Order 5
0.2369 0.4786 0.5689 0.4786 0.2369
Order 6
0.1713 0.3608 0.4679 0.4679 0.3608 0.1713
-1 -0.5 0 0.5 1
f(x) f(z)
H H 1 1
2 2 2 2
0
10
trapezoid
simpson
GL 4 node
-5
10
Truncation error
-10
10
-15
10 0 1 2 3
10 10 10 10
Number of function evaluations
H for level 1
level 1
a d c e b
left right
level 2
a d c e b a d c e b
left right
level 3
a d c e b a d c e b
level 4
a b a b
100
80
y = humps(x)
60
40
20
-20
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0.07
Space between f(x) evaluations
0.06
0.05
0.04
0.03
0.02
0.01
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x
0
10
quad
quad8
-2
10
tol
-4
10
-6
10 -10 -8 -6 -4 -2 0
10 10 10 10 10 10
Absolute error
5
10
quad
quad8
4
10
flops
3
10
2
10 -10 -8 -6 -4 -2 0
10 10 10 10 10 10
Absolute error