Indefinite Integral of Absolute Value of x? Is there a closed form solution? Been searching the net for awhile and everything just comes back about doing the definite integral. So just thought to ask here. 
Title says it all. Is there a closed form solution for the indefinite integral $\int |x| dx$ ?
 A: You are looking for a function $f(x)$ so that $$\int_a^b |x|dx=f(b)-f(a).$$ This is what is meant by $\int |x|dx$. I propose that $f(x)=x|x|/2$ is such a function. Let us test it. If both $a$ and $b$ are both positive, then $$\int_a^b |x|dx=\int_a^b x\,dx=b^2/2-a^2/2=b|b|/2-a|a|/2=f(b)-f(a).$$
If $a$ and $b$ are both negative, then $$\int_a^b |x|dx=-\int_a^b x\,dx=-b^2/2-(-a^2/2)=b|b|/2-a|a|/2=f(b)-f(a).$$
Finally, if $a<0$ and $b>0$, we get
$$\int_a^b |x|dx=-\int_a^0 x\,dx+\int_0^b x\,dx=b^2/2+a^2/2=b|b|/2-a|a|/2=f(b)-f(a).$$
Of course, we could have $b<0$ and $a>0$, but then we could switch the limits, and this reduces to the third case.
Thus, $f(x)=x|x|/2$ is an indefinite integral, or antiderivative of $|x|$.
A: Using integration by parts
$$\int |x|~dx=\int \mathrm{sgn}(x)x~dx=|x|x-\int |x| ~dx$$
since $\frac{d}{dx} |x|=\mathrm{sgn}(x)$ on non-zero sets. This yields
$$\int |x| ~dx = \frac{|x|x}{2}~.$$
A: You can use $\frac{d(|x|)}{dx}=\frac{x}{|x|}$ and $\int|x|dx = \int \frac{x}{|x|}xdx$.
$\int|x|dx = \int xd(|x|)$, using integration by parts $\int|x|dx = x|x| - \int|x|dx $
$2\int|x|dx = x|x|$
$\int|x|dx = \frac{x|x|}{2}$
$\frac{x}{|x|}$ is a better way to define the sign function.
