Tutorials › Calculus I › Positivity For Nonnegative Functions

Integral Properties and Estimates · Tutorial 981 of 1495

Positivity For Nonnegative Functions

Use nonnegative Riemann sums to establish the sign of a definite integral and check simple inequalities.

Intermediate 10 min read

What You'll Learn

  • State the conditions under which a nonnegative function has a nonnegative definite integral.
  • Prove the positivity result from tagged Riemann sums, including the zero-length interval case.
  • Compute examples using constant integrals, additivity, and Riemann sums.
  • Use positivity of a squared function to establish a simple integral inequality.
  • Distinguish nonnegative integrands from strictly positive integrals and account for reversed bounds.

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.

Definition: A function \(f:[a,b]\to\mathbb{R}\) is nonnegative on \([a,b]\) if \(f(x)\geq 0\) for every \(x\in[a,b]\). It is Riemann integrable on \([a,b]\) if its tagged Riemann sums approach a single limit as the partition mesh tends to zero. That limit is denoted by \(\int_a^b f(x)\,dx\).

The Positivity Theorem

Theorem: If \(a\leq b\), \(f:[a,b]\to\mathbb{R}\) is Riemann integrable, and \(f(x)\geq 0\) for every \(x\in[a,b]\), then
$$ \int_a^b f(x)\,dx\geq 0. $$

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

$$ S(P)=\sum_{i=1}^{n} f(\xi_i)(x_i-x_{i-1}). $$

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.

1
Check the interval.
First handle \(a=b\), or verify that \(a<b\).
2
Check the function.
Confirm that \(f\) is Riemann integrable and \(f(x)\geq 0\) at every point of the interval.
3
Conclude the sign.
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

$$ \int_2^5 3\,dx=3(5-2)=3\cdot 3=9. $$

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,

$$ \begin{aligned} \int_0^2 f(x)\,dx &=\int_0^1 1\,dx+\int_1^2 0\,dx\\ &=1(1-0)+0(2-1)\\ &=1+0\\ &=1. \end{aligned} $$

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

$$ \begin{aligned} S_n &=\sum_{i=1}^{n}\frac{i}{n}\cdot\frac{1}{n}\\ &=\frac{1}{n^2}\sum_{i=1}^{n}i\\ &=\frac{1}{n^2}\cdot\frac{n(n+1)}{2}\\ &=\frac{n+1}{2n} =\frac{1}{2}+\frac{1}{2n}. \end{aligned} $$

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

$$ \begin{aligned} \int_0^1 x^2\,dx &=\lim_{n\to\infty}\sum_{i=1}^{n}\left(\frac{i}{n}\right)^2\frac{1}{n}\\ &=\lim_{n\to\infty}\frac{n(n+1)(2n+1)}{6n^3}\\ &=\lim_{n\to\infty}\left(\frac{1}{3}+\frac{1}{2n}+\frac{1}{6n^2}\right) =\frac{1}{3}. \end{aligned} $$

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:

$$ \begin{aligned} 0 &\leq \int_0^1\left(x-\frac12\right)^2\,dx\\ &=\int_0^1x^2\,dx-\int_0^1x\,dx+\int_0^1\frac14\,dx\\ &=\int_0^1x^2\,dx-\frac12+\frac14\\ &=\int_0^1x^2\,dx-\frac14. \end{aligned} $$

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.

Common pitfall: “The integrand is nonnegative, so the integral is positive” is too strong. The theorem guarantees \(\int_a^b f(x)\,dx\geq 0\) for \(a\leq b\); equality is possible. Also, do not apply that conclusion to reversed bounds without first using signed orientation.

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.

  1. 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\)?
  2. Why must the case \(a=b\) be handled separately in the partition proof?
  3. Can a nonnegative function have an integral equal to zero? Give an example.
  4. If \(f\geq 0\) on \([1,4]\), what does signed orientation imply about \(\int_4^1 f(x)\,dx\)?
  5. Why does the sign of an integral not follow from this theorem when the integrand changes sign?

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