SME
Numerical Methods for Engineers · Problem type
Error of the trapezoid rule
Use this for “Estimate the trapezoid rule’s error for x³ from 0 to 2 with 4 panels, taking the average f″ as 6.”
Table
Panels (n)
Error estimate (E)
This is an example. Type your own values to start a new problem.
E
=
−
−
12
×
h
2
×
f″
n
Panels
example
Formulas
h
=
b
−
a
n
0.5
=
2 − 0
4
E
=
−(
b
−
a
)
×
h
2
×
f″
÷
12
−0.25
=
−(2
−
0)
×
0.5
2
×
6
12
Assumptions
•
E is the exact integral minus the trapezoid estimate, with n panels of width h.
•
f″ is the second derivative’s average over [a, b]; E is exact when f″ is constant.
•
E below 0 means the estimate is too big (the curve bends up); halving h quarters E.
Step-by-step
WE KNOW
a = 0, b = 2, n = 4, f″ = 6
FIND
panel width (h), error estimate (E)
Step 1 · Find panel width (h)
Use h = (b − a) ÷ n
Cut
the
interval
from
a
to
b
into
n
panels
of
equal
width.
h
=
2 − 0
4
h
=
0.5
Step 2 · Find error estimate (E)
Use E = −(b − a) × h² × f″ ÷ 12
Each
panel
misses
by
about
−
h
3
f″
÷
12,
and
b
−
a
h
panels
add
up
to
this.
E
=
−(2
−
0)
×
0.5
2
×
6
12
E
=
−2
×
0.5
2
×
6
12
E
=
−2
×
0.25
×
6
12
E
=
−0.5
×
6
12
E
=
−
3
12
E
=
−0.25
Check
Put the numbers back in. Both sides should match.
0.5
=
2 − 0
4
✓
−0.25
=
−(2
−
0)
×
0.5
2
×
6
12
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.
Related lessons
Numerical integration
Main lesson
Integrating tabulated data
Use this for “A car’s speed, read every 10 s, is 4, 12, 20 and 24 m/s. Estimate the distance it covers with the trapezoid rule.”
Two-point Gauss quadrature
Use this for “Estimate the integral of x³ from 0 to 2 with two-point Gauss quadrature and compare it with the exact value.”