$\DeclareMathOperator{\asin}{asin}$ $\DeclareMathOperator{\acos}{acos}$ $\DeclareMathOperator{\atan}{atan}$
< Previous Section Home Next Section >


Section 10.1

New Perspectives on Approximating Accumulation
Functions from Rate of Change Functions

Refresher: Approximating Exact Accumulation Functions

Assume first-order rate of change of accumulation (1st derivative) is essentially constant over small intervals

In Chapter 5 we employed the power of digital technologies to develop a method for approximating the net accumulation from a reference point of a quantity whose exact values we assumed could be represented by a yet-to-be-known function f in relation to moments of its independent variable x. The method, in outline, was this:

Figure 10.1.1, repeated from Chapter 5, illustrates this process.


Figure 10.1.1. Visual summary of defining an exact net accumulation function from an exact rate of change function.

The function $A$ that we defined in Chapter 5 was this.

Start with a reference value $x=a$, a standard interval length $\Delta x$, and a function $r_f$, defined in closed form, whose values give the exact rate of change of the exact accumulation function $f$ at each moment in its domain. Values of the function $A$, defined below, give the approximate accumulation in $f$ from $a$ to $x$. (See Section 4.7 for a refresher on summation notation.)

$$\begin{align}
\color{red}{\text{(Eq. 10.1.1)}}\qquad A(x)&=\left(\sum_{k=1}^\left\lfloor \frac {x-a}{\Delta x}\right\rfloor r\left(a+(k-1)\Delta x\right)\Delta x\right)+r(x)(x-\mathrm{left}(x)) \text{, where}\\[1ex]
\mathrm{left}(x)&=a+\Delta x \left\lfloor\frac{x-a}{\Delta x}\right\rfloor\\[1ex]
r(x)&=r_f(\mathrm{left}(x))
\end{align}$$

Reflection 10.1.1. Where is dx in the definition of A in Eq. 10.1.1?

The definition of $\mathrm{left}(x)$ assigns the left end of the $\Delta x$-interval containing the value of $x$ to each value of $x$ in that interval (see the discussion of Figures 5.1.3 - 5.1.5). The definition of $r$ makes $r(x)$ have the constant value $r_f(\mathrm{left}(x))$ for every value of $x$ in any $\Delta x$-interval.


In defining $A$, we could just as well have used the value of $r_f$ at the midpoint of each $\Delta x$-interval as the constant rate of change over each $\Delta x$-interval, or the value of $r_f$ at the right end of each $\Delta x$-interval. Here is the definition of $r$ using the value of $r_f$ at the midpoint of each $\Delta x$-interval.
$$\begin{align}
\color{red}{\text{(Eq. 10.1.2)}}\qquad \mathrm{left}(x)&=a+\Delta x\left\lfloor \frac{x-a}{\Delta x}\right\rfloor\\[1ex]
\mathrm{mid}(x)&=\mathrm{left}(x)+\frac{\Delta x}{2}\\[1ex]
r(x)&=r_f(\mathrm{mid}(x))
\end{align}$$

Examine Figures 10.1.2, 10.1.3, and 10.1.4. The definition of $r_f$ in each figure is $$r_f(x)=1.6\sin(x-2)+0.5-0.009(x-8)^2.$$
Each figure shows the graph of $y=r_f(x)$ and $y=r(x)$, with $a=-3$ and $\Delta x=0.6$, for one of the three methods of defining a constant function that approximates $r_f$. The right panes show graphs of $y=A(x)$ according to each approximation of $r_f$.


Figure 10.1.2. We approximate $r_f(x)$ over intervals $0\lt dx \le \Delta x$ with a function that is constant over each $\Delta x$-interval. The value of the constant function for each value of x in any $\Delta x$-interval is the value of $r_f$ at the left end of the interval.

Reflection 10.1.2. Where is $\Delta x$ in Figure 10.1.2? Where is dx in Figure 10.1.2? What influence does the value of $\Delta x$ have on the graph of y=A(x)?


Figure 10.1.3. We approximate $r_f$ over intervals $0\lt dx \le \Delta x$ with a function that is constant over each $\Delta x$-interval. The value of the constant function for each value of x in any $\Delta x$-interval is the value of $r_f$ at the midpoint of the interval.

Reflection 10.1.3.Where is $\Delta x$ in Figure 10.1.3? Where is dx in Figure 10.1.3? Why is the graph of y=r(x) in Figure 10.1.3 different from the graph of y=r(x) in Figure 10.1.2?

Reflection 10.1.4. Modify the definition of A in Eq. 10.1.1 using the definition of r in Eq. 10.1.2. Graph y=A(x) with $a=-3$ and $\Delta x=0.6$.



Figure 10.1.4. We approximate $r_f(x)$ over intervals $0\lt dx \le \Delta x$ with a function that is constant over each $\Delta x$-interval. The value of the constant function for each value of x in any $\Delta x$-interval is the value of $r_f$ at the right end of the interval.

Reflection 10.1.5. Modify the definition of r so that you use the value of $r_f$ at the right end of each $\Delta x$-interval. Modify the definition of A accordingly and graph y=A(x) in GC using $a=-3$ and $\Delta x=0.6$.

Reflection 10.1.6. Redefine $r_f$ as $r_f(x)=x \sin\left(2\pi \sqrt{x+3}\right)$. What would you need to change in Equations 10.1.1 or 10.1.2? Why? What would you need to change in your responses to Reflections 10.1.4 and 10.1.5? Why?

