Indefinite integral of absolute value When I looked up about absolute value on Wikipedia, I found that the antiderivative of $|x|$ is $\frac12 x|x|+C$. I am able to find the derivative of $|x|$ by treating the function as $\sqrt{x^2}$, but I am not able to integrate it.

When I put $\int_{-4}^{-1}|x|\,dx$ into Symbolab, the online calculator did not break the integral into piecewise function but calculate the indefinite integral first before using $F(b) - F(a)$. When I view the steps it used, it said:

If $\int f(x)\,dx = F(x)$
then $$\int \sqrt{(f(x))^2)}\,dx = \frac{\sqrt{f(x)^2}}{f(x)}$$ multiplied to $F(x)$
which becomes $\frac{\sqrt{x^2}}{x}$ multiplied to $\int x\,dx$
The function ${\rm abs}$ is continuous on all of ${\mathbb R}$, hence should have primitives $F$ defined on all of ${\mathbb R}$. Given that ${\rm abs}$ is "special" at $x=0$ we should look for the primitive obtained by integrating from $0$ to $x$. In this way we obtain
$$F(x)=\int_0^x |t|\&gt;dt=\int_0^x t\&gt;dt={x^2\over2}\qquad(x\geq0)$$
and
$$F(x)=\int_0^x |t|\&gt;dt=\int_0^x (-t)\&gt;dt=-{x^2\over2}\qquad(x\leq0)\ .$$
The two partial results can be condensed into the single formula
$$F(x)={x\&gt;|x|\over 2}\qquad(-\infty&lt;x&lt;\infty)\ ,$$
and adding an arbitrary constant $C$ gives the general primitive of ${\rm abs}$.
$\int_{-4}^{-1}|x|~dx$

$=[x|x|]_{-4}^{-1}-\int_{-4}^{-1}x~d(|x|)$

$=15-\int_{-4}^{-1}x\times\dfrac{|x|}{x}dx$

$=15-\int_{-4}^{-1}|x|~dx$

$\therefore2\int_{-4}^{-1}|x|~dx=15$

$\int_{-4}^{-1}|x|~dx=\dfrac{15}{2}$