###
Subsection 5.2.1 Rate of Change

Suppose that we have two variables that are related by a function. In mathematics, we often think of the prototypical variables \(x\) and \(y\) with some function \(f : x \mapsto y\text{.}\) But in physical situations, we are often considering changes in time so that we use the independent variable \(t\) for time. The official definition for rate of change is as the derivative. In the present context, we will not need to know how to compute derivatives. We only need to consider that there is a function that physically measures a rate of change.

For example, a speedometer measures speed which is a rate of change of distance with respect to time. As another example, we can physically measure the rate at which water flows through a pipe which represents a rate of change of a reservoir (e.g., a tub or a pool) that is being filled or drained. An electrical analog of water flow is electrical current which measures the rate of change of electrical charge along an electrical path. In biology, the rate of change of a population is physically measured through birth, death and migration rates.

When any of these rates are constant over an interval \(t \in [a,b]\text{,}\) the net change in the quantity of interest \(Q\) is equals the rate times the increment of time. The following definition makes this clear.

######
Definition 5.2.1 Constant Rate of Change

Given a quantity \(Q\) that is a function of independent variable \(t\text{,}\) say \(t \mapsto Q(t)\text{,}\) we say that \(Q\) has a constant rate of change \(r\) on an interval \([a,b]\) if for any \(t_1,t_2\) satisfying \(a \le t_1 \lt t_2 \le b\text{,}\)

\begin{equation*}
Q(t_2) - Q(t_1) = r \cdot (t_2-t_1),
\end{equation*}

which is often written \(\Delta Q = r \cdot \Delta t\text{.}\)

A quantity that has a constant rate of change satisfies a linear equation on the given interval and the rate of change corresponds to the slope of that line. In particular, if \(c\) is any value for \(t\) in the interval, \(c \in [a,b]\text{,}\) then the accumulation \(Q(t)\) is a linear function of \(t\text{,}\)

\begin{equation*}
Q(t) = Q(c) + r(t-c),
\end{equation*}

using the point–slope equation of a line. The value \(Q(c)\) represents the initial value while \(r(t-c)\) represents the increment of change in \(Q\) when the independent variable goes from \(c\) to the value \(t\text{.}\)

In preparation for extending the idea of rate of change, we need to recall the concept of piecewise functions 4.4.3. A piecewise function considers its domain as consisting of a collection of disjoint (non-overlapping) intervals. On each such interval, the function has a separate formula or rule of calculation.

######
Example 5.2.2

The function \(f\) is defined by the equation

\begin{equation*}
f(x) = \begin{cases}
x^2, & 0 \le x \lt 2, \\
6-x, & 2 \le x \le 3 \\
3, & 3 \lt x \le 4
\end{cases}.
\end{equation*}

The domain of \(f\) is the union of disjoint intervals \([0,2)\text{,}\) \([2,3]\) and \((3,4]\) which corresponds to \([0,4]\text{.}\) The notation states that for input values \(x\) between 0 and 2, including 0, the function will square the input to give the output. Between 2 and 3, inclusively, the function will subtract the input from 6 for the output. For input values greater than 3 but less than or equal to 4, the function has a constant output value of 3. The graph is shown below.

Using piecewise functions, we can define something called a simple function. Such a function is piecewise constant, meaning that the domain is formed as a union of disjoint intervals and the function has a constant value on each interval. To define these intervals, we first introduce the idea of a partition which will be used to define the end points of these subintervals.

######
Definition 5.2.3 Partition

A partition of size \(n\) of an interval \([a,b]\) is an increasing, finite sequence of numbers \(P = (x_0, x_1, \ldots, x_n)\) such that \(x_0 = a\text{,}\) \(x_n=b\) and \(x_{j} \lt x_{j+1}\text{.}\) The increments of the partition correspond to the widths of subintervals, with

\begin{equation*}
\nabla x_{j} = x_{j} - x_{j-1}
\end{equation*}

being the width of the subinterval \([x_{j-1}, x_{j}]\) for \(j=1,\ldots,n\text{.}\)

######
Definition 5.2.4 Simple Function

Given a partition \(P\) of size \(n\) of an interval \([a,b]\text{,}\) a function \(f\) is a simple function on the partition \(P\) with values \((y_1,\ldots,y_n)\) if

\begin{equation*}
f(x) = \begin{cases}
y_1, & x_0 \lt x \lt x_1, \\
y_2, & x_1 \lt x \lt x_2, \\
\vdots \\
y_n, & x_{n-1} \lt x \lt x_n.
\end{cases}
\end{equation*}