Approximation Error

Up until now we trusted that we can make $\Delta x$ small enough so that making it smaller makes no appreciable difference in the accuracy of the approximate accumulation function. We did not, however, investigate how good an approximation is for a particular value of $\Delta x$ or for particular values of $x$. We shall do that now.

Our explorations of how well an approximation method works will follow this pattern:

There are several ways to judge how well an approximation method works for a particular rate of change function.

Absolute versus relative error

Whether to focus on absolute or relative error is a matter of judgment. If you are measuring an accumulation of microscopic particles, an approximation that has an absolute error of $3.7\times10^{-7}$ grams might seem very close to exact. If, however, a highly accurate measure is $5.1\times 10^{-8}$ grams, then your relative error is $$\frac{3.7\times10^{-7}}{5.1\times 10^{-8}}=7.255,$$ or over 720%.

On the other hand, if you are measuring the distance to a star, an approximation that has an absolute error of 2 billion kilometers might seem highly inaccurate. If, however, a highly accurate measure is 700.21 light years, then your relative error is $$\frac{2\times10^9}{700.21\times 9.461\times 10^{12}}=0.0000302,$$or about  3/1000 of 1%.

Judging Approximation Error by Inspection

We know (using integration by parts) that
$$\begin{align}
\int_0^x \left(t\sin(t)-1+0.1\cos(15t)\right)\,dt&=\left. -t+\sin(t)+\frac{2}{300}\sin(15t)-t\cos(t)\right|_{\,0}^{\,^x}\\[1ex]
&=-x+\sin(x)+\frac{2}{300}\sin(15x)-x\cos(x)
\end{align}$$

We can therefore compare our approximation methods against the exact accumulation function $f$ defined as $$f(x)=-x+\sin(x)+\frac{2}{300}\sin(15x)-x\cos(x).$$Please download this GC file to use in conjunction with the following discussion of Figures 10.1.5a through 10.1.5c.






Figure 10.1.5. Part (a) shows $r_f$ approximated by $r(\mathrm{left}(x))$ and the resulting graph of $y=A(x)$.
Part (b) shows $r_f$ approximated by $r(\mathrm{mid}(x))$ and the resulting graph of $y=A(x)$.
Part (c)
shows $r_f$ approximated by $r(\mathrm{right}(x))$ and the resulting graph of $y=A(x)$.

Part (a) of Figure 10.1.5 shows, with this particular function $r_f$, the definition of $r$ as $r(x)=r_f(\mathrm{left}(x))$ producing a constant rate of change that is a systematic under-approximation whenever $r_f$ increases over an interval and a systematic over-approximation when $r_f$ decreases over an interval.

Part (b) of Figure 10.1.5 shows the definition of $r$ as $r(x)=r_f(\mathrm{mid}(x))$ producing a constant rate of change that is an under-approximation for part of the interval and an over-approximation for the other when $r_f$ increases or decreases over the interval. The errors cancel each other to some extent.

Part (c) of Figure 10.1.5 shows the definition of $r$ as $r(x)=r_f(\mathrm{right}(x))$ producing a constant rate of change that is a systematic over-approximation whenever $r_f$ increases over an interval and a systematic under-approximation when $r_f$ decreases over an interval.

Reflection 10.1.7. In the GC file for Figure 10.1.5, compare the absolute and relative error over the interval defined by the slider named p by varying p's value. Are your observations of these errors consistent with the graphs in Figure 10.1.5?

Reflection 10.1.8. In the GC file for Figure 10.1.5, reduce the value of $\Delta x$. Compare the absolute and relative error both graphically and by varying p's value. Are your observations of these errors still consistent with the graphs in Figure 10.1.5?

Reflection 10.1.9. In the GC file for Figure 10.1.5, change the definition of $r_f$ to $r_f(x)=0.5\sqrt{x}e^{\cos(x)}$. Change the definition of f to $f(x)=\int_0^x 0.5\sqrt{t}e^{\cos(t)} dt$. Set $a=0$. Explore the absolute and relative error of the three methods of approximation.

Reflection 10.1.10. Sketch a graph of a function $r_g$ over a $\Delta x$-interval for which $r_g(\mathrm{left}(x))$ produces a better approximation of $r_g$ than does $r_g(\mathrm{mid}(x)))$. Explain what you mean by "better".

Reflection 10.1.11. Sketch a graph of a function $r_g$ over a $\Delta x$-interval for which $r_g(\mathrm{right}(x))$ produces a better approximation of $r_g$ than does $r_g(\mathrm{mid}(x)))$. Explain what you mean by "better".

