Sign of Function Matches Sign of Definite Integral

Theorem
Let $f$ be a real function continuous on some closed interval $\closedint a b$, where $a < b$.

Then:


 * If $\forall x \in \closedint a b: \map f x \ge 0$ then $\ds \int_a^b \map f x \rd x \ge 0$
 * If $\forall x \in \closedint a b: \map f x > 0$ then $\ds \int_a^b \map f x \rd x > 0$
 * If $\forall x \in \closedint a b: \map f x \le 0$ then $\ds \int_a^b \map f x \rd x \le 0$
 * If $\forall x \in \closedint a b: \map f x < 0$ then $\ds \int_a^b \map f x \rd x < 0$

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

Consider the case where $\forall x \in \closedint a b: \map f x \ge 0$.

Define a constant mapping:


 * $f_0: \closedint a b \to \R$:


 * $\map {f_0} x = 0$

Then:

The proofs of the other cases are similar.