Calculus Mastery

The Human Knowledge Project


Chapter 23 — Numerical Integration

Trapezoid Rule and Simpson’s Rule

23.1 Learning Objectives

By the end of this chapter, students should be able to:

Apply:

Right Endpoint Rule

Midpoint Rule

Trapezoid Rule

Simpson’s Rule

Understand approximation error conceptually.

Explain why curved regions are difficult to compute exactly.

Compare different numerical integration methods.

Understand why numerical approximation became foundational in scientific computing.

23.2 Big Picture — When Exact Integration Becomes Impossible

Earlier chapters introduced:

antiderivatives

definite integrals

the Fundamental Theorem of Calculus

But many integrals cannot be evaluated exactly.

Examples:

∫e

−x

2

dx

∫sin(x

2

)dx

These functions possess:

no simple elementary antiderivative.

Yet science still requires:

numerical answers.

This leads naturally to:

numerical integration.

23.3 Why Approximation Matters

Modern science constantly uses:

approximation

Examples:

weather prediction

engineering simulations

orbital calculations

fluid dynamics

economics

machine learning

Exact symbolic answers often impossible.

Approximation becomes:

essential.

23.4 Revisiting Riemann Sums

Earlier chapters approximated area using:

rectangles

These approximations worked because:

small pieces approximate curves locally.

Now we improve those approximations using:

better geometric shapes.

23.5 Left and Right Endpoint Rules

Suppose interval divided into:

equal subintervals

Width:

Δx =

n

b−a

For each subinterval:

choose endpoint height

Rectangle area:

f(x

i

)Δx

Summing rectangles approximates:

definite integral.

23.6 Why Rectangle Methods Have Error

Rectangles:

do not match curved shapes perfectly.

If curve bends strongly:

approximation may be poor.

Students should visualize:

gaps between rectangles and curve.

This motivates:

improved approximation methods.

23.7 Midpoint Rule

Instead of using:

left endpoint

or:

right endpoint

use:

midpoint of each interval.

This often improves accuracy dramatically.

Why?

Because:

midpoint rectangles balance overestimates and underestimates more effectively.

23.8 Worked Example — Midpoint Approximation

Approximate:

0

2

x

2

dx

using:

2 midpoint rectangles.

Interval width:

Δx =1

Midpoints:

0.5

1.5

Evaluate heights:

f(0.5)=0.25

f(1.5)=2.25

Approximation:

1(0.25+2.25)=2.5

Actual value:

3

8

≈2.667

Reasonably close.

23.9 The Trapezoid Rule — A Better Approximation

Rectangles assume:

flat tops

But curves usually slope.

The Trapezoid Rule instead uses:

slanted line segments.

Each slice becomes:

trapezoid

rather than:

rectangle.

This usually improves accuracy.

23.10 Why Trapezoids Help

Straight slanted edges follow curve behavior better than:

horizontal rectangle tops.

Students should visualize:

trapezoids hugging curve more closely.

The approximation becomes:

smoother and more accurate.

23.11 Trapezoid Rule Formula

For:

n equal subintervals

Formula:

T

n

=

2

Δx

[f(x

0

)+2f(x

1

)+2f(x

2

)+⋯+2f(x

n−1

)+f(x

n

)]

Notice:

interior points counted twice.

23.12 Why Interior Heights Double

Each interior point belongs to:

two neighboring trapezoids.

Thus:

interior heights contribute twice.

Students should visualize:

adjacent trapezoids sharing edges.

23.13 Worked Example — Trapezoid Rule

Approximate:

0

2

x

2

dx

using:

2 trapezoids.

Width:

Δx =1

Evaluate:

f(0)=0

f(1)=1

f(2)=4

Apply formula:

T

2

=

2

1

[0+2(1)+4]

=

2

1

(6)

=3

Actual value:

3

8

≈2.667

Approximation fairly close.

23.14 Simpson’s Rule — Curves Instead of Lines

Trapezoids use:

straight edges

But many functions curve smoothly.

Simpson’s Rule approximates using:

parabolas

instead of:

lines.

This often produces dramatically higher accuracy.

23.15 Why Parabolas Improve Accuracy

Most smooth curves locally resemble:

curved quadratic behavior

better than:

straight segments.

Simpson’s Rule captures:

curvature itself.

This makes the approximation extremely powerful.

23.16 Simpson’s Rule Formula

For even number:

n subintervals

Formula:

S

n

=

3

Δx

[f(x

0

)+4f(x

1

)+2f(x

2

)+4f(x

3

)+⋯+f(x

n

)]

Pattern:

alternating 4’s and 2’s.

23.17 Why the Coefficients Alternate

Simpson’s Rule blends:

neighboring parabolic approximations

The coefficients arise naturally from:

quadratic interpolation geometry.

Students need not derive formula fully yet —

but should understand:

curved approximations generate different weights.

23.18 Worked Example — Simpson’s Rule

Approximate:

0

2

x

2

dx

using:

2 subintervals.

Width:

Δx =1

Values:

f(0)=0

f(1)=1

f(2)=4

Apply formula:

S

2

=

3

