Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Numerical integration is the process of estimating a definite integral when an exact antiderivative is hard to find or when the function is only known from data. In calculus, the integral of f(x) from a to b represents signed area under a curve. Numerical methods replace the curved region with simpler shapes whose areas are easy to compute.

This matters in physics, engineering, biology, economics, and data science, where measurements often come as tables rather than formulas.

The main idea is to split the interval [a, b] into smaller subintervals and approximate the area on each one. The trapezoidal rule uses straight line segments to form trapezoids, while Simpson's rule uses parabolas to better match curved behavior. Smaller step sizes usually improve accuracy, but different methods improve at different rates.

Error estimates help decide how many subintervals are needed and whether a method is appropriate for a given function.

Understanding Calculus: Numerical Integration

The trapezoidal rule has a useful geometric bias. It joins two nearby data points with a straight chord. If the graph bends upward across that interval, the chord usually lies above the graph, so the estimate is too large.

If the graph bends downward, the chord usually lies below it, so the estimate is too small. This helps students judge an answer before trusting a calculator.

Errors from different intervals can partly cancel, but that cancellation is not something to rely on. The trapezoidal rule gives an exact result for a straight line because no bending is being ignored.

Simpson's rule works with three consecutive sample points at a time. It fits one smooth parabola through those points, then uses the area under that parabola. The middle point receives four times the weight of an endpoint in each three-point group because of the way the parabolic area is calculated.

Points shared by neighboring groups receive the smaller repeated weight. This pattern explains why the number of subintervals must be even. Each parabolic piece covers two subintervals.

Simpson's rule is exact for any polynomial curve up to degree three, which includes constant, linear, quadratic, and cubic graphs. That strength explains its good performance on many smooth curves.

Careful organization prevents most calculation mistakes. Make a table with each input value in the first column and its function value in the second. Check that the inputs are equally spaced before using the standard formulas.

For the trapezoidal rule, give the first and last function values a weight of one. Give every interior value a weight of two. For Simpson's rule, the endpoint values have weight one, then the interior weights alternate four and two, ending with four before the final endpoint.

Add the weighted values before multiplying by the step size factor. A missed weight or an odd number of subintervals can produce a neat-looking answer that is invalid.

Numerical integration appears whenever a total must be built from changing measurements. A speed sensor can provide speed at regular times, and integration estimates distance traveled. A power meter can provide power readings, and integration estimates energy use.

In a science experiment, a graph of force against position can estimate work done. Units provide an important check. Integrating speed in meters per second over seconds should give meters.

Integrating force in newtons over meters should give joules. Use extra care near sharp corners, sudden jumps, narrow peaks, or noisy measurements. Reducing the step size may help, though it cannot fix poor data.

A practical accuracy check is to calculate once with a chosen step size, then again with half that step size. For a smooth graph, trapezoidal estimates often change by about a factor of four in their error, while Simpson estimates often change by about a factor of sixteen.

Key Facts

  • A definite integral gives signed area: integral from a to b of f(x) dx.
  • Step size for n equal subintervals: h = (b - a)/n.
  • Trapezoidal rule: integral from a to b f(x) dx ≈ h/2 [f(x0) + 2f(x1) + 2f(x2) + ... + 2f(x(n-1)) + f(xn)].
  • Simpson's rule: integral from a to b f(x) dx ≈ h/3 [f(x0) + 4f(x1) + 2f(x2) + 4f(x3) + ... + 2f(x(n-2)) + 4f(x(n-1)) + f(xn)], where n is even.
  • Trapezoidal rule error generally decreases like h^2 for smooth functions.
  • Simpson's rule error generally decreases like h^4 for smooth functions, so it often reaches high accuracy with fewer subintervals.

Vocabulary

Numerical integration
A method for estimating a definite integral using arithmetic approximations instead of an exact antiderivative.
Definite integral
The accumulated signed area under a function over a specified interval.
Step size
The width h of each subinterval used to divide the integration interval.
Trapezoidal rule
A numerical integration method that approximates the curve with straight line segments and adds the areas of trapezoids.
Simpson's rule
A numerical integration method that approximates the curve with parabolic arcs over pairs of subintervals.

Common Mistakes to Avoid

  • Using Simpson's rule with an odd number of subintervals is wrong because standard Simpson's rule requires n to be even.
  • Forgetting the endpoint weights in the trapezoidal rule gives an incorrect total because the first and last function values are counted only once, not twice.
  • Confusing h with n leads to wrong scaling because h is the subinterval width, while n is the number of subintervals.
  • Assuming more subintervals always fixes every problem is incomplete because discontinuities, sharp corners, or noisy data can limit accuracy and may require a different method or smaller local spacing.

Practice Questions

  1. 1 Use the trapezoidal rule with n = 4 to approximate integral from 0 to 2 of x^2 dx. Use equally spaced points.
  2. 2 Use Simpson's rule with n = 4 to approximate integral from 0 to 2 of x^3 dx. Compare your result with the exact value.
  3. 3 A sensor records velocity at equally spaced times, but no formula for velocity is known. Explain why numerical integration is useful for estimating displacement, and state which method might work better if the velocity changes smoothly.