Exercise Set 10.1.1

  1. This GC file gives an alternative perspective on absolute and relative error as discussed in Figure 10.1.5.
    1. Use the Method slider to compare absolute and relative errors of $A(x)$ for left, mid, and right methods of approximating $r_f$ over the displayed domain. Adjust the $\Delta x$-slider to see the effect of the value of $\Delta x$.
    2. Explain what the blue graph shows.
    3. Explain what the green graph shows.
    4. For which method does $A(x)$ systematically give best approximations for $f(x)$?
    5. Why does the value of relative error "spike" where it does regardless of the method you choose?
  2. While the midpoint method generally produces more accurate approximate accumulation functions than the left or right method, the left or right method will sometimes work better than the midpoint method in particular cases.
  3. Assume $\Delta x$=0.5 in (a) and (b).

    1. Sketch the graph of a rate of change function for which the left method will produce the most accurate approximate accumulation function. Explain your answer.
    2. Sketch the graph of a rate of change function for which the right method will produce the most accurate approximate accumulation function. Explain your answer.
  4. You can use a pendulum to measure an automobile's acceleration. It's angular displacement from vertical can be used to determine the auto's current forward or backward acceleration.

    The table below provides a record of an automobile's acceleraton taken at intervals of 0.5 seconds. The car was traveling at 30 ft/sec at time $t=0$.

  5. Time
    sec
    Accel
    (ft/sec)/sec
    Speed
    ft/sec
    0 0
    0.5 12.5
    1.0 14.65
    1.5 14.32
    2.0 13.40
    2.5 12.38
    3.0 11.42
    3.5 10.55
    4.0 9.79

    1. What must you assume about the car's acceleration during each $\Delta x$-interval to use left, mid, or right method to approximate changes in its velocity? Why?
    2. Use the left method to approximate the car's speed at the end of each 0.5-sec time interval?
    3. Use the right method to approximate the car's speed at the end of each 0.5-sec time interval?
    4. Use the mid-method to approximate the car's speed at the end of each 0.5-sec time interval? Save your results. You will reuse them in Exercise Set 10.1.2.)
    5. The car had a velocity at each moment after it began accelerating. So there is a function $v$ such that $v(t)$ is the car's velocity at each moment $t$. Which of the three methods do you trust to give the most accurate approximation to the car's actual velocity at $t=0.5,\, 1.0,\, 1.5\,\ ...$? Why?

Other approximation methods

Assume 2nd-order rate of change of accumulation (acceleration, 2nd derivative) is essentially constant over small intervals

Review Chapter 7, Section 7.2 if you are unfamiliar with notations for higher-order rate of change functions.

The three approximation methods discussed above were all based on the idea of assuming that the accumulation function has a rate of change that is essentially constant over sufficiently small $\Delta x$-intervals.

The differences among those approaches arose from our choice of the place within a $\Delta x$-interval at which we take a value of $r_f$ as the constant rate of change that approximates the values of $r_f$ over that interval.

We could make other assumptions that lead to different choices of our assumed constant rate of change over $\Delta x$-intervals. For example, instead of assuming that $f$ has rate of change that is essentially constant over a $\Delta x$-interval, we could assume that $f$ has an acceleration that is essentially constant over each $\Delta x$-interval.

This would be the same as assuming that $r_f$ changes essentially linearly over each $\Delta x$-interval.

Instead of approximating exact net accumulation by assuming that accumulation happens at a rate that is essentially constant over each $\Delta x$-interval, we can approximate exact net accumulation by assuming that accumulation happens with acceleration that is essentially constant over each $\Delta x$-interval.

Figure 10.1.6 shows what it looks like to assume that net accumulation changes with a constant acceleration over each $\Delta x$-interval. Notice that by assuming that net accumulation changes with a constant acceleration, we are thereby assuming that the accumulation's rate of change function $r_f$ is changing linearly (i.e., changes at a constant rate of change).


Figure 10.1.6. Approximate net accumulation function changes with constant acceleration over $\Delta x$-intervals, which means that approximate rate of change function changes linearly (i.e., at a constant rate of change) over each $\Delta x$-interval.

Our assumption that accumulation has an acceleration that is essentially constant over small $\Delta x$-intervals means that we are also assuming that $r_f$ is essentially linear (has a rate of change that is essentially constant) over each $\Delta x$-interval. This implies that over any interval $[a,b]$, $r(x)$, $r_f$'s approximate rate of change function, has the form $r(x)=A(x-a)+B$ over $[a,b]$, where $A=\dfrac{r_f(b)-r_f(a)}{b-a}$ and $B=r_f(a)$.

Reflection 10.1.12. Why is $A=\dfrac{r_f(b)-r_f(a)}{b-a}$ and $B=r_f(a)$ when we say that $r(x)=A(x-a)+B$ over the interval $[a,b]$?

The approximate accumulation function evaluated over an interval $a\le x\le b$ therefore has the value

$$\begin{align}
\color{red}{\text{(Eq. 10.1.3)}}\qquad \int_a^b r(x)dx &= \int_a^b \left( A(x-a)+B)\right) dx \\[1ex]
&=A\int_a^b (x-a)dx + B\int_a^b dx\\[1ex]
&= \left. A\left(\frac{x^2}{2}-ax\right)\right|_a^b+\left. Bx\right|_a^b\\[1ex]
&= A\left(\left(\frac{b^2}{2}-ab\right)-\left(\frac{a^2}{2}-a^2\right)\right)+B(b-a)\\[1ex]
&=\frac{1}{2}A\left(b^2-2ab+a^2\right)+B(b-a)\\[1ex]
&=\frac{1}{2}A(b-a)^2+B(b-a)\\[1ex]
&=\frac{1}{2}\left(A(b-a)+2B\right)(b-a)\\[1ex]
&=\frac{1}{2}\left(\frac{r_f(b)-r_f(a)}{b-a}(b-a)+2r_f(a)\right)(b-a)\\[1ex]
&=\frac{1}{2}\left(r_f(b)+r_f(a)\right)(b-a)
\end{align}$$

Here is what we accomplished in Equation 10.1.3: Given an exact rate of change function $r_f$, we can approximate net accumulation in $f$ over a complete $\Delta x$-interval by computing
$$\int_a^br_f(x)dx\approx\frac{r_f(a)+r_f(b)}{2}\Delta x$$
where $a$ and $b$ are the left and right ends, respectively, of the $\Delta x$-interval.

