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.
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\).
With \(n\) equal subintervals, each width is \(\Delta x=(b-a)/n\).
Each of the \(n\) terms is \(c\Delta x\), so the sum is \(nc\Delta x\).
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
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)\).
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
Therefore, the constant-function formula gives
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
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
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
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
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)\) |
|---|---|---|
| Positive | Positive | Positive |
| Negative | Positive | Negative |
| Positive | Negative | Negative |
| Negative | Negative | Positive |
| Zero | Any width | Zero |
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
This computes the ordinary rectangle area, not the definite integral. For the integral, use the signed width \(b-a\):
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.
- Evaluate \(\int_0^6 4\,dx\) using the signed-width formula. What are the rectangle’s height and width?
- Evaluate \(\int_{-1}^3 -5\,dx\). What is the ordinary area between the graph and the \(x\)-axis?
- 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.
- Evaluate \(\int_5^1 -2\,dx\). Identify the signs of the constant and the signed width before multiplying.
- A student says that the integral of a constant function must always be nonnegative because a rectangle’s area is nonnegative. Explain the mistake.