The figure below illustrates a simple function defined with a partition of size \(n=4\text{.}\) Open circles are used on the edges of the segments because we did not define the value at the actual partition points, only on the intervals between those points. That is because when a rate changes instantaneously between two values, the rate can not be properly defined at the instant itself.

We can use a simple function to represent a special case of a varying rate of change, namely a rate of change that is constant on subintervals but which changes instantly (not physically possible in most situations) at the points of a partition. Given a simple rate function, \(r(x)\text{,}\) on a partition \(P\) of size \(n\) of the interval \([a,b]\) with values \((r_1,r_2,\ldots,r_n)\text{,}\) we can define an accumulation function that is piecewise linear on the same partition having initial value \((a,f(a))\text{:}\)

\begin{equation*}
f(x) = \begin{cases}
f(a) + r_1 (x-x_0), & x_0 \le x \lt x_1, \\
f(a) + r_1 \, \nabla x_1 + r_2(x-x_1), & x_1 \le x \lt x_2, \\
\displaystyle f(a) + \sum_{k=1}^{2} r_k \, \nabla x_k + r_3(x-x_2), & x_2 \le x \lt x_3, \\
\displaystyle f(a) + \sum_{k=1}^{3} r_k \, \nabla x_k + r_4(x-x_3), & x_3 \le x \lt x_4, \\
\vdots \\
\displaystyle f(a) + \sum_{k=1}^{n-1} r_k \, \nabla x_k + r_n(x-x_{n-1}), & x_{n-1} \le x \le x_n.
\end{cases}
\end{equation*}

The purpose of the summation is to represent the accumulation of change on all previous subintervals of the partition in order to make the accumulation function \(f(x)\) continuous on the full interval \([a,b]\text{.}\)

######
Definition 5.2.5 Definite Integral of Simple Function

Given a simple rate function, \(r(x)\text{,}\) on a partition \(P\) of size \(n\) of the interval \([a,b]\) with values \((r_1,r_2,\ldots,r_n)\text{,}\) the total accumulated change associated with this rate is the definite integral represented by is given by

\begin{equation*}
\int_a^b r(x) \, dx = \sum_{k=1}^{n} r_k \, \nabla x_k.
\end{equation*}

It is common that the increments \(\nabla x_k\) be instead written \(\Delta x_k\text{.}\) However, this is a notational abuse because \(\Delta x_k\) technically represents the forward difference \(\Delta x_k = x_{k+1}-x_k\) with \(k=0,\ldots,n-1\text{.}\) Ignoring this complaint, the total accumulation of change is often written

\begin{equation*}
f(b) - f(a) = \sum_{k=1}^{n} r_k \, \Delta x_k.
\end{equation*}

(The complaint can formally be resolved by shifting the index values from \(k=1,\ldots,n\) to \(k=0,\ldots,n-1\text{.}\))

######
Example 5.2.6

A storage reservoir starts with 100 gallons of water. Over the next 20 minutes, water is added to the reservoir at a rate of 5 gal/min. Then water is pumped out at a rate of 12 gal/min for 10 minutes. For the next 30 minutes, water is added at a rate of 3 gal/min. Find a piecewise linear function describing the amount of water in the reservoir as a function of time (in minutes).

Solution
The rate function is a simple function using the partition \(P\) that starts at \(x_0=0\) and has increments of \(\nabla x_1=20\text{,}\) \(\nabla x_2 = 10\) and \(\nabla x_3 = 30\text{.}\) That is, the partition is given by \(P=\{0, 20, 30, 60\}\text{.}\) The rate of change of water is constant on the subintervals defined by this partition:

\begin{equation*}
R(t) = \begin{cases}
5, & 0 \lt t \lt 20, \\
-12, & 20 \lt t \lt 30, \\
3, & 30 \lt t \lt 60.
\end{cases}
\end{equation*}

The amount of water in the reservoir is also a function of time, say \(W(t)\text{,}\) and is defined as an accumulation using the rate of change \(R(t)\) found above. Because the reservoir begins with \(W(0)=100\text{,}\) our initial value, we can write \(W(t)\) as a piecewise linear function that accumulates the change in water over each of the subintervals. Consider first the total accumulation of change in water on each of the subintervals, which is equal to the rate of change times the increment of time for that subinterval.

\begin{align*}
W(20)-W(0) &= 5 (20) = 100 \\
W(30)-W(20) &= -12(10) = -120 \\
W(60)-W(30) & = 3(30) = 90
\end{align*}

Notice that the total change in water volume over the entire interval \([0,60]\) is the sum of these increment,

\begin{equation*}
W(60) -W(0) = 100+-120+90 = 70.
\end{equation*}

