Sign of Function Matches Sign of Definite Integral

Theorem
Let $f$ be a real function continuous on some closed interval $\left [{a \,.\,.\, b} \right]$, where $a < b$.

Then:


 * If $\forall x \in \left [{a \,.\,.\, b} \right] : f\left({x}\right) \ge 0$ then $\displaystyle \int_a^b f\left({x}\right) \, \mathrm dx \ge 0$
 * If $\forall x \in \left [{a \,.\,.\, b} \right] : f\left({x}\right) > 0$ then $\displaystyle \int_a^b f\left({x}\right) \, \mathrm dx > 0$
 * If $\forall x \in \left [{a \,.\,.\, b} \right] : f\left({x}\right) \le 0$ then $\displaystyle \int_a^b f\left({x}\right) \, \mathrm dx \le 0$
 * If $\forall x \in \left [{a \,.\,.\, b} \right] : f\left({x}\right) < 0$ then $\displaystyle \int_a^b f\left({x}\right) \, \mathrm dx < 0$

Proof
From Continuous Function is Riemann Integrable, the definite integrals under discussion are guaranteed to exist.

Consider the case where $\forall x \in \left [{a \,.\,.\, b} \right] : f\left({x}\right) \ge 0$.

Define a constant mapping:


 * $\mathbf 0: \left [{a \,.\,.\, b} \right] \to \R$:


 * $\mathbf 0 \left({x}\right) = 0$

Then:

The proofs of the other cases are similar.