We can compute the approximate rate function for $r_f$ over a partial $\Delta x$-interval from $\mathrm{left}(x)$ to $x$ by computing $r_\text{cacc}(x)$ as
$$r_\text{cacc}(x)=\frac{r_f(\mathrm{left}(x))+r_f(x)}{2}$$where "cacc" is short for "constant acceleration", the assumption we made about how the approximate accumulation function changes. We can then compute the net accumulation in the current $\Delta x$-interval by $$r_\text{cacc}(x)\left(x-\mathrm{left}(x)\right)$$

In short, we can approximate exact net accumulation in $f$ from $a$ to $x$ by computing accumulation over the completed $\Delta x$-intervals included between $a$ and $x$, plus accumulation over the current, partial $\Delta x$-interval (see Equation 10.1.4).$$\color{red}{\text{(Eq. 10.1.4)}}\qquad
A_\text{cacc}(x)=\left(\sum_{k=1}^\left\lfloor \frac {x-a}{\Delta x}\right\rfloor \left(\frac{r_f(a+(k-1)\Delta x)+r_f(a+k\Delta x)}{2}\right)\Delta x\right)+r_\text{cacc}(x)(x-\mathrm{left}(x))$$

Figure 10.1.9 shows linear approximation of $r_f$ and the resulting approximation of $f$ by $A_\text{cacc}$ (assuming constant acceleration) with $\Delta x=0.6$. Figure 10.1.10 shows linear approximation of $r_f$ and the resulting approximation of $f$ by $A_\text{cacc}$ (assuming constant acceleration) with $\Delta x=0.2$.


Figure 10.1.9. The graph of $y=A_\text{cacc}(x)$ with $\Delta x$=0.6, where $A_\text{cacc}$ is the approximate net accumulation function for f gotten by using $r_\mathrm{cacc}(x)$ as the approximate rate of change of f with respect to x for every value of x in a $\Delta x$-interval.

Reflection 10.1.13. Explain why the graph of $y=A_\text{cacc}(x)$ must be the graph of a quadratic function over every $\Delta x$-interval.


Figure 10.1.10. The graph of $y=A_\text{cacc}(x)$ with $\Delta x$=0.2, where $A_\text{cacc}$ is the approximate net accumulation function for f gotten by using $r_\mathrm{cacc}(x)$ as the approximate rate of change of f with respect to x over each $\Delta x$-interval.

Reflection 10.1.14. Use GC to compare two methods of approximating exact accumulation, one using $A_\text{mid}(x)$ (assuming constant rate of change over intervals using mid-method) and one using using $A_\text{cacc}(x)$ (assuming accumulation with constant acceleration over intervals).

• Use subscripts to differentiate between your two accumulation functions and your two approximate rate of change functions. 

• Refer to Equations 10.1.1, 10.1.2, and 10.1.4 for reminders.

• Compare the accuracy of your new definitions graphically and numerically, using $r_f$ and f as shown below.$$\begin{align}r_f(x)&=\dfrac{e^{\cos x}}{1+e^{-x}}\\[1ex]f(x)&=\int_0^xr_f(t)dt\end{align}$$
• Write a summary of your observations.


Quantifying Approximation Error

Remind yourself of the definitions of absolute and relative approximation errors. Given a reference value of $x=a$, an exact rate of change function $r_f$ for an exact net accumulation function f, and a value of $A(a,x)$ that approximates $f(a,x)$, the exact net accumulation from $a$ to $x$, then:

$$\begin{align}
\text{Absolute approximation error}&= \left|f(a,x)-A(a,x)\right|\\[3ex]
\text{Relative approximation error}&=\left|\frac{f(a,x)-A(a,x)}{f(a,x)}\right|\qquad f(a,x)\neq 0
\end{align}$$

In your investigations, you probably noticed that the midpoint method produced approximations to values of an exact accumulation function that were at least as accurate as the left, right, and constant acceleration methods, and often produced approximations that were noticeably better than the others.

The error in an approximation of an accumulation function's value is due not only to the method we use. It is also influenced by the size of $\Delta x$ in conjunction with the behavior of the accumulation function's rate of change function.

For example, the left side of Figure 10.1.11 shows (on the left) graphs of $y=r_f(x)$, $\color{red}{y=r_\mathrm{mid}(x)}$, and $\color{blue}{y=r_\mathrm{cacc}(x)}$ and (on the right) their respective accumulation functions as the value of $\Delta x$ goes from $\Delta x=1$ to $\Delta x=0.02$.

We recommend that you watch the animation in Figure 10.1.11 several times, focusing first on the left pane, then on the right pane in relation to the left pane. Move your cursor away from the animation to make its scroll bar disappear.


Figure 10.1.11. Graphs of $y=r_f(x)$, $y=r_{mid}(x)$, and $y=r_{cacc}(x)$ and their respective accumulation functions as the value of $\Delta x$ goes from $\Delta x=1$ to $\Delta x=0.02$.

Reflection 10.1.15.

  1. Examine the left side of Figure 10.1.11 until you see:
  2. Examine the right side of Figure 10.1.15 until you see:

There is a lot to see in Figure 10.1.11. Drag the scroll bar to appropriate places in the animation as we focus on different aspects of what the animation illustrates.

