7. Numerical Integration II

Composite Methods

Composite Methods in Numerical Integration II 📘

Welcome, students! In this lesson, you will learn how composite methods turn a hard integration problem into many easier ones. This is one of the most important ideas in numerical integration because real-world integrals are often too complicated to solve exactly. Instead of using one formula across the whole interval, composite methods split the interval into smaller parts and apply a rule repeatedly. That makes the approximation more accurate and flexible ✅

Lesson objectives

By the end of this lesson, you should be able to:

  • explain the main ideas and terminology behind composite methods,
  • apply numerical procedures related to composite methods,
  • connect composite methods to error bounds and adaptive quadrature,
  • summarize how composite methods fit into Numerical Integration II,
  • use examples and reasoning to justify when composite methods are useful.

Imagine you are estimating the distance of a winding road on a map. Using one straight-line estimate for the whole road would be rough. But if you break the road into many short segments, the estimate becomes much better. Composite methods work in the same way for areas under curves 🚗

1. Why composite methods are needed

A definite integral such as $\int_a^b f(x)\,dx$ often represents area, total change, or accumulated quantity. In theory, some integrals can be solved exactly. In practice, many cannot. The function may be messy, only given by data, or too difficult to integrate symbolically.

This is where numerical methods come in. A basic rule like the trapezoidal rule or Simpson’s rule gives an approximate value on one interval. But if the interval $[a,b]$ is long, curved, or uneven, one large approximation can miss important details. Composite methods improve this by dividing the interval into smaller subintervals.

Suppose we split $[a,b]$ into $n$ equal parts, each of width

$$h=\frac{b-a}{n}.$$

Then the partition points are

$$x_i=a+ih, \quad i=0,1,2,\dots,n.$$

The key idea is simple: apply a numerical rule on each small piece and add the results. That is what makes the method “composite” 📏

2. The main idea of composite rules

A composite method is built from a basic quadrature rule. A quadrature rule is a formula for approximating an integral using function values. Common examples include the left and right rectangle rules, the midpoint rule, the trapezoidal rule, and Simpson’s rule.

The general strategy is:

  1. divide $[a,b]$ into subintervals,
  2. evaluate $f(x)$ at selected points in each subinterval,
  3. combine those values using the rule,
  4. add the contributions from all subintervals.

This is useful because a smaller interval usually means the curve is less likely to bend a lot inside it. So the local approximation becomes more accurate.

For example, if a curve bends upward and downward several times, one large trapezoid may fit poorly. But many small trapezoids can follow the curve much more closely. This is why composite methods are often more reliable than single-interval formulas 🌊

3. Composite trapezoidal rule

The composite trapezoidal rule is one of the most widely used methods. On each subinterval $[x_{i-1},x_i]$, the area under the graph is approximated by a trapezoid.

The formula is

$$\int_a^b f(x)\,dx \approx \frac{h}{2}\left[f(x_0)+2\sum_{i=1}^{n-1}f(x_i)+f(x_n)\right].$$

This expression has an important pattern. The endpoints $x_0$ and $x_n$ appear once, while the interior points appear twice because each interior point belongs to two neighboring trapezoids.

Example

Approximate $\int_0^2 x^2\,dx$ using $n=4$ subintervals.

First, compute

$$h=\frac{2-0}{4}=0.5.$$

The points are $x_0=0$, $x_1=0.5$, $x_2=1$, $x_3=1.5$, $x_4=2$.

Evaluate the function:

$$f(x)=x^2,$$

so

$$f(0)=0,\quad f(0.5)=0.25,\quad f(1)=1,\quad f(1.5)=2.25,\quad f(2)=4.$$

Now apply the formula:

$$\int_0^2 x^2\,dx \approx \frac{0.5}{2}[0+2(0.25+1+2.25)+4].$$

This gives

$$0.25[0+2(3.5)+4]=0.25(11)=2.75.$$

The exact value is $\frac{8}{3}\approx 2.6667$, so the approximation is close, but not exact. This shows that even good composite methods still have error 📌

4. Composite Simpson’s rule

Simpson’s rule often gives higher accuracy than the trapezoidal rule because it approximates the function by parabolas instead of straight lines. The composite Simpson’s rule requires an even number of subintervals, so let $n$ be even.

The formula is

$$\int_a^b f(x)\,dx \approx \frac{h}{3}\left[f(x_0)+4\sum_{i=1,\, i\text{ odd}}^{n-1} f(x_i)+2\sum_{i=2,\, i\text{ even}}^{n-2} f(x_i)+f(x_n)\right].$$

The coefficients follow a pattern of $1,4,2,4,2,\dots,4,1$.

Why the pattern matters

The odd-indexed points get weight $4$, and the even-indexed interior points get weight $2$. This comes from combining parabolic approximations over pairs of subintervals. Because of that, Simpson’s rule usually captures curvature better than the trapezoidal rule.

Example

