Tutorials › Calculus II › Composite Taylor Integration and Error Accumulation

Taylor Methods in Computation · Tutorial 883 of 998

Composite Taylor Integration and Error Accumulation

Build a composite Taylor integral by integrating a local polynomial on each panel, then bound how the local errors combine across the interval.

Advanced 9 min read

What You'll Learn

  • Define a composite Taylor approximation on a partition of an integration interval
  • Derive midpoint-centered and left-endpoint error bounds for each panel
  • Relate the number of equal panels to the total error for a fixed Taylor degree
  • Compute composite approximations and verify their errors using exact integrals
  • Distinguish a bound for one panel from a bound for the accumulated error

Why Divide an Integral into Panels?

A Taylor polynomial describes a function near one chosen center. When an interval is wide, using a single polynomial across the whole interval may give a poor approximation. A natural alternative is to divide the interval into shorter panels, build a Taylor polynomial on each panel, and integrate those polynomials separately.

This approach is called composite Taylor integration. Its accuracy depends on two related quantities: how well each local polynomial represents the function on its panel, and how the errors from all panels accumulate. A small error on each panel does not by itself guarantee a small total error unless the number and widths of the panels are also taken into account.

Definition of the Composite Approximation

Let \(f\) have \(m+1\) continuous derivatives on \([a,b]\), and partition the interval using points \(a=x_0<x_1<\cdots<x_N=b\). Panel \(i\) is \([x_{i-1},x_i]\), with width \(h_i=x_i-x_{i-1}\). Choose a center \(c_i\) in each panel. The degree-\(m\) Taylor polynomial of \(f\) centered at \(c_i\) is

$$ T_{m,i}(x)=\sum_{k=0}^{m}\frac{f^{(k)}(c_i)}{k!}(x-c_i)^k. $$

Integrate this polynomial over its own panel, then add the panel integrals. The result, denoted \(Q\), approximates the definite integral of \(f\).

$$ Q=\sum_{i=1}^{N}\int_{x_{i-1}}^{x_i}T_{m,i}(x)\,dx. $$
Definition: A composite Taylor integral is the sum of the integrals of local Taylor polynomials, where each polynomial is used on its own panel. Its total error is \(E=\int_a^b f(x)\,dx-Q\).

For equal-width panels, \(h_i=h=(b-a)/N\). A common choice is the midpoint \(c_i=(x_{i-1}+x_i)/2\), which makes the limits symmetric about the expansion center. Another choice is the left endpoint \(c_i=x_{i-1}\). The same principle applies in either case, but the resulting error bounds differ.

How Local Errors Accumulate

Assume that \(|f^{(m+1)}(x)|\le M\) throughout the interval. Taylor's theorem gives, on panel \(i\),

$$ |f(x)-T_{m,i}(x)| \le \frac{M}{(m+1)!}|x-c_i|^{m+1}. $$

The error in the integral over one panel is the integral of the difference between the function and its polynomial. Taking absolute values and using the triangle inequality bounds that panel's error. The total error is bounded by adding the bounds for all the panels. This last step matters: errors of opposite signs can partly cancel, but a guaranteed bound must allow for the possibility that they do not.

Midpoint-Centered Bound

For a midpoint-centered polynomial, each panel extends \(h_i/2\) to either side of \(c_i\). Integrating the Taylor remainder bound across that symmetric panel gives the following result.

Theorem: Suppose \(f\) has \(m+1\) continuous derivatives on \([a,b]\), and \(|f^{(m+1)}(x)|\le M\) there. If \(T_{m,i}\) is centered at the midpoint of each panel, then $$ \left|\int_a^b f(x)\,dx-Q\right| \le \frac{M}{2^{m+1}(m+2)!}\sum_{i=1}^{N}h_i^{m+2}. $$ For \(N\) equal panels of width \(h=(b-a)/N\), this implies $$ \left|\int_a^b f(x)\,dx-Q\right| \le \frac{M(b-a)h^{m+1}}{2^{m+1}(m+2)!}. $$

The derivation follows directly from the remainder estimate. On one midpoint panel, put \(t=x-c_i\), so that \(-h_i/2\le t\le h_i/2\). Then

