indefinite integrals of absolute values The simplest possible case is confusing to me. Namely:
$$
\int |x| dx = \cases { \int x dx = x^2/2 + C & $x \ge 0$ \\ -\int x dx = -x^2/2 + C & $x < 0$ }
$$
However, since $|x|$ is non-negative, by comparison theorem it's integral should also be non-negative, even for negative $x$, but the integral is negative for any non-empty negative interval. Do you know what I am missing?
Thanks!
 A: Yes, integrals should be treated with care around points of discontinuity.  For this reason, integrals should be treated independently on separate intervals where the integrand is continuous.  However, in practice, this rarely matters.  The Mean Value Theorem guarantees that any two antiderivatives of $f(x)$ will differ only by a constant across an interval.  So, if you have to "jump" over a discontinuity this will cause you to work over two separate intervals.  The good example is that the integral of $\frac{1}{x^2}$ should really look like
$$
\int \frac{1}{x^2} \ dx = \begin{cases} -\frac{1}{x}+C_1, & x > 0 \\ -\frac{1}{x}+C_2, & x < 0.\end{cases}
$$
However, we wouldn't integrate over an interval that crosses over $0$ anyway, so in practice you only need one of these cases, but they both have the exact same form.  Hence, we get lazy about the distinction, but you are right, the most general form has an independent constant for each interval of continuity.
For the second question, the definite integral of a non-negative continuous function will, in fact, be non-negative.  Key word:  definite integral.
You are confounding the definite integral with the general antiderivative.  In fact, you cannot say that a general antiderivative is "negative" (or positive, or non-negative) because it is not one function but an infinite class of functions "parameterized" by your choice of $C$.  So, for some $C$ it could be negative, for others not, and for many choices, both.  But it doesn't really matter, since you should really be asking about what the definite integral does.
