You bring an inflatable raft on a trip to the lake, along with a portable air pump to inflate it. The air pump has three settings:
low (0.25 m3⁄min)
medium (0.5 m3⁄min)
high (0.75 m3⁄min).
Notice that the specification for each of the three settings is given in volume-per-unit-time, so these are inflation rates.
You run the pump at medium for one minute, but it’s taking too long so you bump it up to high. After two minutes on high, the raft is nearly inflated but the pump seems like it’s getting a bit hot as it works to counter-act the tendency of the raft to want to deflate, so you switch it to low for one more minute before turning it off.
The model rate function graphed in Figure 5.1.2 is an example of a step function.
Definition5.1.3.Step function.
A function that “steps” between constant values on non-overlapping intervals.
A function can only take on one output value at any given input value, which is why we have an open circle at the endpoint of each line segment in the graph in Figure 5.1.2. For example, if we call that inflation rate function \(r\text{,}\) then \(r(3) = 0.25\) but \(r(2.9999) = 0.75\text{.}\) Of course, this function is just a model of the behaviour of the air pump described in Example 5.1.1 — we could have put open circles at the beginnings of the line segments and closed ones at the ends instead, and it wouldn’t affect our analysis of the inflation of the raft.
To describe a step function, we use piecewise notation to specify the constant output values on different subdomains.
Example5.1.4.Describing a step function.
Here is the graph of another step function.
There is no single constant value or formula that describes the function’s output values at every possible input value, so we describe the function’s output values using different output values on different subdomains.
\begin{equation*}
f(t) = \begin{cases}
0 \amp t \lt 0 \\
1 \amp 0 \le t \lt 1 \\
2 \amp 1 \le t \lt 2 \\
3 \amp 2 \le t \lt \pi \\
\sqrt{2} \amp \pi \le t \lt 4.5 \\
0 \amp t \ge 4.5
\end{cases}
\end{equation*}
Suppose we wanted to determine the output value \(f(\sqrt{3})\) without the graph in front of us. We would first scan the subdomains in the right column, and notice that the input \(t = \sqrt{3}\) falls into the subdomain \(1 \le t \lt 2\text{.}\) Matching up this subdomain with its specified output value, we find that \(f(\sqrt{3}) = 2\text{.}\)
The simplest situation to deal with is a step function that “steps” at regular intervals.
Definition5.1.6.Regular step function.
A step function whose domain can be split into equal-length intervals so that the “steps” in output value only occur at boundaries between these intervals.
The step function in Example 5.1.4 is not regular — the steps in output value from \(1\) to \(2\) and from \(2\) to \(3\) both occur after intervals of length \(1\text{,}\) but the next two steps in output value occur after intervals of length greater than \(1\text{.}\) Because the irrational number \(\pi\) is involved in these longer two interval lengths, there is no way to subdivide all these intervals into equal-length intervals so that output-value changes only occur at interval boundaries.
On the other hand, the air pump model in Example 5.1.1 is regular because we can split the middle interval in half, and then changes in output-value still only occur at boundaries of these length-\(1\) intervals.
Section5.2Accumulation for a stepped rate function
Subsection5.2.1Calculation pattern
When a rate function is known to be constant, computing accumulation is easy:
When a quantity changes with a rate function that can be modelled by a step function, then the rate function is not constant over its entire domain because it is not always the same rate value for all time. However, a stepped rate function is constant over specific subdomains, so we can still apply the above formula on each of those subdomains and then total up all of those partial accumulations.
Example5.2.1.Inflated raft.
For the situation described in Example 5.1.1, how much air has been pumped into the raft? To answer this question, we will split the inflation time period up.
During the first minute when the pump is run on the medium setting, pumping air at a rate of 0.5 m3⁄min for one minute accumulates
Remember that we can have a rate function where the independent variable represents something other than time.
Example5.2.2.Accumulation of cost.
You are ordering a quantity of saffron, a very expensive spice, for your bulk food preparation business. The supplier offers a discount scheme based on the amount you order:
The first 500 g ordered is priced at $3.00 per gram.
Any additional amount ordered above500 g is priced at $2.75 per gram, for orders up to 1 kg total. For example, if an order of 600 g is placed, then only the additional 100 g quantity is charged at $2.75 per gram, while the “initial” quantity of 500 g is still charged at $3.00 per gram.
Any additional amount above 1 kg is priced at $2.50 per gram.
The pricing model can be considered a rate function, where the inputs are in units of grams, and the outputs are in units of dollars-per-gram.
In this pricing model, the total “accumulated” cost of your order of 1.2 kg is
Consider what the calculations in Example 5.2.1 represent on the graph of the inflation rate function. On each subdomain, we used the constant-rate accumulation formula
The rate represents the height of the graph on that particular subdomain, while the duration represents the length of time that this rate was in effect. Geometrically, the product of a height and a length represents the area of a rectangle:
So each partial accumulation calculation in Example 5.2.1 corresponds to an area of a rectangle related to the graph of the stepped rate function. Let’s see exactly how.
First, suppose we actually turned the air pump off after the first minute of running on the medium setting. The accumulation formula
for the final minute running on low corresponds to an area calculation for a rectangle of height \(0.25\) and length \(1\text{.}\)
For the total accumulation, we added up the results of these three calculations. Graphically, the total accumulation corresponds to the total area of the rectangles formed between the stepped rate function’s levels and the \(t\)-axis.
Warning5.2.8.
We talk above about accumulation corresponding to area, but the results of each of our accumulation calculations in Example 5.2.1 are in units of \(\mathrm{m}^3\text{,}\) not \(\mathrm{m}^2\) — why is that?
It is important to maintain a distinction between
the actual physical quantity whose accumulation we are determining (in Example 5.2.1, this is a volume of air in units of \(\mathrm{m}^3\))
the graphical area formed by creating rectangles under the different levels of the step function.
We are making a graphical connection between the two product calculations
by interpreting each rate value as a height and each time duration as a length on the rate graph. Through this correspondence between the two formulas above, the magnitudes of accumulation and graphical area will be the same, but their units of measurement will not coincide.
Example5.2.9.
On a car trip from Camrose to Wetaskiwin, it takes the driver 6 min at the posted Camrose city speed limit of 50 km⁄h to get out onto the highway, then 24 min at the posted highway speed limit of 100 km⁄h to reach Wetaskiwin, and another 9 min at the posted Wetaskiwin city speed limit of 50 km⁄h to reach the final destination.
With this model, our rate function is stepped.
(Note that minutes have been converted into hours for the graph.)
Computing the total distance travelled is the same as calculating the total area of the three rectangles in Figure 5.2.10:
Keep in mind that the stepped rate function in Example 5.2.9 is a simplified model. In reality, a car cannot change its rate of travel instantaneously, and so our rate graph should have periods of increasing speed (that is, acceleration) and periods of decreasing speed (that is, deceleration). Moreover, it is unlikely the car was travelling at exactly50 km⁄h during the city portions of the trip, or at exactly100 km⁄h during the highway portion — in reality there would have been dips and rises in the rate graph, as the car went up or down hills, around corners, or was stuck behind or pulled out to pass slower-moving vehicles. However, often a simplified model is good enough, and trying to take into account all of the little variations in velocity during the trip might be too complicated for the simple purpose of estimating the distance travelled.
In fact, we will learn in the next chapter how estimating accumulation using simplified models involving stepped rate functions can actually help us to calculate accumulation exactly for more complicated models.
Checkpoint5.2.12.Accumulation of cost.
In Example 5.2.2, we analyzed a purchasing scenario with a rate function describing variation in cost per unit mass, (whereas our other examples have all involved variation per unit time). Do you see how the total cost calculation in that example corresponds to a sum of areas of rectangles on the rate function graph?
Subsection5.2.3Oriented area
What if the rate is sometimes negative?
Example5.2.13.Punctured raft.
One minute after inflating your raft (as in Example 5.1.1), a previously patched leak begins leaking again at a rate of 0.2 m3⁄min, and three minutes pass before you notice, quickly slap a piece of tape over the leak, and turn the air pump back on to medium for two minutes. (We’ll assume in our simplified model that all of this happens instantaneously.)
How much air is in the raft now? We just have to repeat the calculation of Example 5.1.1, but take into account the periods of air-loss and re-inflation.
Can we still interpret the calculation in Example 5.2.13 as a sum of rectangle areas on the rate graph? While leaking air, the amount of accumulated air in the raft is decreasing, and so we should interpret the rate of air leakage as a negative rate of variance. The static period between the initial inflation and the start of the leakage could also be interpreted as a period with rate 0 m3⁄min.
If we allow rectangles to be assigned negative area and also consider a line segment along the horizontal axis as a rectangle with height \(0\text{,}\) then the above calculation is still a sum of rectangle areas.
Definition5.2.15.Positively-oriented area.
If a function is positive on a domain, then the area bounded between the graph of the function and the horizontal axis over that domain is positively-oriented and we assign positive number to that area.
Definition5.2.17.Negatively-oriented area.
If a function is negative on a domain, then the area bounded between the graph of the function and the horizontal axis over that domain is negatively-oriented and we assign a negative number to that area.
Section5.3Sigma notation
Subsection5.3.1Summing patterns
In the examples in this section, total accumulation was calculated as a sum of products. The situation of calculating a sum where each term in the sum follows a pattern comes up a lot in mathematics, so mathematicians have developed a special notation for it.
Sigma notation.
If we write \(P(k)\) to mean a calculation formula or pattern in the variable \(k\text{,}\) then we can write
The Greek letter \(\Sigma\) stands for “Sum”, the variable \(k\) is called the index variable for the sum, and the “start” and “end” values \(1\) and \(n\) are called the lower bound and upper bound, respectively, for the summation.
Note5.3.1.
The Greek letter \(\Sigma, \sigma\) is called “sigma”, where \(\Sigma\) is the uppercase version and \(\sigma\) is the lower case version. This letter corresponds to the letter S in the English alphabet, hence its use to represent a Sum.
While we used the value \(k = 1\) as sort of a “default” start value in the definition of Sigma notation above, we can use any start value we like, according to the summation pattern we are trying to describe.
Take care when counting an indexed collection: the number of objects is
\begin{equation*}
(\text{ending index value}) - (\text{starting index value}) + 1 \text{.}
\end{equation*}
The “\(+ 1\)” is required because in the subtraction we have “taken away” every object up to and including the one indexed by the “starting index value,” but we actually want to include that “starting” object in the collection being counted. For example, if we have a sum indexed from \(k = 1\) to \(k = n\text{,}\) then we are adding up \(n\) terms, not \(n - 1\) terms.
Pattern5.3.5.Summing a constant value.
For a constant value \(c\) and integers \(m\) and \(n\) with \(n \gt m\text{:}\)
\begin{equation*}
\sum_{k = m}^{n} c = (n - m + 1) \times c \text{.}
\end{equation*}
Subsection5.3.2Properties of Sigma notation
Keep in mind that calculating with Sigma notation is really just addition, so every algebra rule for addition can be applied to Sigma notation.
Example5.3.6.Sum of evens.
Suppose we want to sum a collection of even numbers:
While there are variations of Sigma notation where the index variable may “step” by more than \(1\text{,}\) we can avoid that by expressing each of our even numbers as \(2\) times a number that increases by only \(1\) from term to term:
This formula is \(2\) times a sum, so we can express it as \(2\) times a Sigma expression:
\begin{equation*}
2 \sum_{k = 1}^{5} k \text{.}
\end{equation*}
Pattern5.3.7.Factoring in a Sigma expression.
For pattern \(P(k)\) and constant value \(c\text{,}\)
\begin{equation*}
\sum_{k = 1}^n c P(k) = c \sum_{k = 1}^n P(k) \text{.}
\end{equation*}
Warning5.3.8.
Only a constant may be factored out of Sigma notation — any expression involving the index variable \(k\) cannot be factored out, because if the sum were written out that variable part would be different from term to term and so would not actually be a common factor.
As well as factoring out of sums, we also know that we may perform a series of additions in any order and with any groupings we wish.
So this same sum that we expressed in Example 5.3.2 using a single Sigma expression can be re-expressed using two Sigma expressions, if we had some particular reason for wanting to do so:
Summation based on a pattern can be performed in Sage. The syntax is below.
sum(pattern, variable, start, end)
For example, the summation
\begin{equation*}
\sum_{k=1}^{5} 2 k + 1
\end{equation*}
becomes Sage input
sum(2*k + 1, k, 1, 5)
However, remember that by default the only letter that Sage treats as a variable is x, so if we want to use k for our index variable as we’ve been doing in our Sigma notation, we have to first tell Sage that we want k to be treated as a variable.
is called the Riemann sum for \(s(t)\) over the domain \(t_0 \le t \le t_n\text{.}\)
Example5.4.2.Riemann sum for the air pump.
Let’s unpack the notation of the definition above for the inflate-deflate-reinflate model from Example 5.2.13. The step function in the model “steps” output values at the following input values.
just as in our previous calculation, and each term in the sum represents an oriented rectangle area, as pictured in Figure 5.2.14 (though one of the rectangles has height \(0\) and can’t be seen in that diagram).
Pattern5.4.4.Riemann sum for a regular step function.
For a regular step function, we can split the domain into subdomains of equal length, so that \(\change{t_k}\) is the same value for each subdomain.
Writing \(\change{t}\) for this common subdomain length, if the original domain is \(a \le t \le b\) then the length of each subdomain should be
This Riemann sum corresponds to the net (oriented) area of ten rectangles (though again one of the rectangles has height \(0\) and can’t be seen).
Remark5.4.8.
It may seem that summing ten rectangle areas in Example 5.4.5 is more work than summing six rectangle areas in Example 5.4.2. But when programming a computer to do such sums, the regularly-spaced ten rectangles is easier to program then the irregularly-spaced six rectangles, and computers don’t care how many rectangle areas you ask them to sum (unless the number of rectangles is very, very large).