Question: 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$

Answer: 
[enter image description here](https://i.stack.imgur.com/ZpGiG.jpg)

∫|x|dx=∫〖√(x^2 ) dx〗=

=x√(x^2 )-∫〖x/√(x^2 ) dx〗

Then:

∫〖√(x^2 ) dx〗=x√(x^2 )-∫〖√(x^2 ) dx〗

∫〖√(x^2 ) dx〗=x√(x^2 )-∫〖√(x^2 ) dx〗

Then:

2∫〖√(x^2 ) dx〗=x√(x^2 )=x|x|

Finally we will have:

```
  ∫〖√(x^2 ) dx〗=x|x|/2

```

I can not put the formula correctly, If you guide how to do the job I will provide the answer in a better view
$\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}$