Tutorials › AP Calculus › Constant Functions and Rectangle Area

Riemann Sums and Definite Integrals · Tutorial 444 of 999

Constant Functions and Rectangle Area

Use constant-height rectangles and Riemann sums to find definite integrals of constant functions, including when the interval’s signed width is negative.

Beginner 8 min read

What You'll Learn

  • Interpret a constant function’s graph as a horizontal rectangle.
  • Derive its definite integral from equal-width Riemann sums.
  • Explain why every sample-point choice gives the same sum.
  • Calculate constant-function integrals using signed interval width.
  • Distinguish signed integral from ordinary geometric area.
  • Identify and correct common sign errors.

Introduction

A constant function has the same value at every point of an interval. Its graph is a horizontal line, so the region between the graph and the \(x\)-axis is a rectangle. This makes a constant function a simple but useful place to connect two ways of understanding a definite integral: as a limit of Riemann sums and as signed area.

The rectangle calculation also reveals an important detail. A definite integral depends on the function’s height and on the interval’s signed width, not just on the rectangle’s ordinary, nonnegative area.

The Rectangle Under a Constant Function

Let \(f(x)=c\), where \(c\) is a real constant, on an interval with endpoints \(a\) and \(b\). When \(a<b\), the graph is a horizontal line at height \(c\), and the horizontal distance between the endpoints is \(b-a\).

If \(c>0\), the rectangle lies above the \(x\)-axis. Its ordinary area is \(c(b-a)\), and its signed area is positive. If \(c<0\), the rectangle lies below the \(x\)-axis. Its ordinary area is \(|c|(b-a)\), but its signed area is negative. If \(c=0\), both areas are zero.

Key result: For a constant function \(f(x)=c\), the definite integral from \(a\) to \(b\) is the constant value multiplied by the signed width: $$ \int_a^b c\,dx=c(b-a). $$ For \(a<b\), the signed width is \(b-a\). The sign of the integral records whether the function is above or below the \(x\)-axis.

The formula gives a signed quantity. It agrees with ordinary rectangle area when the rectangle is above the axis, but not when it is below: ordinary area is never negative, whereas a definite integral can be.

Deriving the Formula from Riemann Sums

For \(a<b\), divide the interval \([a,b]\) into \(n\) equal subintervals. Each subinterval has width \(\Delta x=(b-a)/n\). A Riemann sum adds the function value at a sample point in each subinterval, multiplied by that subinterval’s width. Because \(f(x)=c\) everywhere, the sample point does not affect any function value: every rectangle has height \(c\).

1
Choose the partition width.
With \(n\) equal subintervals, each width is \(\Delta x=(b-a)/n\).
2
Write the Riemann sum.
Each of the \(n\) terms is \(c\Delta x\), so the sum is \(nc\Delta x\).
3
Simplify and take the limit.
Substituting the width gives \(nc(b-a)/n=c(b-a)\), which is unchanged as \(n\) increases.

Here is the calculation in full. Let \(x_0=a,x_1,\ldots,x_n=b\) be the equally spaced partition points, and choose any sample point \(x_i^*\) in each subinterval. The Riemann sum is

$$ \begin{aligned} \sum_{i=1}^{n} f(x_i^*)\Delta x &=\sum_{i=1}^{n} c\left(\frac{b-a}{n}\right)\\ &=n\cdot c\left(\frac{b-a}{n}\right)\\ &=c(b-a). \end{aligned} $$

This sum is exactly \(c(b-a)\) for every positive integer \(n\) and every allowed choice of sample points. Therefore, as the partition is refined, the Riemann sums converge to that same value. By the definition of the definite integral as the limit of Riemann sums, the integral equals \(c(b-a)\).

Why the result works: Refining the partition creates more rectangles, but each rectangle becomes proportionally narrower. The total width remains \(b-a\), and the height remains \(c\). Adding the signed areas of all the rectangles therefore always gives \(c(b-a)\).

Signed Width and Endpoint Order

The expression \(b-a\) is a signed width: it is positive when \(b>a\), zero when \(b=a\), and negative when \(b<a\). For a constant function, the same Riemann-sum calculation works with a directed partition from \(a\) to \(b\). The equal step is then \(\Delta x=(b-a)/n\), and the sum still simplifies to \(c(b-a)\). Thus the formula also gives the constant-function integral when the endpoints are written in decreasing order.

This endpoint-order case should not be confused with ordinary geometric width. A geometric width is nonnegative; the signed width \(b-a\) keeps track of the direction from the first endpoint to the second. The examples below use the formula directly and interpret its sign carefully.

Worked Examples

Worked Example: A Positive Constant on an Interval

Evaluate \(\int_2^7 5\,dx\), and verify the result using a Riemann sum with five equal subintervals.

Here \(c=5\), \(a=2\), and \(b=7\). The signed width is

$$ b-a=7-2=5. $$

Therefore, the constant-function formula gives