The accumulation function \(W(t)\text{,}\) which has an initial value \(W(0)=100\text{,}\) is therefore defined by

\begin{equation*}
W(t) = \begin{cases}
100 + 5(t-0) = 100 + 5t, & 0 \le t \lt 20, \\
100 + 100 - 12(t-20)= 200 - 12(t-20), & 20 \le t \lt 30, \\
200 - 120 + 3(t-30) = 80 + 3(t-30), & 30 \le t \le 60.
\end{cases}
\end{equation*}

The graphs of the rate function \(R(t)\) and the water level \(W(t)\) are shown below. Notice that although the rate function is not defined at the partition points, the water level function \(W(t)\) is defined and continuous at those points. It is continuous because the accumulations are designed to start on the next interval exactly where it stops from the previous interval with no sudden jumps.

There is an important geometric interpretation of accumulation in terms of area on the graph. Recall that the area of a rectangle is defined as the product of the height and the width. Mathematically, this is the same operation as when we calculate an increment as the product of a rate and the increment of the independent variable, except that a rate can be negative. Consequently, we introduce the idea of signed area.

######
Definition 5.2.7 Signed Area (Informal)

Suppose we have the graph of a function \(y=f(x)\) that is continuous on an interval \((a,b)\) and is either entirely above the axis, \(f(x) \gt 0\) for all \(x \in (a,b)\text{,}\) or entirely below the axis, \(f(x) \lt 0\) for all \(x \in (a,b)\text{.}\) Then we can define the signed area of the graph by considering the area \(A\) (area itself is always positive) of the region between the curve \(y=f(x)\) and the axis \(y=0\) and between the vertical lines \(x=a\) and \(x=b\text{.}\) If \(f(x) \gt 0\) (above the axis), then we say that we have positive area \(A\text{;}\) if \(f(x) \lt 0\) (below the axis), then we say that we have negative area \(-A\text{.}\)

If the graph \(y=f(x)\) on an interval \((a,b)\) has a finite number of discontinuities or crosses the axis so that sometimes the graph is above the axis and sometimes below, then we can consider a partition of \([a,b]\) using the \(x\)-values of the discontinuities and zeros of \(f\text{.}\) Then on every subinterval from this partition, the earlier definition applies and we have a signed area for each subinterval. The signed area for the entire graph is the sum of the signed areas of the subintervals, adding areas that are above the axis and subtracting areas that are below the axis.

Given any simple rate function \(f(x)\text{,}\) the signed area of the graph \(y=f(x)\) on the interval \([a,b]\) consists of the sum of signed areas of rectangles. This exactly matches the definite integral

\begin{equation*}
\displaystyle \int_a^b f(x) \, dx = \sum_{k=1}^{n} r_k \, \nabla x_k\text{.}
\end{equation*}

Therefore, we adopt the definite integral as our formal definition of signed area.

######
Definition 5.2.8 Signed Area and Accumulated Change (Formal)

Suppose we have a function \(y=f(x)\) that is bounded and piecewise continuous on an interval \((a,b)\) (\(a \lt b\)). The signed area of \(f\) on the interval \((a,b)\) is defined as the definite integral

\begin{equation*}
\int_{a}^{b} f(x) \, dx.
\end{equation*}

If \(f(x)\) gives the rate of change of a quantity \(Q\) with respect to the independent variable \(x\text{,}\) then the definite integral also gives the increment of change in \(Q\text{:}\)

\begin{equation*}
Q(b) - Q(a) = \int_{a}^{b} f(x) \, dx.
\end{equation*}

The function \(f(x)\) is called the integrand and the variable \(x\) is called the variable of integration. The values \(a\) and \(b\) are called the limits of integration.

The notation of the definite integral uses an elongated “S” called the integral symbol \(\int\) that should remind you of the idea of summing increments of signed area. The limits of integration \(a\) (lower) and \(b\) (upper) represent the starting and ending points of integration, respectively. The increments of signed area are represented by the formula \(f(x) \, dx\) which represents a strip of signed area with signed height \(f(x)\) (generalizing the constant height of a simple rate function) and infinitesimally small width \(dx\) (generalizing the increments of a partition \(\nabla x\)).

Although we have presented these ideas as definitions, they are really important consequences of the development of calculus. In particular, the statement that the increment of change \(Q(b)-Q(a)\) is equal to the definite integral of the rate of change of \(Q\) is so most important that this result is called the (((Unresolved xref, reference "fundamental-theorem-calculus"; check spelling or use "provisional" attribute)))Fundamental Theorem of Calculus . One of the primary goals of learning calculus is to understand what this theorem means and why it is really true.