Tutorials › Calculus I › Step-Function Rates And Piecewise Accumulation

Accumulation Functions · Tutorial 1034 of 1495

Step-Function Rates And Piecewise Accumulation

Learn to turn a constant-on-intervals rate into a continuous piecewise-linear accumulation function by calculating and carrying forward signed rectangular areas.

Intermediate 10 min read

What You'll Learn

  • Identify the partition intervals and constant rate on each interval
  • Calculate each signed rectangular area from rate and interval length
  • Carry the accumulated total forward across rate changes
  • Write the accumulation as a continuous piecewise-linear function
  • Check formulas at interval endpoints and distinguish rate jumps from accumulation values

From a Step-Function Rate to Accumulation

A rate describes how quickly a quantity changes. When the rate is constant over an interval, the change in the quantity on that interval is the rate multiplied by the elapsed time. On a graph of the rate, this change is the signed area of a rectangle.

If the rate changes from one constant value to another at several times, the accumulation can be built one interval at a time. Each rectangular area is added to the total already accumulated. The resulting function is linear on each interval, and it remains continuous where the rate jumps.

This method is useful when a rate is given in stages, as in a table of constant rates or a graph made of horizontal segments. The essential bookkeeping is to keep track of interval lengths, signs, and the accumulated value at each change point.

Step-Function Rates and Accumulation

Definition: Let \(a=x_0<x_1<\cdots<x_n=b\) be a partition of an interval. A step-function rate \(r\) is constant on each open interval \((x_{i-1},x_i)\). Write that constant as \(c_i\). The signed change contributed by that interval is the rectangle area \(c_i(x_i-x_{i-1})\).

The rate can jump at the partition points. Its values at those individual points do not change the accumulated area: changing a function at finitely many points does not alter its definite integral. For calculations, we may assign each partition point to either adjoining interval, provided the constant values on the open intervals are unchanged.

Fix an initial accumulation value \(A\) at \(x_0=a\). The accumulation function is the initial value plus the signed area under the rate from \(a\) to the input \(x\). On a full interval, the area is a rectangle. If \(x\) lies partway through an interval, the partial area is also a rectangle, with width \(x-x_{i-1}\).

Key formula: If \(x\in[x_{k-1},x_k]\), then the accumulated value is the initial value, plus all completed rectangular areas, plus the partial rectangle on the current interval:
$$ F(x)=A+\sum_{i=1}^{k-1}c_i(x_i-x_{i-1})+c_k(x-x_{k-1}). $$

A positive rate adds to the accumulation, while a negative rate subtracts from it. The width of each rectangle is the length of its interval, not the endpoint at which the rate changes.

Why the Accumulation Is Continuous and Piecewise Linear

On any one partition interval, the completed areas do not change as \(x\) moves within that interval. Only the partial rectangle changes. Its area is the constant rate multiplied by the distance from the interval's left endpoint, so the formula has the form “constant plus constant times \(x\).” That is a linear function on the interval.

At a change point, the area from the interval just completed has already been included. The next interval contributes zero area at its left endpoint, because its width there is zero. Consequently, the formulas on the two sides give the same accumulated value at the change point.

Theorem: For a step-function rate on a finite partition, the accumulation with a fixed initial value is continuous and piecewise linear. On each partition interval, its linear change is the rate on that interval multiplied by the distance traveled within it.

This conclusion follows directly from the rectangular-area construction; it does not require the rate itself to be continuous. A jump in rate changes the slope of the accumulation, but does not create a jump in its value.

Worked Example: A Rate That Changes Sign

Worked Example: A Rate That Changes Sign

Let \(r(t)=3\) on \([0,2)\), \(r(t)=-1\) on \([2,5)\), and \(r(t)=2\) on \([5,6]\). Suppose \(F(0)=4\). Find the accumulation function on \([0,6]\).

On the first interval the rate is \(3\), so at \(t=2\) the accumulated change is \(3(2-0)=6\). Thus \(F(2)=4+6=10\), and on that interval \(F(t)=4+3(t-0)=4+3t\).