$$ \begin{aligned} \left|\int_{x_{i-1}}^{x_i}\bigl(f(x)-T_{m,i}(x)\bigr)\,dx\right| &\le \int_{-h_i/2}^{h_i/2}\frac{M}{(m+1)!}|t|^{m+1}\,dt\\ &=\frac{2M}{(m+1)!}\int_0^{h_i/2}t^{m+1}\,dt\\ &=\frac{2M}{(m+1)!}\frac{(h_i/2)^{m+2}}{m+2}\\ &=\frac{M h_i^{m+2}}{2^{m+1}(m+2)!}. \end{aligned} $$

Adding this bound over the panels proves the stated result. For equal widths, \(N h^{m+2}=(b-a)h^{m+1}\), which gives the second bound. Thus, with the degree fixed, halving the panel width reduces this guaranteed error by a factor of \(2^{m+1}\). This is an upper bound, not a promise that every actual error decreases by exactly that factor.

Worked Example: A Degree-One Midpoint Approximation

Worked Example: A Degree-One Midpoint Approximation

Approximate \(\int_0^1 x^2\,dx\) using two equal panels and degree-one Taylor polynomials centered at the panel midpoints. Then compare the actual error with the bound.

The panels have width \(h=1/2\), and their midpoints are \(c_1=1/4\) and \(c_2=3/4\). Since \(f(x)=x^2\), its degree-one Taylor polynomial at \(c\) is \(T_1(x)=c^2+2c(x-c)\). The term proportional to \(x-c\) integrates to zero on a midpoint panel.

$$ \begin{aligned} \int_0^{1/2}T_{1,1}(x)\,dx &=\frac12\left(\frac14\right)^2=\frac{1}{32},\\ \int_{1/2}^{1}T_{1,2}(x)\,dx &=\frac12\left(\frac34\right)^2=\frac{9}{32},\\ Q&=\frac{1}{32}+\frac{9}{32}=\frac{5}{16}. \end{aligned} $$

The exact integral is \(\int_0^1x^2\,dx=1/3\), so the actual absolute error is \(1/3-5/16=1/48\). To check the theorem's bound, \(m=1\), \(M=\max_{[0,1]}|f''(x)|=2\), \(b-a=1\), and \(h=1/2\). Therefore

$$ \frac{M(b-a)h^{m+1}}{2^{m+1}(m+2)!} =\frac{2(1)(1/2)^2}{2^2\,3!} =\frac{1}{48}. $$

The actual error equals this bound. The calculation also checks the approximation against the exact integral.

Left-Endpoint Panels

It is also possible to center each Taylor polynomial at the left endpoint of its panel. In that case, \(|x-c_i|\le h_i\), rather than \(h_i/2\). Integrating the same remainder estimate gives a different bound.

Theorem: Under the same derivative assumptions, if each degree-\(m\) Taylor polynomial is centered at the left endpoint of its panel, then $$ \left|\int_a^b f(x)\,dx-Q\right| \le \frac{M}{(m+2)!}\sum_{i=1}^{N}h_i^{m+2}. $$ For equal panels this is at most \(M(b-a)h^{m+1}/(m+2)!\).

Indeed, on a panel of width \(h_i\), integrate the bound \(M(x-c_i)^{m+1}/(m+1)!\) from \(c_i\) to \(c_i+h_i\). The result is \(M h_i^{m+2}/(m+2)!\). Summing over panels gives the theorem. The left-endpoint bound lacks the factor \(2^{-(m+1)}\) present in the midpoint bound; this reflects the larger maximum distance from the center used in the estimate.

Worked Example: Left-Endpoint Constants on Four Panels

Worked Example: Left-Endpoint Constants on Four Panels

Approximate \(\int_0^1x^2\,dx\) by using degree-zero Taylor polynomials at the left endpoints of four equal panels. Here \(h=1/4\). Since the degree-zero polynomial at a point is the function value there, the four panel contributions are

$$ \begin{aligned} Q &=\frac14\left(f(0)+f\left(\frac14\right)+f\left(\frac12\right)+f\left(\frac34\right)\right)\\ &=\frac14\left(0+\frac{1}{16}+\frac14+\frac{9}{16}\right)\\ &=\frac14\left(\frac{14}{16}\right)=\frac{7}{32}. \end{aligned} $$

