Why the Sign of an Integral Matters
A definite integral records signed accumulation: contributions above the horizontal axis count positively, while contributions below it count negatively. This makes the sign of the integrand a useful first check on the sign of the integral.
The basic conclusion is simple, but its assumptions matter. The function must be Riemann integrable on the interval, and the bounds must be in increasing order. We will prove the result from Riemann sums, then use it to check calculations and establish a simple inequality.
The Positivity Theorem
The ordered-bounds condition is part of the statement. If \(a=b\), the interval has zero length, and the zero-length interval property gives \(\int_a^a f(x)\,dx=0\), which is nonnegative. It remains to prove the result when \(a<b\).
For a partition \(P\), write its points as \(a=x_0<x_1<\cdots<x_n=b\). Choose a sample point \(\xi_i\in[x_{i-1},x_i]\) in each subinterval. The corresponding tagged Riemann sum is
Because \(f(\xi_i)\geq 0\) and \(x_i-x_{i-1}>0\), every term in this sum is nonnegative. Therefore \(S(P)\geq 0\) for every partition and every choice of sample points. Riemann integrability says that as the mesh tends to zero, these sums approach \(\int_a^b f(x)\,dx\). A limit of nonnegative real numbers cannot be negative: if the limit were \(L<0\), sufficiently close sums would also be negative, contradicting \(S(P)\geq 0\). Hence the integral is nonnegative.
First handle \(a=b\), or verify that \(a<b\).
Confirm that \(f\) is Riemann integrable and \(f(x)\geq 0\) at every point of the interval.
For \(a\leq b\), the theorem gives \(\int_a^b f(x)\,dx\geq 0\).
Worked Examples
Worked Example: A Constant Nonnegative Function
Evaluate \(\int_2^5 3\,dx\) and check its sign using the theorem. The constant-integral formula gives \(\int_a^b c\,dx=c(b-a)\) for \(a\leq b\). Here \(c=3\), \(a=2\), and \(b=5\), so
Since \(3\geq 0\) on \([2,5]\) and \(2<5\), positivity predicts a nonnegative answer. The computed value \(9\) satisfies that check. The interval length is \(5-2=3\), so the result is also exactly the constant height \(3\) multiplied by the length \(3\).
Worked Example: A Piecewise-Constant Function with Endpoint Changes
Define \(f:[0,2]\to\mathbb{R}\) by \(f(x)=1\) for \(0\leq x<1\), \(f(1)=0\), \(f(x)=0\) for \(1<x<2\), and \(f(2)=4\). This function is nonnegative. Find its integral.
For the calculation, compare \(f\) with \(g\), where \(g(x)=1\) on \([0,1]\) and \(g(x)=0\) on \((1,2]\). The functions agree except possibly at \(x=1\) and \(x=2\). Changing a Riemann-integrable function at finitely many points does not change its integral, so \(\int_0^2 f(x)\,dx=\int_0^2 g(x)\,dx\). By additivity and the constant-integral formula,
The endpoint values are why it would be incorrect to say that \(f\) is constant on each of the closed intervals \([0,1]\) and \([1,2]\). Instead, the computation uses a function that agrees with \(f\) except at finitely many points. The result \(1\geq 0\) agrees with the positivity theorem.
Worked Example: Computing an Integral from Riemann Sums
Evaluate \(\int_0^1 x\,dx\) using right-endpoint Riemann sums. Divide \([0,1]\) into \(n\) equal subintervals. Each has width \(\Delta x=1/n\), and the right endpoint of subinterval \(i\) is \(i/n\). Thus the sum is
As \(n\to\infty\), \(1/(2n)\to 0\), so the Riemann sums tend to \(1/2\). Therefore \(\int_0^1 x\,dx=1/2\). Since \(x\geq 0\) throughout \([0,1]\), the theorem predicts a nonnegative integral, and the computed value \(1/2\) passes the sign check.
Worked Example: A Simple Inequality from a Nonnegative Square
Use positivity to establish a lower bound for \(\int_0^1 x^2\,dx\). First, \(x^2\geq 0\) on \([0,1]\), so the theorem directly gives \(\int_0^1 x^2\,dx\geq 0\). A stronger bound follows by applying positivity to the square \((x-\tfrac12)^2\), which is nonnegative for every real \(x\).
To evaluate the integrals in the resulting inequality, right-endpoint sums on \(n\) equal subintervals give
The previous example established \(\int_0^1 x\,dx=1/2\), and the constant-integral formula gives \(\int_0^1 \tfrac14\,dx=\tfrac14\). Expand the square and use linearity:
Adding \(1/4\) to both sides shows \(\int_0^1x^2\,dx\geq 1/4\). The exact value \(1/3\) verifies the inequality, since \(1/3-1/4=1/12>0\). This check also agrees with the direct calculation of the squared integral, which is \(1/12\).
Strict Positivity Is Not Guaranteed
The theorem says that the integral is nonnegative, not that it must be strictly positive. For example, the zero function satisfies \(f(x)\geq 0\) everywhere, but \(\int_a^b 0\,dx=0\). A nonnegative function can also have zero integral even if it is nonzero at isolated points, since changing finitely many values does not change a Riemann integral.
The order of the bounds matters as well. The theorem is stated for \(a\leq b\). If \(f\geq 0\) and the bounds are reversed, the signed-orientation rule gives \(\int_b^a f(x)\,dx=-\int_a^b f(x)\,dx\leq 0\). For instance, \(\int_3^1 2\,dx=2(1-3)=-4\), not \(4\). The integrand is nonnegative, but the reversed bounds change the sign.
Using Positivity as a Check
When evaluating a definite integral, checking the sign is a quick way to detect errors. If the integrand is nonnegative and the bounds are in increasing order, a negative computed answer signals a mistake in the evaluation, the bounds, or the handling of signs. Conversely, a nonnegative answer is a necessary check, not proof that every step of a calculation was correct.
The conclusion depends on both integrability and pointwise nonnegativity on the whole interval. A function that changes sign does not meet the theorem’s hypothesis, even if many of its values are positive. In that situation, positive and negative contributions may both affect the integral, so this result alone determines no sign.
Check Your Understanding
Use the theorem’s hypotheses carefully when answering these questions.
- If \(f\) is Riemann integrable and \(f(x)\geq 0\) on \([a,b]\), where \(a<b\), what can be concluded about \(\int_a^b f(x)\,dx\)?
- Why must the case \(a=b\) be handled separately in the partition proof?
- Can a nonnegative function have an integral equal to zero? Give an example.
- If \(f\geq 0\) on \([1,4]\), what does signed orientation imply about \(\int_4^1 f(x)\,dx\)?
- Why does the sign of an integral not follow from this theorem when the integrand changes sign?