Regarding approximations of $r_f(x)$:

Regarding approximations of $f(x)$:

Another way to look at these same observations is by building a table of values of $A_\mathrm{mid}(a, x)$ and $A_\mathrm{cacc}(a, x)$ for particular values of x and diminishing values of $\Delta x$.

The table in Figure 10.1.12 uses definitions of $A_\mathrm{mid}$ and $A_\mathrm{cacc}$ that are modified to accept the accumulation's reference value and the value of $\Delta x$ as arguments. We did this so that we could hold the accumulation's reference value and end value constant while varying the value of $\Delta x$.

The GC file that produced Figure 10.1.12 is at this link.


Figure 10.1.12. Values of $A_\mathrm{mid}(c.x,\Delta x)$ and $A_\mathrm{cacc}(c,x,\Delta x)$ for
initial value of $c=-1$, $x=b$, and various values of $\Delta x$.

You should inspect Figure 10.1.12 closely. Approximations of $f(-1,15)$ become better with smaller values of $\Delta x$. But there are two more things to see:

It is important to understand that a bound on absolute error is not the same as actual absolute error. An error bound says that the absolute approximate error cannot be any more than a certain value. It does not say what the actual error is.

Reflection 10.1.16. The error bounds for both $A_\mathrm{mid}(a,x,\Delta x)$ and $A_\mathrm{cacc}(a,x,\Delta x)$ contain the term $$\left({\mathrm{max}\atop{a≤t≤x}} \left|\dfrac{d^2}{dt^2}r_f(t)\right|\right).$$Try to explain two things: (1) How this term means, "the largest value of the second derivative of $r_f(t)$ over the interval $a \le t \le x$", and (2) why the second derivative of $r_f$ matters in determining maximum absolute error.

Reflection 10.1.17. Use techniques from Chapter, 7, Section 3 (Optimization) to compute $\left({\mathrm{max}\atop{a≤t≤x}} \left|\dfrac{d^2}{dt^2}r_f(t)\right|\right)$ for $r_f$ as defined in Figure 10.1.12. Use this value to compute the maximum relative error of $A_\mathrm{mid}(-1,15,0.25)$ as an approximation of $f(-1,15)$, where $f(a,x)$ is defined as in Figure 10.1.12. Compare your maximum relative error with the appropriate entry in Figure 10.1.12.

Reflection 10.1.18. Is the maximum relative error that you computed in Reflection 10.1.15 for $A_\mathrm{mid}(-1,15,\Delta x)$ valid for all values of x from -1 to 15, or only for $x=15$? Explain.

Exercise Set 10.1.2

  1. The table below is from Exercise 10.1.3. Approximate the car's velocity at the end of each time interval by computing $A_\text{cacc}(t)$ (see Equation 10.1.4) for each value of $t$ in the table. (Do not confuse the car's acceleration with the assumption that the car's velocity changes with an essentially constant acceleration.)
  2. Time
    sec
    Accel
    (ft/sec)/sec
    Speed
    ft/sec
    0 0
    0.5 12.5
    1.0 14.65
    1.5 14.32
    2.0 13.40
    2.5 12.38
    3.0 11.42
    3.5 10.55
    4.0 9.79

  3. The function $g$ defined as $g(x)=e^{\sin(x)}\left(\cos^2(x)-\sin(x)\right)$ has the function G as an antiderivative, where $G(x)=\cos(x)e^{\sin(x)}$.

Assume that 3rd-order rate of change of accumulation
(jerk, 3rd derivative) is essentially constant over small intervals

In the prior section we developed the method $A_\mathrm{cacc}$, which used the rate of change half way between $r_f$'s values at each end of any interval as the constant rate of change of approximate accumulation as $dx$ varies through the interval.

We developed the constant acceleration method by assuming that $f$, $r_f's$ exact accumulation function, has an acceleration (2nd-order rate of change) that is essentially constant over $\Delta x$-intervals.

This assumption produced a method that was better than either the left(x) or right(x) methods, but not as good as taking $r_f(\mathrm{mid}(x))$ as the constant rate of change of approximate accumulation over $\Delta x$-intervals.

Another method for approximating net accumulation from exact rate of change is to assume that $f$, the exact accumulation function for $r_f$, has a 3rd-order rate of change function (3rd derivative) that is essentially constant over each $\Delta x$-interval.

You would be right to ask, "What good does it do to assume that $f$ has a 3rd-order rate of change function that is essentially constant over sufficiently small $\Delta x$-intervals?" This assumption implies that $r_f^{(1)}$, f 's 2nd-order rate of change function, is essentially linear over each $\Delta x$-intervals and that $r_f$ is essentially quadratic over each $\Delta x$-interval. And we know how to compute exact accumulation of a quadratic rate of change function!

Reflection 10.1.19. Explain how assuming that an exact accumulation f has a 3rd-order rate of change that is essentially constant over $\Delta x$-intervals implies that its 1st-order rate of change function is essentially quadratic over the same $\Delta x$-intervals.

Put another way, a quadratic approximation to $r_f$ over an interval is more sensitive to how $r_f$ changes over that interval than is a linear approximation to $r_f$. A quadratic approximation to $r_f$ should therefore give us better approximations to the net change in accumulation over an interval than would linear approximations to $r_f$ over that interval.

Another advantage of using a quadratic function to approximate $r_f$ over an interval is that we can approximate exact accumulation over complete $\Delta x$-intervals by computing the exact accumulation of the quadratic rate of change function that approximates $r_f$ over that $\Delta x$-interval.