Use composite Simpson’s rule to approximate $\int_0^2 x^2\,dx$ with $n=4$.

We already have the points and function values:

$$f(0)=0,\ f(0.5)=0.25,\ f(1)=1,\ f(1.5)=2.25,\ f(2)=4.$$

Then

$$\int_0^2 x^2\,dx \approx \frac{0.5}{3}[0+4(0.25+2.25)+2(1)+4].$$

Compute the inside:

$$0+4(2.5)+2+4=16.$$

So the approximation is

$$\frac{0.5}{3}\cdot 16=\frac{8}{3}.$$

This matches the exact value exactly. For polynomial functions up to degree $3$, Simpson’s rule can be exact under ideal conditions. That is one reason it is so powerful 🎯

5. Error behavior and why smaller steps help

Composite methods are tied closely to error bounds. The basic idea is that when $h$ becomes smaller, the approximation usually improves. Why? Because each subinterval is flatter and simpler than the whole interval.

For the composite trapezoidal rule, the error is related to the second derivative $f''(x)$. A common error bound is

$$|E_T| \le \frac{(b-a)}{12}h^2\max_{a\le x\le b}|f''(x)|.$$

For composite Simpson’s rule, the error is related to the fourth derivative $f^{(4)}(x)$. A common error bound is

$$|E_S| \le \frac{(b-a)}{180}h^4\max_{a\le x\le b}|f^{(4)}(x)|.$$

These formulas show an important comparison. The trapezoidal rule error decreases like $h^2$, while Simpson’s rule error decreases like $h^4$. That means if the function is smooth enough, Simpson’s rule can improve much faster as the number of subintervals grows.

This is a big idea in Numerical Analysis: accuracy depends not just on the rule, but also on the size of the subintervals and the smoothness of the function. A smooth curve with gentle bending is easier to approximate than one with sharp changes.

6. Composite methods in practice

Composite methods are used in science, engineering, economics, and data analysis. For example:

  • estimating the total work done by a force measured at many points,
  • finding the distance traveled from speed data collected over time,
  • computing total energy from a power function,
  • approximating probability values from a density function.

Often, the function values are given in a table rather than as a formula. Composite methods still work because they only need values at selected points. This makes them very practical for digital computation 💻

However, there are things to watch carefully:

  • the interval must be divided correctly,
  • the weights must match the rule,
  • Simpson’s rule requires an even number of subintervals,
  • more subintervals usually mean more accuracy, but also more function evaluations.

So there is a balance between cost and precision. In numerical work, it is not enough to ask “Can we compute it?” We also ask “How accurate is it, and how much effort does it take?”

7. Connection to adaptive quadrature

Composite methods connect directly to adaptive quadrature, which is a more advanced idea in Numerical Integration II. In composite methods, the interval is usually split evenly. In adaptive quadrature, the computer chooses subinterval sizes based on how difficult the function looks in different regions.

If the graph is smooth in one region, larger steps may be enough. If it changes rapidly in another region, smaller steps are used there. This is efficient because it spends more effort only where needed.

So composite methods provide the foundation. Adaptive methods improve on them by changing the step size intelligently. In other words, composite rules teach the basic machinery, and adaptive quadrature automates the decision-making 🧠

Conclusion

Composite methods are a central part of Numerical Integration II because they turn one hard integral into many simpler ones. By dividing $[a,b]$ into subintervals of width $h$, then applying a rule like the trapezoidal rule or Simpson’s rule repeatedly, we get better approximations and clearer error control. The smaller the subintervals, the more closely the method can follow the curve.

These methods matter because they are practical, efficient, and widely used in real-world computation. They also lead naturally to error bounds and adaptive quadrature, which are important next steps in numerical analysis. students, if you understand composite methods, you have mastered one of the core tools for approximating integrals accurately and intelligently ✅

Study Notes

  • Composite methods approximate $\int_a^b f(x)\,dx$ by splitting $[a,b]$ into smaller subintervals.
  • The step size is $h=\frac{b-a}{n}$, and the nodes are $x_i=a+ih$.
  • The composite trapezoidal rule is

$$\int_a^b f(x)\,dx \approx \frac{h}{2}\left[f(x_0)+2\sum_{i=1}^{n-1}f(x_i)+f(x_n)\right].$$

  • The composite Simpson’s rule is

$$\int_a^b f(x)\,dx \approx \frac{h}{3}\left[f(x_0)+4\sum_{i=1,\, i\text{ odd}}^{n-1} f(x_i)+2\sum_{i=2,\, i\text{ even}}^{n-2} f(x_i)+f(x_n)\right].$$

  • Composite trapezoidal error is typically proportional to $h^2$.
  • Composite Simpson’s error is typically proportional to $h^4$.
  • Smaller $h$ usually means better accuracy, but more function evaluations.
  • Composite methods are the basis for adaptive quadrature, which adjusts interval sizes automatically.

Practice Quiz

5 questions to test your understanding