1

Let the function $f(x) = \cases{1 & x>0 \\ -1 & x<0}$. I want to show that the anti-derivative of $f(x)$ is $\left|x\right|$.

Let's split to cases:
If $x\le 0$ then $F(x) = \int_{-1}^x f(x) = \int_{-1}^x (-1) = (x+1)(-1) = -x - 1$
If $x\ge 0$ then $F(x) = \int_{-1}^0 f(x) + \int_0^xf = -1 + x$

Now, it doesn't look like $\left|x\right|$. I've been told to use $F(x) = 1 + \int_{-1}^x f$ but I don't understand the rationality behind that.

Elimination
  • 3,150
  • 19
  • 42
  • 3
  • Is there some reason not to take $F(x) = \int_{0}^{x} f(t), dt$, which is $|x|$? 2. To be pedantic, $F(x) = |x|$ is not an antiderivative of your $f$, it's only an antiderivative at every non-zero real number. (This nitpick could well matter if you try to apply a theorem that presumes $F$ is an antiderivative.)
  • – Andrew D. Hwang May 16 '15 at 13:07