1

[0+4(1)+4]

=

3

1

(8)

=

3

8

Remarkably:

exact answer obtained.

23.19 Why Simpson’s Rule Was Exact Here

Because:

original function:

x

2

already quadratic.

Parabolic approximation matches curve perfectly.

This demonstrates:

the power of Simpson’s Rule.

23.20 Comparing Numerical Methods

Rectangle Methods

Simple but rough.

Midpoint Rule

Better balance.

Trapezoid Rule

Uses slanted edges.

Simpson’s Rule

Captures curvature.

Usually most accurate.

23.21 Numerical Error

All approximations contain:

error

But increasing:

number of subintervals

usually reduces error dramatically.

Students should understand:

approximation quality depends on:

smoothness

subdivision size

method choice

23.22 Why Smaller Intervals Improve Accuracy

Smaller intervals mean:

curves appear more locally linear/quadratic

Approximation shapes fit better.

This reflects one of calculus’s deepest ideas:

sufficiently small regions behave simply.

23.23 Physical Interpretation

Suppose:

velocity data measured experimentally

Exact velocity formula may not exist.

Numerical integration estimates:

total displacement

from sampled measurements.

This becomes extremely important in:

engineering

laboratory science

signal processing

23.24 Why Numerical Integration Became Essential Historically

Many important integrals resisted symbolic solution.

Numerical integration allowed:

astronomy

engineering

navigation

physics

to advance dramatically.

Modern computers perform:

billions of numerical integrations constantly.

23.25 Relationship to Earlier Calculus Ideas

This chapter combines:

limits

accumulation

approximation

definite integrals

geometry

numerical methods

Numerical integration beautifully connects:

computation

and:

geometric intuition.

23.26 Common Student Mistakes

Mistake 1 — Using Wrong Formula

Carefully distinguish:

trapezoid

midpoint

Simpson’s Rule

Mistake 2 — Forgetting Interval Width

Need:

Δx

correctly.

Mistake 3 — Arithmetic Errors

Long summations require organization.

Mistake 4 — Forgetting Geometric Meaning

These methods approximate:

accumulated area.

23.27 Visualization Strategy

Students should continually imagine:

rectangles

trapezoids

curved approximations

shrinking intervals

increasingly accurate fits

Numerical integration is deeply geometric.

23.28 Why This Chapter Matters

This chapter introduces:

computational calculus

which dominates:

modern science

engineering

data analysis

computer simulation

Most real integrals in advanced science are solved:

numerically.

23.29 Practice Problems

A. Rectangle and Midpoint Rules

Approximate:

0

2

xdx

using:

left endpoints

Approximate using:

right endpoints

Approximate using:

midpoint rule

Explain why midpoint rule often improves accuracy.

Explain why rectangles create approximation error.

B. Trapezoid Rule

Use trapezoid rule for:

0

2

x

2

dx

with:

2 subintervals

Use trapezoid rule for:

0

1

x

3

dx

Explain why trapezoids improve over rectangles.

Explain why interior heights count twice.

Explain why slanted edges fit curves better.

C. Simpson’s Rule

Use Simpson’s Rule for:

0

2

x

2

dx

Use Simpson’s Rule for:

0

2

x

3

dx

Explain why Simpson’s Rule uses parabolas.

Explain why Simpson’s Rule is often very accurate.

Explain why smooth curves favor quadratic approximations.

D. Numerical Error

Explain why numerical methods contain error.

Explain why smaller intervals reduce error.

Explain why smooth functions approximate well locally.

Explain why exact integration sometimes fails.

Explain why numerical methods became essential scientifically.

E. Conceptual Problems

Explain relationship between:

geometry

approximation

integration

Explain why calculus studies infinite refinement.

Explain why computers rely heavily on numerical integration.

Explain why approximation is fundamental in modern science.

Explain why local behavior determines global accuracy.

Explain why curved approximations outperform linear ones.

Explain why integration and computation connect naturally.

Explain why Simpson’s Rule became historically important.

Explain why numerical analysis became its own mathematical field.

Explain why approximation methods are central to scientific computing.

23.30 Selected Solutions

Problem 1

Approximate:

0

2

xdx

using left endpoints with:

2 intervals.

Width:

Δx =1

Left endpoints:

0

1

Approximation:

1(0+1)=1

Actual answer:

2

Underestimate.

Problem 6

Approximate:

0

2

x

2

dx

using trapezoid rule.

Formula:

T

2

=

2

1

[0+2(1)+4]

=3

Problem 11

Apply Simpson’s Rule:

S

2

=

3

1

[0+4(1)+4]

=

3

8

Exact answer.

Problem 17

Smaller intervals reduce error because:

curves behave more simply locally

Approximation shapes fit more accurately over tiny regions.

23.31 Chapter Summary

In this chapter we introduced:

numerical integration

midpoint approximations

trapezoid rule

Simpson’s Rule

approximation error

computational integration

numerical analysis concepts

Most importantly:

students learned that even when exact antiderivatives fail,

calculus can still approximate:

areas

accumulations

physical quantities

with remarkable accuracy using numerical methods.