The exact integral is \(1/3\), so the actual error is \(1/3-7/32=11/96\). For the bound, \(m=0\), \(M=\max_{[0,1]}|f'(x)|=2\), and \(b-a=1\). Thus

$$ \frac{M(b-a)h^{m+1}}{(m+2)!} =\frac{2(1)(1/4)}{2!} =\frac14. $$

The actual error \(11/96\) is less than \(1/4\), as required. The bound guarantees an error no larger than \(1/4\); it need not be close to the actual error.

Panel Width, Degree, and Nonuniform Partitions

The sum \(\sum_i h_i^{m+2}\) shows how a nonuniform partition affects the guarantee. A panel with twice the width contributes \(2^{m+2}\) times as much to this sum, if the same derivative bound applies. In a nonuniform partition, reducing the largest widths can therefore matter more than making already-short panels even shorter.

For equal panels over a fixed interval of length \(L=b-a\), the midpoint bound is proportional to \(h^{m+1}\). Since \(h=L/N\), it is also proportional to \(N^{-(m+1)}\), with \(m\) fixed. This describes the guaranteed rate as panels are added. Increasing the Taylor degree can also improve the bound, but the numerical value of \(M\), the bound on the next derivative, must be valid over the entire interval. A bound based only on derivative values at panel centers is not enough.

Worked Example: A Higher-Degree Approximation

Worked Example: A Higher-Degree Approximation

Use degree-two midpoint Taylor polynomials on two equal panels to approximate \(\int_0^1x^4\,dx\). Each panel has width \(h=1/2\). Writing \(t=x-c\), the expansion is \(x^4=c^4+4c^3t+6c^2t^2+4ct^3+t^4\). The degree-two polynomial keeps the first three terms. On a symmetric panel, the terms in \(t\) and \(t^3\) have zero integral; the omitted \(t^4\) term contributes \(h^5/80\) to the exact integral minus the polynomial integral.

For the first midpoint \(c=1/4\), the polynomial integral is \(hc^4+c^2h^3/2=1/512+1/256=3/512\). For the second midpoint \(c=3/4\), it is \(hc^4+c^2h^3/2=81/512+18/512=99/512\). Hence

$$ Q=\frac{3}{512}+\frac{99}{512}=\frac{51}{256}. $$

The exact integral is \(\int_0^1x^4\,dx=1/5\). Therefore the actual error is \(1/5-51/256=1/1280\). This agrees with the omitted terms: each panel contributes \(h^5/80=1/2560\), so both contribute \(1/1280\). For a theorem bound, \(m=2\) and \(\max_{[0,1]}|f'''(x)|=\max 24x=24\). The midpoint bound is

$$ \frac{24(1)(1/2)^3}{2^3\,5!} =\frac{1}{320}. $$

The actual error \(1/1280\) is below this bound. The approximation, exact integral, omitted-term calculation, and derivative-based bound are consistent.

A Common Error-Accumulation Mistake

A frequent mistake is to calculate an error bound for one panel and report it as the bound for the whole interval. For the degree-one midpoint approximation of \(x^2\) with \(h=1/2\), the bound on one panel is

$$ \frac{M h^3}{2^2\,3!} =\frac{2(1/2)^3}{24} =\frac{1}{96}. $$

It would be wrong to claim that \(1/96\) bounds the error across both panels: the actual total error is \(1/48\). The correction is to sum the two panel bounds, giving \(1/96+1/96=1/48\). More generally, apply the single-panel estimate to each panel and add the results. Cancellation may make the actual total error smaller, but it cannot be assumed when establishing a guaranteed bound.

When the Method Is Useful

Composite Taylor integration is useful when a function can be approximated accurately in short neighborhoods, while a single approximation over the full interval would be less reliable. It also makes the error mechanism explicit: a derivative bound controls the local Taylor remainder, and the panel widths control how those remainders contribute to the integral.

The hypotheses are essential. The derivative bound must hold throughout every panel, not just at the chosen centers, and the function must have the required continuous derivatives on the interval. If such a bound is unavailable, the displayed estimates do not certify the error. Also, a small computed approximation is not itself evidence of a small error; the guarantee comes from the remainder estimate and its accumulation across all panels.

Check Your Understanding

Use the definitions and bounds above to answer these questions.

  1. For a midpoint-centered Taylor polynomial of degree \(m\), what power of the panel width appears in the single-panel error bound?
  2. With equal panels and fixed degree \(m\), how does the midpoint error bound depend on the number \(N\) of panels?
  3. Why must the panel error bounds be added to obtain a guaranteed bound for the total error?
  4. For \(f(x)=x^2\) on \([0,1]\), what derivative bound \(M\) is used in a degree-one Taylor error estimate?
  5. What condition on the derivative bound is needed before applying the composite estimate?