<s>[INST] 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 ?
 [/INST] 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$.
</s>