Solving Absolute Value Integral
To solve the integral \(\int_{-1}^{2} |x - x^2|\, dx\), we need to consider when the expression inside the absolute value, \(x - x^2\), is positive or negative.
First, let's find the points where \(x - x^2 = 0\):
\(x - x^2 = x(1 - x) = 0\)
This gives us two points \(x = 0\) and \(x = 1\).
Now we divide the interval \([-1, 2]\) based on these points and analyze the sign of the expression \(x - x^2\) in each subinterval:
1. For \(x \in [-1, 0]\), the expression is always negative since both \(x\) and \(x^2\) are non-positive and \(x^2\) is greater in magnitude than \(x\).
2. For \(x \in [0, 1]\), the expression is positive since \(x\) is greater than or equal to \(x^2\).
3. For \(x \in [1, 2]\), the expression is negative since \(x^2\) is greater than \(x\).
Thus, we need to change the sign of the expression in the intervals where it is negative, which gives us:
\[
\int_{-1}^{0} -(x - x^2)\, dx + \int_{0}^{1} (x - x^2)\, dx + \int_{1}^{2} -(x - x^2)\, dx
\]
Now we can integrate each term separately:
1. \(\int_{-1}^{0} -(x - x^2)\, dx = -\frac{1}{2} x^2 + \frac{1}{3}x^3\Big|_{-1}^{0}\)
2. \(\int_{0}^{1} (x - x^2)\, dx = \frac{1}{2} x^2 - \frac{1}{3}x^3\Big|_{0}^{1}\)
3. \(\int_{1}^{2} -(x - x^2)\, dx = -\frac{1}{2} x^2 + \frac{1}{3}x^3\Big|_{1}^{2}\)
Now, evaluate each integral:
1. \(-\frac{1}{2} (0)^2 + \frac{1}{3}(0)^3 - (-\frac{1}{2} (-1)^2 + \frac{1}{3}(-1)^3) = 0 - (-\frac{1}{2} + \frac{1}{3}) = \frac{1}{3} - \frac{1}{2} = -\frac{1}{6}\)
2. \(\frac{1}{2} (1)^2 - \frac{1}{3}(1)^3 - (\frac{1}{2} (0)^2 - \frac{1}{3}(0)^3) = \frac{1}{2} - \frac{1}{3} - 0 = \frac{1}{6}\)
3. \(-\frac{1}{2} (2)^2 + \frac{1}{3}(2)^3 - (-\frac{1}{2} (1)^2 + \frac{1}{3}(1)^3) = -2 + \frac{8}{3} - (-\frac{1}{2} + \frac{1}{3}) = -2 + \frac{8}{3} + \frac{1}{6} = -2 + \frac{8}{3} + \frac{1}{6}\)
To add \(-2 + \frac{8}{3} + \frac{1}{6}\), first find a common denominator, which is 6:
\(-2 + \frac{8 \cdot 2}{3 \cdot 2} + \frac{1}{6} = -2 + \frac{16}{6} + \frac{1}{6} = -2 + \frac{17}{6}\)
\(-2\) is equivalent to \(- \frac{12}{6}\), so we have:
\(-\frac{12}{6} + \frac{17}{6} = \frac{5}{6}\)
Adding the results of all the terms:
\(-\frac{1}{6} + \frac{1}{6} + \frac{5}{6} = \frac{5}{6}\)
So, the value of the integral \(\int_{-1}^{2} |x - x^2|\, dx\) is \(\frac{5}{6}\).