Figure 10.1.13 illustrates the idea of approximating exact rate of change over an interval with a quadratic function over that same interval. The animations in Figure 10.1.13 use a sliding interval instead of a fixed interval to illustrate this approximation technique. This is only to show that the technique works for any arbitrary interval. Move your cursor away from an animation to make its scroll bar disappear.




(a) Quadratic approximation to $r_f$ over intervals of length 2.0.
(b) Quadratic approximation to $r_f$ over intervals of length 1.0. (c) Quadratic approximation to $r_f$ over intervals of length 0.5.

Figure10.1.13. Three approximations to an exact rate of change function by a quadratic function over an interval of length $\Delta x$, with $\Delta x=2.0$, $\Delta x=1.0$, and $\Delta x=0.5$. The intervals slide along the x-axis to illustrate quadratic approximation over any interval.




(a) Left. Graph of $\color{red}{y=r_\mathrm{quad}(x)}$, the quadratic approximation to $y=r_f(x)$ over intervals of length $\Delta x=1.0$. Heavy gray lines show left and right ends of successive $\Delta x$-intervals. Light gray lines show middles of $\Delta x$-intervals. Graph of $\color{red}{y=r_\mathrm{quad}(x)}$ passes through graph of $y=r_f(x)$ at left end, middle, and right end of each $\Delta x$-interval. Right. The graph, $\color{green}{\text{in green}}$, of the exact accumulation function from $r_f$ along with the graph of $\color{red}{A_\mathrm{quad}}$, the approximate accumulation function.
(b) Left. Graph of $\color{red}{y=r_\mathrm{quad}(x)}$, the quadratic approximation to $y=r_f(x)$ over intervals of length $\Delta x=0.4$. Heavy gray lines show left and right ends of successive $\Delta x$-intervals. Light gray lines show middles of $\Delta x$-intervals. Graph of $\color{red}{y=r_\mathrm{quad}(x)}$ passes through graph of $y=r_f(x)$ at left end, middle, and right end of each $\Delta x$-interval. Right. The graph, $\color{green}{\text{in green}}$, of the exact accumulation function from $r_f$ along with the graph of $\color{red}{A_\mathrm{quad}}$, the approximate accumulation function.

Figure10.1.14. (a) Quadratic approximation to $r_f$ with $\Delta x=1.0$. (b) Quadratic approximation to $r_f$ with $\Delta x=0.4.

Approximate Accumulation from Quadratic Approximation to Exact Rate of Change

One thing has remained common among all the methods we examined for approximating values of the exact accumulation function f from its exact rate of change $r_f$. It is that we approximate $r_f$ with a function for which we know how to calculate accumulation over an interval from rate of change over that interval.

Our first three methods (left, mid, and right) assumed a constant rate of change over $\Delta x$-intervals, which made it easy to calculate approximate accumulation over every $\Delta x$-interval. The constant acceleration method (linear approximation of $r_f$) relied on the fact that we can represent the integral of a linear function over an interval in closed form.

The situation with quadratic approximations to $r_f$ over $\Delta x$-intervals is like the constant acceleration method. We will calculate approximate accumulation over an interval from an approximate rate of change function that is quadratic over that interval.

Let $r_f$ be the exact rate of change function for an exact accumulation function $f$. Let $[a,b]$ be any interval in the domain of $r_f$. The quadratic approximation to $r_f$ over this interval must be such that $r(a)=r_f(a)$, $r\left(\frac{a+b}{2}\right)=r_f\left(\frac{a+b}{2}\right)$, and $r(b)=r_f(b)$. In other words, the graph of the approximate rate function $r$ must pass through the graph of $r_f$ at the left, middle, and end values of $[a,b]$. Then,

$$\begin{align}
r(x)&=Ax^2+Bx+C\text{, therefore}\\[1ex]
\int_a^b r(x)dx&=\int_a^b\left(Ax^2+Bx+c\right)dx\\[1ex]
\end{align}$$

However, we seem to have a stumbling block: We do not know the values of A, B, and C. But we do know three points that the quadratic must pass through. It turns out that we can use this information to produce a way to compute the value of $\int_a^b\left(Ax^2+Bx+c\right)dx$ without needing the values of A, B, and C.

Suppose that $r_f$ is an exact rate of change function for $f$ defined over an interval $[a.b]$. Suppose further that $r$ is a quadratic function that agrees with $r_f$ at the left end, middle, and right end of $[a,b]$. This means that  $r(x)=Ax^2+Bx+C$ such that

$$r(a)=r_f(a)\qquad r\left(\frac{a+b}{2}\right)=r_f\left(\frac{a+b}{2}\right) \qquad r(b)=r_f(b).$$

Then,

$$\begin{align}
\int_a^b r(x)dx&=\int_a^b\left(Ax^2+Bx+c\right)dx\\[1ex]
&=A\int_a^b x^2dx+ B\int_a^b x dx+C\int_a^b 1 dx\\[1ex]
&=A\frac{b^3-a^3}{3}+B\frac{b^2-a^2}{2}+C(b-a)\\[1ex]
&=A\frac{(b-a)(a^2+ab+b^2)}{3}+B\frac{(b-a)(b+a)}{2}+C(b-a)\\[1ex]
&=(b-a)\left(A\frac{a^2+ab+b^2}{3}+B\frac{b+a}{2}+C\right)\\[1ex]
&=\text{(... a bunch more algebra ...)}\\[1ex]
&=\frac{b-a}{3}\left(\frac{Aa^2+Ba+C}{2}+
       2\left(A\left(\frac{b+a}{2}\right)^2+B\left(\frac{b+a}{2}\right)+C\right)+
       \frac{Ab^2+Bb+C}{2}\right)\\[1ex]
