Tutorials › Calculus I › Rectangle Sums for Piecewise Rates

Accumulation from Sums · Tutorial 919 of 1495

Rectangle Sums for Piecewise Rates

You will learn how to evaluate rectangle sums for piecewise rates, including when a partition interval crosses a change in formula.

Beginner 9 min read

What You'll Learn

  • Identify which formula defines the rate at each sample point
  • Use the endpoint or midpoint specified by the requested rectangle sum
  • Calculate each rectangle’s width, height, and contribution
  • Handle sample points that lie exactly at a formula boundary
  • Keep the given partition even when one interval crosses a boundary
  • Check the units and arithmetic of a completed estimate

Why Piecewise Rates Need Careful Sampling

A rate may follow one rule during one part of a time period and a different rule later. For example, a tank may fill at one rate before a valve setting changes, then fill at another rate afterward. A rectangle-sum estimate must account for both rules, but the key question is not which formulas occur somewhere in a rectangle’s interval. It is which formula gives the rate at the rectangle’s sample point.

This distinction matters when a partition interval crosses the time at which the formula changes. The interval still has the width specified by the partition. Its rectangle height is found by evaluating the piecewise rate at the requested sample point, using the formula whose domain contains that point.

Key idea: For each subinterval, keep its prescribed width and evaluate the rate at its prescribed sample point. Use the piecewise formula that applies at that sample point, even if the subinterval itself crosses a formula boundary.

Reading a Piecewise Rate

A piecewise function is defined by giving different formulas on different parts of its domain. The domains matter: they specify when each formula is used and ensure that the rate has an unambiguous value at each relevant time.

For instance, consider a rate \(r\), measured in liters per minute, defined for \(0\le t\le 5\) by

$$ r(t)= \begin{cases} 2+t, & 0\le t<2,\\ 6, & 2\le t\le 5. \end{cases} $$

At \(t=1\), the first formula applies, so \(r(1)=2+1=3\). At \(t=2\), the first domain no longer applies, while the second one does, so \(r(2)=6\). The boundary convention is part of the definition. It is not a matter of choosing whichever formula seems more convenient.

A partition divides the time interval into subintervals. For a rectangle sum, each subinterval has a width and a selected sample point. A left sum uses the left endpoint of each subinterval; a right sum uses the right endpoint; a midpoint sum uses its midpoint. Those choices determine where to evaluate the rate.

Definition: If the partition is \(a=t_0<t_1<\cdots<t_n=b\), let \(\Delta t_i=t_i-t_{i-1}\) be the width of subinterval \(i\), and let \(c_i\) be its prescribed sample point. The rectangle sum is $$ \sum_{i=1}^{n} r(c_i)\,\Delta t_i. $$ For a piecewise rate, each height \(r(c_i)\) is calculated from the formula whose domain contains \(c_i\).

If \(r\) is measured in liters per minute and \(t\) in minutes, then \(r(c_i)\Delta t_i\) is measured in liters. The sum combines the estimated contributions from all the subintervals.

A Reliable Calculation Process

Before doing arithmetic, list the subintervals, their widths, and their sample points. Then evaluate the rate at each sample point, checking its domain before substituting into a formula. This prevents a common error: selecting a formula because of where a subinterval begins or ends, rather than because of where the sample point lies.

1
Record the partition.
Write each subinterval and calculate its width by subtracting its left endpoint from its right endpoint.
2
Find the sample point.
Use the left endpoint, right endpoint, or midpoint required by the sum.
3
Choose the applicable formula.
Locate the sample point in the domains shown in the piecewise definition. Pay particular attention to included and excluded boundary points.
4
Calculate and add contributions.
Multiply each sampled rate by its subinterval width, then add the products and state the resulting units.

Worked Examples

Worked Example: A Left Sum with a Boundary in the Partition

A tank fills at the piecewise rate

$$ r(t)= \begin{cases} 2+t, & 0\le t<2,\\ 6, & 2\le t\le 5, \end{cases} $$

where \(t\) is in minutes and \(r(t)\) is in liters per minute. Estimate the accumulated amount from \(t=0\) to \(t=5\) using a left sum on the partition \(0,1,2,4,5\).

The subintervals are \([0,1]\), \([1,2]\), \([2,4]\), and \([4,5]\). Their widths are \(1\), \(1\), \(2\), and \(1\) minute. The left sample points are \(0\), \(1\), \(2\), and \(4\).

At \(t=0\), the first formula applies: \(r(0)=2+0=2\). At \(t=1\), it also applies: \(r(1)=2+1=3\). At \(t=2\), the second formula applies because its domain includes \(2\): \(r(2)=6\). At \(t=4\), the second formula applies as well: \(r(4)=6\).

$$ L =2(1)+3(1)+6(2)+6(1) =2+3+12+6 =23\text{ liters}. $$

Check the products: the four subinterval contributions are \(2\), \(3\), \(12\), and \(6\) liters, and their sum is \(23\) liters. In particular, the rectangle on \([2,4]\) has height \(r(2)=6\), not a value from the earlier formula.

Worked Example: A Midpoint at the Formula Change

Suppose a flow rate is

$$ r(t)= \begin{cases} 5-t, & 0\le t<2,\\ t+4, & 2\le t\le 5, \end{cases} $$

in liters per minute. Use a midpoint sum on the partition \(0,1,3,5\) to estimate the amount that flows from \(t=0\) to \(t=5\).

