I do understand that because of the limits of integration the integral of |f(x)| can be negative, but the modulus of the integral can't. But I don't know how to prove the statement.
$$ \left| \int_a^b f(x) \, dx \right| \leq \int_a^b |f(x)| \, dx $$
I do understand that because of the limits of integration the integral of |f(x)| can be negative, but the modulus of the integral can't. But I don't know how to prove the statement.
$$ \left| \int_a^b f(x) \, dx \right| \leq \int_a^b |f(x)| \, dx $$
For starters, as pointed out in the comments we must require that $a \leq b,$ so that there is no distinction between signed and unsigned integration: a more proper way to write the inequality might be
$$\left|\int_{[a,b]} f(x) dx\right| \leq \int_{[a,b]} |f(x)| dx$$
From there, the concept of flipping up the regions where $f$ is negative posed by the other answer is good intuition for why we would expect this to be true, and if we’re using the Lebesgue definition of the integral then that exact argument gives us a good path for a proof. Letting $I$ be our interval $[a, b]$ consider that by definition
$$\int_I f(x) dx = \int_I f^+(x) dx - \int_I f^-(x) dx$$
where $f^+$ and $f^-$ are the positive and negative parts of $f$ respectively, so defining measurable sets $A = \{x \in I: f(x) \geq 0\}$ and $B = \{x \in I: f(x) < 0\}$ we have
$$\int_I f(x) dx = \int_A |f(x)| dx - \int_B |f(x)| dx$$
and by the additivity of measure we have as well that
$$\int_I |f(x)| dx = \int_A |f(x)| dx + \int_B |f(x)| dx$$
and because $|f(x)| \geq 0$ we have by monotonicity that its integrals are greater than $0$, so they’re equal to their own absolute values. So, letting $I_A$ and $I_B$ represent the integrals of $|f(x)|$ on $A$ and $B,$ our theorem can be rewritten as
$$|I_A - I_B| \leq |I_A| + |I_B|$$
which is just the triangle inequality.
Different definitions of the integral would require a different proof, but the same idea of reducing to the triangle inequality is useful, the path to get there just changes slightly.
Hope this helps!