&=\frac{b-a}{3}\left( \frac{r(a)}{2}+2r\left( \frac{b+a}{2}\right)+\frac{r(b)}{2}\right)\\[1ex]
&=\frac{b-a}{3}\left( \frac{r_f(a)}{2}+2r_f\left( \frac{b+a}{2}\right)+\frac{r_f(b)}{2}\right)\\[1ex]
\int_a^b r(x)dx&=\frac{b-a}{3}\left( \frac{r_f(a)}{2}+2r_f\left( \frac{b+a}{2}\right)+\frac{r_f(b)}{2}\right)\end{align}$$

That is, we end up evaluating $\int_a^br(x)dx$ without having to know the coefficients A, B, and C in $r(x)=Ax^2+Bx+C$.

We may now define a function $s$ that uses a quadratic approximation to $r_f$ to approximate the exact accumulation in $f$ over an interval $[c,d]$:

$$s(c,d)=\frac{d-c}{3}\left( \frac{r_f(c)}{2}+2r_f\left( \frac{d+c}{2}\right)+\frac{r_f(d)}{2}\right)$$

and use the definition of $s$ to approximate the net accumulation over an interval $[a,x]$ that contains $\left\lfloor\frac{x-a}{\Delta x}\right\rfloor$ complete intervals of length $\Delta x$.