The subintervals are \([0,1]\), \([1,3]\), and \([3,5]\), with widths \(1\), \(2\), and \(2\) minutes. Their midpoints are \(0.5\), \(2\), and \(4\). The middle subinterval crosses the formula boundary at \(t=2\), and its midpoint lies exactly at that boundary.

For the first midpoint, \(0.5<2\), so use the first formula: \(r(0.5)=5-0.5=4.5\). For the second midpoint, \(t=2\), the second formula applies: \(r(2)=2+4=6\). For the third midpoint, \(4\ge2\), so again use the second formula: \(r(4)=4+4=8\).

$$ M =4.5(1)+6(2)+8(2) =4.5+12+16 =32.5\text{ liters}. $$

Check the contributions: \(4.5\) liters, \(12\) liters, and \(16\) liters add to \(32.5\) liters. The middle rectangle uses width \(2\) and height \(r(2)=6\). It is not split at \(t=2\), because the requested partition contains the single subinterval \([1,3]\).

Worked Example: A Right Sum with an Interval Crossing the Boundary

Let a rate be

$$ r(t)= \begin{cases} 2t+1, & 0\le t<2,\\ 7-t, & 2\le t\le 5, \end{cases} $$

in liters per minute. Find the right-sum estimate on the partition \(0,1.5,3,5\).

The subintervals are \([0,1.5]\), \([1.5,3]\), and \([3,5]\). Their widths are \(1.5\), \(1.5\), and \(2\) minutes. The right endpoints, and therefore the right sample points, are \(1.5\), \(3\), and \(5\).

Since \(1.5<2\), use the first formula at the first sample point: \(r(1.5)=2(1.5)+1=3+1=4\). The second subinterval crosses \(t=2\), but its right sample point is \(3\), which is in the second formula’s domain. Thus \(r(3)=7-3=4\). At the final sample point, \(5\), the second formula gives \(r(5)=7-5=2\).

$$ R =4(1.5)+4(1.5)+2(2) =6+6+4 =16\text{ liters}. $$

Check the products: \(4\cdot1.5=6\), \(4\cdot1.5=6\), and \(2\cdot2=4\); their total is \(16\) liters. The middle rectangle keeps its full width of \(1.5\) minutes and uses the rate at its right endpoint.

Why the Rectangle Sum Has This Form

On subinterval \(i\), the rectangle-sum method represents the rate by one sampled value, \(r(c_i)\), across the entire width \(\Delta t_i\). The contribution assigned to that subinterval is therefore the rectangle’s height multiplied by its width. Adding these contributions gives the total estimate across the partition.

$$ \text{estimated contribution on subinterval }i = r(c_i)\Delta t_i, \qquad \text{total estimate} = \sum_{i=1}^{n}r(c_i)\Delta t_i. $$

This reasoning applies whether the rate has one formula or several. For a piecewise rate, the definition of the function supplies the height: evaluate the formula assigned to \(c_i\). The formula change does not, by itself, change the given width or the chosen sample point.

These sums are estimates based on sampled rates. They need not equal the actual accumulated amount. The calculation answers a specific question: what estimate results from the stated partition and sampling rule? Changing the partition or the sample points can change that estimate.

Common Mistake: Choosing a Formula from the Interval Instead of the Sample

In the midpoint example, the middle interval is \([1,3]\), and its midpoint is \(2\). A tempting but incorrect calculation is to notice that the interval starts below \(2\), use the first formula, and write \(r(2)=5-2=3\). This gives a middle contribution of \(3(2)=6\) liters and an incorrect total of \(4.5+6+16=26.5\) liters.

The error is that the first formula is defined only for \(0\le t<2\). It does not apply at \(t=2\). The correct value is \(r(2)=2+4=6\), using the second formula. The middle contribution is \(6(2)=12\) liters, so the correct sum is \(4.5+12+16=32.5\) liters.

Check before substituting: Compare the sample point with the domains in the piecewise definition. Do not select a formula merely because it applies at one endpoint of the subinterval.

Why This Skill Matters

Piecewise rates arise whenever a process changes conditions: a flow rate may change when a pump setting changes, or a production rate may follow different rules during different shifts. A rectangle-sum calculation is reliable only if each sampled rate is evaluated under the correct rule. Keeping the partition, sample locations, formula domains, and units visible makes the estimate easier to check and the source of any error easier to locate.

Before finishing a calculation, verify that every sample point belongs to a stated formula domain, every width is positive and matches its subinterval, and every product has units of accumulated amount. If a sample lies exactly at a boundary, follow the inclusion convention in the definition.

Check Your Understanding

For each question, use the stated sampling rule and pay attention to the formula domains.

  1. A rate is \(r(t)=3\) for \(0\le t<1\) and \(r(t)=5\) for \(1\le t\le3\). Which formula gives \(r(1)\), and what is its value?
  2. A midpoint sum uses the subinterval \([0,2]\), whose midpoint is \(1\). The rate changes formula at \(t=1\). What information determines which formula supplies the rectangle height?
  3. In a right sum, a subinterval crosses a formula boundary, but its right endpoint is after the boundary. Should the height be chosen from the formula at the left endpoint, or from the formula at the right sample point?
  4. A rectangle has rate height \(4\) liters per minute and width \(2.5\) minutes. What is its contribution, including units?
  5. Why should a subinterval that crosses a formula boundary not automatically be split when evaluating a sum on a specified partition?

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