$$ \int_2^7 5\,dx=5(7-2)=5\cdot5=25. $$

For a Riemann-sum check, five equal subintervals have width \(\Delta x=(7-2)/5=1\). Each rectangle has height \(5\), so each term is \(5\cdot1=5\). The sum is \(5+5+5+5+5=25\). This matches the formula. Geometrically, it is a rectangle of height \(5\) and width \(5\), with area \(25\).

Worked Example: A Negative Constant

Evaluate \(\int_1^4 -2\,dx\), then compare the integral with the ordinary area between the graph and the \(x\)-axis.

The constant is \(c=-2\), and the signed width is \(4-1=3\). Hence

$$ \int_1^4 -2\,dx=(-2)(4-1)=(-2)(3)=-6. $$

To check by a Riemann sum, divide the interval into three equal parts. Each has width \((4-1)/3=1\), and the function value on every part is \(-2\). Thus the sum is

$$ (-2)(1)+(-2)(1)+(-2)(1)=-2-2-2=-6. $$

The graph is below the axis, so the signed integral is negative. The ordinary area is the positive magnitude \(|-6|=6\). These are different quantities: the definite integral is \(-6\), while the geometric area is \(6\).

Worked Example: Decreasing Endpoint Order

Evaluate \(\int_6^2 3\,dx\) using the signed-width formula, and check the result with a directed Riemann sum.

Here \(c=3\), \(a=6\), and \(b=2\). The signed width is \(b-a=2-6=-4\), so

$$ \int_6^2 3\,dx=3(2-6)=3(-4)=-12. $$

For a direct check, divide the directed interval into four equal steps. Each step is \(\Delta x=(2-6)/4=-1\). Since the function value is \(3\) at every sample point, each Riemann-sum term is \(3(-1)=-3\). The sum is

$$ (-3)+(-3)+(-3)+(-3)=-12. $$

This agrees with the formula. The negative result comes from the negative signed width; the function itself is positive. The ordinary rectangle area is \(3\cdot|2-6|=12\), not \(-12\).

Keeping the Signs Straight

There are two possible sources of a negative integral in the constant-function formula: the constant \(c\) may be negative, or the signed width \(b-a\) may be negative. If both are negative, their product is positive. The formula records both effects, so it is useful to identify them separately before multiplying.

Constant \(c\)Signed width \(b-a\)Integral \(c(b-a)\)
PositivePositivePositive
NegativePositiveNegative
PositiveNegativeNegative
NegativeNegativePositive
ZeroAny widthZero

When the endpoints are in increasing order, the sign of the integral tells whether the constant graph is above or below the axis. When the endpoints are in decreasing order, the signed width also affects the sign. In all cases, ordinary geometric area uses the nonnegative width \(|b-a|\) and the nonnegative height \(|c|\), giving \(|c||b-a|\). The signed integral is \(c(b-a)\), which may differ from that area.

Common Mistake: Replacing Signed Width with Absolute Width

A frequent error is to calculate the integral using the rectangle’s ordinary width even when the endpoint order makes the signed width negative. For example, a mistaken calculation for \(\int_6^2 3\,dx\) might be

$$ 3|2-6|=3\cdot4=12. $$

This computes the ordinary rectangle area, not the definite integral. For the integral, use the signed width \(b-a\):

$$ 3(2-6)=3(-4)=-12. $$

A second sign error is to treat a rectangle below the axis as having a positive integral. For instance, on an increasing interval, \(\int_1^4 -2\,dx\) is \((-2)(4-1)=-6\), even though the ordinary area is \(6\). The reliable procedure is to write \(c(b-a)\) first, substitute both values with their signs, and only then multiply.

Why This Case Matters

Constant functions give the simplest exact example of the connection between a Riemann sum and signed area. There is no approximation error: each rectangle has the same height, and the sum of all rectangle widths is exactly the interval’s signed width. This provides a direct check on the meaning of the definite integral and a basic model for interpreting accumulated quantities.

Units follow the same multiplication. If \(c\) is measured in meters per second and \(b-a\) in seconds, then \(c(b-a)\) is measured in meters. The integral combines a constant rate with elapsed time to give a signed change. In a purely geometric setting, the corresponding ordinary area uses nonnegative dimensions instead.

Check Your Understanding

For each question, distinguish the signed integral from ordinary geometric area when both are relevant.

  1. Evaluate \(\int_0^6 4\,dx\) using the signed-width formula. What are the rectangle’s height and width?
  2. Evaluate \(\int_{-1}^3 -5\,dx\). What is the ordinary area between the graph and the \(x\)-axis?
  3. For a constant \(c\), explain why the Riemann sum on \([a,b]\), where \(a<b\), has the same value for every number of equal subintervals.
  4. Evaluate \(\int_5^1 -2\,dx\). Identify the signs of the constant and the signed width before multiplying.
  5. A student says that the integral of a constant function must always be nonnegative because a rectangle’s area is nonnegative. Explain the mistake.

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: 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