$$\color{red}{\text{(Eq. 10.1.5)}}\qquad \begin{align}
\mathrm{left}((a,x,\Delta x)&=a+\Delta x\left\lfloor\frac{x-a}{\Delta x}\right\rfloor\\[1ex]
s(c,d)&=\frac{d-c}{3}\left( \frac{r_f(c)}{2}+2r_f\left( \frac{d+c}{2}\right)+\frac{r_f(d)}{2}\right)\\[1ex]
A_\mathrm{quad}(a,x,\Delta x)&=\left( \sum\limits_{k=0}^{\left\lfloor \frac{x-a}{\Delta x} \right\rfloor} s(a+(k-1)\Delta x,a+k\Delta x)\right)+s(\mathrm{left}(a,x,\Delta x),x)
\end{align}$$

The definitions of left, $s$, and $A_\mathrm{quad}$ given in Equation 10.1.5, entered into GC, produced the animations in Figure 10.1.14.

Error Bound on Quadratic Approximation of Accumulation Function

The error bound on the quadratic approximation method is much tighter than for the mid-point method, which you probably inferred from the animations in Figure 10.1.14. The error bound for the quadratic method is:

$$\left|\int_a^xr_f(t)dt-A_\mathrm{quad}(a,x,\Delta x)\right|\le \left(\left(\frac{x-a}{180}\right) \left({\mathrm{max}\atop{a≤t≤x}} \left|\dfrac{d^4}{dt^4}r_f(t)\right|\right)\right)(\Delta x)^4$$

Compare the quadratic error bound with the error bound for the midpoint method:

$$\left|\int_a^xr_f(t)dt-A_\mathrm{mid}(a,x,\Delta x)\right|\le \left(\left(\frac{x-a}{24}\right) \left({\mathrm{max}\atop{a≤t≤x}} \left|\dfrac{d^2}{dt^2}r_f(t)\right|\right)\right)(\Delta x)^2$$
Since the values of $$\dfrac{\displaystyle{{\mathrm{max}\atop{a≤t≤x}}} \left|\dfrac{d^2}{dt^2}r_f(t)\right|}{24}$$

and

$$\dfrac{\displaystyle{{\mathrm{max}\atop{a≤t≤x}}} \left|\dfrac{d^4}{dt^4}r_f(t)\right|}{180}$$

are constant for a given value of $x$, the comparison in accuracy of the midpoint and quadratic methods depends essentially on values of $\Delta x^2$ and $\Delta x^4$.

When $\Delta x=0.1$, $\Delta x^2=0.01$ and $\Delta x^4=0.0001$. When $\Delta x=0.01$, $\Delta x^2=0.0001$ and $\Delta x^4=0.00000001$. The error bound for the quadratic method becomes smaller at a much faster rate than the error bound for the midpoint method as $\Delta x$ decreases in value. This means that, in principle, we will get more accurate approximations from the quadratic method for small values of $\Delta x$ than we will with the midpoint method.

Reflection 10.1.20. Suppose that $r_f$ is a cubic polynomial. What is the error bound for quadratic approximation of $r_f$'s accumulation function over any interval $[a,x]$?

Figure 10.1.15 shows comparisons between $A_\mathrm{mid}$ and $A_\mathrm{quad}$, with $\Delta x=1.0$ on the left and $\Delta x=0.5$ on the right. It illustrates that $A_\mathrm{quad}$ converges to the exact accumulation function faster than does $A_\mathrm{mid}$.

Figure 10.1.15. Comparisons of approximate accumulation functions generated by the midpoint and quadratic approximations to $r_f$.

Figure 10.1.16 shows that both approximation methods appear to produce approximate accumulation functions that coincide with the exact accumulation function with relatively small values of $\Delta x$, such as $\Delta x=0.02$.

The blowup of one small section of the graph shows that the approximate accumulation function given by the midpoint method deviates by a relatively large amount from exact accumulation in comparison to the quadratic approximation method.

Even at the zoom level of Figure 10.1.16 the quadratic approximate accumulation function is indistinguishable from the exact accumulation function.



Figure 10.1.16. Comparing the midpoint and quadratic approximation methods over the interval $[1.567,1.574]$. The graph of the quadratic approximation function is indistinguishable from the graph of the exact accumulation function while the graph of the midpoint approximation function departs considerably in comparison.

Exercise Set 10.1.3

  1. The table shows a car's acceleration recorded at half-second intervals. Approximate the car's velocity at the end of appropriate time intervals by computing values of $A_\text{quad}.$ (See Equation 10.1.5) for appropriate values of $t$ in the table. Remember that $A_\text{cacc}$ requires 3 values of $r_f$!.
  2. Time
    sec
    0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0
    Accel
    (ft/sec)/sec
    0.0 17.99 21.08 20.62 19.29 17.81 16.44 15.19 14.09 13.12 12.26 11.50 10.83 10.22 9.68
    Speed
    ft/sec
















  3. Let $r_f$ be defined as $r_f(x)=\cos(x)+0.3\sin(10x)$.

    $r_f(x)=\cos(x)+0.3\sin(10x)\qquad F(x)=\sin(x)-\dfrac{3}{100}\cos(10x)\qquad f(a,x)=F(x)-F(a)$
    $$\Delta x$$ $$A_\mathrm{mid}(2,5,\Delta x)$$ $$A_\mathrm{quad}(2,5,\Delta x)$$ $$\left|\dfrac{f(2,5)-A_\mathrm{mid}(2,5,\Delta x)}{f(2,5)}\right|$$ $$\left|\dfrac{f(2,5)-A_\mathrm{quad}(2,5,\Delta x)}{f(2,5)}\right|$$
    1.0



    0.5



    0.25



    0.125



    0.0625



    0.03125



    0.0150625



    0.0078125



Convergence

Until now we compared values of approximate accumulation functions $A(x)$ for an exact accumulation function $f$ that can be defined in closed form. This allowed us to compare our approximations at specific values of x with values of $f(x)$ that we could compute directly from $f's$ closed form definition. We then inspected the accuracy of various approximation methods by comparing them to the exact accumulation function. We determined that the quadratic approximation method is better by far than any of the other methods we inspected.

Unfortunately, the vast majority of accumulation functions that you will meet in applied settings cannot be represented in closed form. A seemingly simple case is $r_f(x)=\sin(3\cos(5x))$. Here is what Wolfram Alpha Pro reports when asked for an antiderivative of $\sin(3\cos(5x))$.


Figure 10.1.17. The result of Wolfram Alpha Pro's attempt to determine an antiderivative of sin(3cos(5x)). It could not determine one.

In the case of $r_f(x)=\sin(3\cos(5x))$, we cannot calculate exact accumulation values against which to compare our approximate accumulation values. With what values, then, do we compare our approximations? The answer is, "with each other".

Figure 10.1.18 gives two columns of numbers. The first column contains values of $\Delta x$. The second column contains values (to 12 significant digits) of $A_\mathrm{quad}(1, 3, \Delta x)$, where $A_\mathrm{quad}(1,3,\Delta x)$ is defined in terms of $r_f(x)=\sin(3\cos(5x)$.


Figure 10.1.18. Table of values for $A_\mathrm{quad}(1,3,\Delta x)$ with $r_f(x)=\sin(3\cos(5x))$ and varying values of $\Delta x$.

Reading Figure 10.1.18 from the top, we see that values of $A_\mathrm{quad}(1,3,\Delta x)$ agree with each other in more decimal places as values of $\Delta x$ become smaller. This is true until $\Delta x$ has a value of 0.001. After that, we see no change. In other words, making $\Delta x$ smaller than 0.001 makes no discernible difference in our approximations of $\int_1^3 r_f(x)dx$. The exact value for $\int_1^3 r_f(x)dx$ seems to be 0.2091763371 to 12 significant digits. It might have more digits, but we don't know them.

It is in this sense that we say that as $\Delta x$ becomes arbitrarily small, values of $A_\mathrm{quad}(1,3,\Delta x)$ converge to an exact value, which we do not know, but which, in principle, we can state with any degree of accuracy we desire. We will delve further into the idea of convergence in Section 10.2.

Indeed, using the error bounds for quadratic approximation with $\Delta x=0.001$, and the knowledge that $$\dfrac{\displaystyle{{\mathrm{max}\atop{a≤t≤x}}} \left|\dfrac{d^4}{dt^4}r_f(t)\right|}{180}\approx 176250$$we can say that for $1\le x \le 3$,
$$\left| \int_1^xr_f(t)dt-A_\mathrm{quad}(1,x,0.001)\right| \le \frac{x-1}{180}\cdot 176250\cdot (0.001)^4\le \frac{3-1}{180}\cdot 176250\cdot (0.001)^4 \approx 0.00000000009792.$$

Remember that the bound given above is an upper bound on approximate accumulation error for any rate of change function that has a fourth derivative that does not exceed 176250 over the interval $[1,3]$, so it is a conservative bound. Our list of approximations in Figure 10.1.18 suggests that our approximation  $\int_1^3(\sin(3\cos(5x))dx\approx 0.209176673371$ is well within that bound.

Summary