On the second interval the rate is \(-1\). Its full rectangular area is \((-1)(5-2)=-3\), so \(F(5)=10-3=7\). At an intermediate input \(t\), the partial rectangle has area \((-1)(t-2)\), giving \(F(t)=10-(t-2)=12-t\).

On the third interval the rate is \(2\). Its full area is \(2(6-5)=2\), so \(F(6)=7+2=9\). For an intermediate input, \(F(t)=7+2(t-5)=2t-3\).

$$ F(t)= \begin{cases} 4+3t, & 0\le t\le 2,\\ 12-t, & 2\le t\le 5,\\ 2t-3, & 5\le t\le 6. \end{cases} $$

Check the change points: at \(t=2\), the first formula gives \(4+3(2)=10\), and the second gives \(12-2=10\). At \(t=5\), the second gives \(12-5=7\), and the third gives \(2(5)-3=7\). Finally, the last formula gives \(F(6)=2(6)-3=9\), which agrees with adding the three rectangle areas to the initial value: \(4+6-3+2=9\).

A General Derivation

The formula can be justified by splitting the area at each partition point. Suppose \(x\in[x_{k-1},x_k]\). From \(a=x_0\) to \(x\), the first \(k-1\) intervals are complete. Their signed areas are \(c_i(x_i-x_{i-1})\). The last part runs only from \(x_{k-1}\) to \(x\), where the rate is \(c_k\), so its area is \(c_k(x-x_{k-1})\). Add these areas to the initial value \(A\).

$$ F(x) =A+\int_a^x r(t)\,dt =A+\sum_{i=1}^{k-1}c_i(x_i-x_{i-1})+c_k(x-x_{k-1}). $$

Here the integral is the accumulated signed area; for a step function, each complete or partial piece is a rectangle. The formula also proves continuity at the partition points. At \(x=x_k\), the formula from interval \(k\) gives

$$ A+\sum_{i=1}^{k-1}c_i(x_i-x_{i-1})+c_k(x_k-x_{k-1}) =A+\sum_{i=1}^{k}c_i(x_i-x_{i-1}). $$

The formula on the next interval starts with exactly that same sum, and its partial rectangle has width zero at \(x_k\). Both formulas therefore give the same value there. On each interval the expression is linear in \(x\), so the accumulation is piecewise linear as claimed.

Worked Example: Unequal Intervals and a Nonzero Initial Value

Worked Example: Unequal Intervals and a Nonzero Initial Value

A signed rate is \(2\) on \([0,1)\), \(-3\) on \([1,4)\), and \(\frac12\) on \([4,6]\). If \(F(0)=-2\), find \(F\) and its value at \(x=5\).

The first interval has width \(1-0=1\), so its area is \(2(1)=2\). The accumulation at \(1\) is \(-2+2=0\). For \(0\le x\le1\), the partial area is \(2(x-0)\), so \(F(x)=-2+2x\).

The second interval has width \(4-1=3\), and its full area is \((-3)(3)=-9\). Starting from \(F(1)=0\), this gives \(F(4)=0-9=-9\). For \(1\le x\le4\), the partial area is \(-3(x-1)\), so \(F(x)=0-3(x-1)=3-3x\).

The third interval has width \(6-4=2\), and its full area is \(\frac12(2)=1\). Thus \(F(6)=-9+1=-8\). For \(4\le x\le6\), \(F(x)=-9+\frac12(x-4)=\frac12x-11\). In particular, \(F(5)=-9+\frac12(1)=-\frac{17}{2}\).

$$ F(x)= \begin{cases} -2+2x, & 0\le x\le1,\\ 3-3x, & 1\le x\le4,\\ \frac12x-11, & 4\le x\le6. \end{cases} $$

Check the joins: at \(x=1\), the first formula gives \(0\) and the second gives \(3-3=0\). At \(x=4\), the second gives \(3-12=-9\) and the third gives \(2-11=-9\). The requested value also checks by adding areas up to \(5\): \(-2+2-9+\frac12(5-4)=-\frac{17}{2}\).

Keeping the Accumulated Total Straight

