How to deal with negative area when evaluating a definite integral 
Find the area bounded by the curves $y=2-x^2$ and $x+y=0$


$$
-x=2-x^2\implies x^2-x-2=(x-2)(x+1)=0
$$
My Attempt
$A_1:$ Area above the x-axis and $A_2:$ Area below the x-axis
$$
A_1=\int_{-1}^\sqrt{2}(2-x^2)dx-\int_{-1}^0(-x)dx=\Big[2x-\frac{x^3}{3}\Big]_{-1}^{\sqrt{2}}-\Big[-\frac{x^2}{2}\Big]_{-1}^0\\
=2\sqrt{2}-\frac{2\sqrt{2}}{3}+2-\frac{1}{3}-(\frac{1}{2})=\frac{4\sqrt{2}}{3}+\frac{7}{6}=\frac{8\sqrt{2}+7}{6}\\
A_2=\Big|\int_0^{{2}}(-x)dx\Big|-\Big|\int_\sqrt{2}^2(2-x^2)\Big|=\Big|\Big[-\frac{x^2}{2}\Big]_{0}^{2}\Big|-\Big|\Big[2x-\frac{x^3}{3}\Big]_{\sqrt{2}}^{2}\Big|\\
=|-2|-|4-\frac{8}{3}-2\sqrt{2}+\frac{2\sqrt{2}}{3}|=2-\Big|(\frac{4-4\sqrt{2}}{3})\Big|=2-(\frac{4\sqrt{2}-4}{3})=\bigg|\frac{10-4\sqrt{2}}{3}\bigg|\\
=\frac{20-8\sqrt{2}}{6}\\
A=A_1+A_2=\frac{8\sqrt{2}+7+20-8\sqrt{2}}{6}=\frac{27}{6}=\frac{9}{2}
$$
Reference
$$
A=\int_{-1}^2(2-x^2+x)dx=\bigg[2x-\frac{x^3}{3}+\frac{x^2}{2}\bigg]_{-1}^2=4-\frac{8}{3}+2+2-\frac{1}{3}-\frac{1}{2}\\
=5-\frac{1}{2}=9/2
$$
Isn't the attempt in my reference factually incorrect ?
yet why am I getting a same solutions in my attempt, ie. after splitting the areas and subtracting absolute values ?
$\color{red}{\text{Another Example}}$

Area bounded by the curve $y=x^3$, x-axis at $x=-2$ and $x=1$

Method 1
$$
A=|\int_{-2}^{0}(x^3)dx|+|\int_0^1x^3dx|=|\Big[\frac{x^4}{4}\Big]_{-2}^0|+|\Big[\frac{x^4}{4}\Big]_{0}^1|=|-4|+|\frac{1}{4}|=4+\frac{1}{4}=17/4
$$
Method 2
$$
A=|\int_{-2}^{1}(x^3)dx|=|\bigg[\frac{x^4}{4}\bigg]_{-2}^1|=|\frac{1}{4}-4|=|\frac{-15}{4}|=\frac{15}{4}
$$
Here I think we are not getting the correct answer in method 2 because the area is counted negative, right ?
 A: The simplest way to do it I see is
$$\int_{-1}^2\left(2-x^2+x\right)dx=\left.2x-\frac {x^3}3+\frac{x^2}2\right|_{-1}^2\\
4-\frac {8}3+\frac 42-(-2)-\frac{1}3-\frac 12=\\
=\frac{9}2$$
This is the approach in your reference, but there is a typo in the upper limit of the second integral.  Your $A_1$ is trying to get the area above the $x$ axis, but the $-\frac 13$ should be positive.  Your $A_2$ has no term involving the $-x$ integral from $\sqrt 2$ to $2$.
A: Example 1: 
When trying to find the area between curves $f(x)$ and $g(x)$ you can achieve this by integrating the function $H(x) = |f(x) - g(x)|$.  However integration of an absolute value function is piecewise.  In this case though $f(x) \ge g(x)$ for $-1\le x \le 2$ so integrating $\int_{-1}^2 (f(x) - g(x)) dx$ is valid.
Now we can go into greater (but unnecessary) analysis and do what you did and note that for $-1\le x \le 0$ we have $f(x)\ge g(x) >0$.  While for $0< x\le \sqrt 2$ we have $f(x)\ge 0 > g(x)$ and for $\sqrt 2 < x \le 2$ we have $0 > f(x)\ge g(x)$. and we can break it into sections of $\int_{-1}^{\sqrt 2} f(x) d(x)$ (where $f(x)\ge 0$) and subtract $-\int_{-1}^0 g(x)dx$ (where $g(x) \ge 0$) .  The we can add then absolute value of $g(x)$ where $g(x) < 0$ so $+\int_{0}^2 [-g(x)]dx$ and the subtract the absolute value of $f(x)$ where $f(x) < 0$ so $-\int_{\sqrt 2}^2 [-f(x)]dx$.
This is exactly the same result.
Example 2:
Here $f(x) = x^3$ and $g(x) = 0$ and we are trying to integrate $H(x)=|f(x)-g(x)|= |x^3|$.
Here it is NOT the case that $f(x) \ge g(x)$ and it is not the case that $|f(x)-g(x)| = f(x)-g(x)$.
So we can solve this by 
Method 1:  $\int_{-2}^1 |x^3|dx = \int_{-2}^1 \begin{cases}-x^3&x< 0\\x^3&x\ge 0\end{cases} dx=[\begin{cases}-\frac {x^4}4&x< 0\\\frac {x^4}4&x\ge 0\end{cases}]_{-2}^1= (\frac 14 -(-\frac {16}4))$
Method 2:  for $-2 \le x < 0$ we have $x^3 < 0$ and for $0\le x \le 1$ we have $x^3 \ge 0$ so $|\int_{-2}^0 x^3 dx| = |0 - \frac {16}{4}|$ and $|\int_{0}^1 x^3 dx| = |\frac 14 - 0|$.  And the result follows.