A frequent error is to treat each new interval as if accumulation starts over at zero. For instance, in the preceding example, one might write \(F(x)=-3(x-1)\) on \([1,4]\). This is the area contributed by the second interval alone, not the full accumulation. It would give \(F(1)=0\) but incorrectly give \(F(4)=-9\) only because the first interval's ending value happened to be zero. On the last interval, starting over would give \(\frac12(x-4)\), which misses the previous accumulated value \(-9\).

The correction is to carry the endpoint value forward. On an interval with left endpoint \(x_{k-1}\), rate \(c_k\), and known accumulated value \(F(x_{k-1})\), use

$$ F(x)=F(x_{k-1})+c_k(x-x_{k-1}). $$

This formula makes the bookkeeping explicit: the first term is everything accumulated so far, and the second is the new interval's partial signed area.

Another common mistake is to use the next rate for the entire earlier time span. A rate applies only on its own interval. Calculate each rectangle with its own rate and width, then add the rectangles in order. A negative rectangle reduces the running total; it does not erase the earlier areas unless its signed area exactly cancels them.

Worked Example: Building the Function from a Table

Worked Example: Building the Function from a Table

Suppose the rate is \(-2\) on \([-2,1)\), \(4\) on \([1,3)\), and \(-1\) on \([3,7]\), with initial accumulation \(F(-2)=5\). Construct the accumulation function and check its value at \(x=5\).

The first interval has width \(1-(-2)=3\) and area \((-2)(3)=-6\). Therefore \(F(1)=5-6=-1\). For \(-2\le x\le1\), the partial area from \(-2\) is \(-2(x+2)\), hence \(F(x)=5-2(x+2)=1-2x\).

The second interval has width \(3-1=2\) and area \(4(2)=8\). Therefore \(F(3)=-1+8=7\). For \(1\le x\le3\), \(F(x)=-1+4(x-1)=4x-5\).

The third interval has width \(7-3=4\) and area \((-1)(4)=-4\). Therefore \(F(7)=7-4=3\). For \(3\le x\le7\), \(F(x)=7-(x-3)=10-x\). At \(x=5\), this gives \(F(5)=10-5=5\).

$$ F(x)= \begin{cases} 1-2x, & -2\le x\le1,\\ 4x-5, & 1\le x\le3,\\ 10-x, & 3\le x\le7. \end{cases} $$

At \(x=1\), the first formula gives \(1-2=-1\), and the second gives \(4-5=-1\). At \(x=3\), the second gives \(12-5=7\), and the third gives \(10-3=7\). For the value at \(x=5\), the rectangle calculation is \(5-6+8-2=5\): the last term is the rate \(-1\) times the partial width \(5-3=2\). It agrees with the formula.

Why This Representation Is Useful

A piecewise-linear accumulation formula records both the running total and the effect of each rate stage. Its value at a partition point is obtained by adding all completed signed rectangles. Within an interval, a change in the input changes the accumulation by the interval's rate times that change in input.

This gives a reliable way to translate tables or horizontal-step rate graphs into formulas. It also makes important features visible: positive rates produce rising segments, negative rates produce falling segments, and a zero rate produces a constant segment. At a jump in rate, the accumulation remains joined while the direction or steepness of its linear segment can change.

When checking your work, verify the accumulated value at every partition point from both adjoining formulas, and compare the final value with the initial value plus the signed rectangle areas. These checks catch most errors in widths, signs, and carried totals.

Check Your Understanding

Use signed rectangular areas and carry the accumulated value forward in each problem.

  1. A rate is \(3\) on \([0,2)\) and \(-2\) on \([2,5]\), with \(F(0)=1\). Find the piecewise formula and \(F(5)\).
  2. Why can a step-function rate jump at a partition point while its accumulation remains continuous?
  3. A rate is \(-1\) on \([1,4]\), and the accumulation at \(1\) is \(6\). Find the formula on this interval and the value at \(4\).
  4. In a piecewise formula, what does the accumulated value at the start of a new interval represent?
  5. For a constant rate \(c\) on \([u,v]\), write the area contributed from \(u\) to an input \(x\in[u,v]\).

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon