To solve the integral \( \int_0^2 ||x-1|-x| \, dx \), we need to analyze the expression inside the absolute values and break the integral into manageable parts.
### Step 1: Analyze the expression \( ||x-1|-x| \)
First, we need to understand the behavior of the function \( |x-1| \) and \( |x-1|-x \).
- For \( x < 1 \):
\[
|x-1| = 1-x \quad \text{(since \( x-1 < 0 \))}
\]
Thus,
\[
||x-1|-x| = |(1-x)-x| = |1-2x|
\]
- For \( x \geq 1 \):
\[
|x-1| = x-1 \quad \text{(since \( x-1 \geq 0 \))}
\]
Thus,
\[
||x-1|-x| = |(x-1)-x| = |-1| = 1
\]
### Step 2: Break the integral into intervals
Now we can break the integral into two parts based on the critical point \( x = 1 \):
\[
\int_0^2 ||x-1|-x| \, dx = \int_0^1 |1-2x| \, dx + \int_1^2 1 \, dx
\]
### Step 3: Evaluate the first integral \( \int_0^1 |1-2x| \, dx \)
For \( x \in [0, 1] \):
- At \( x = 0.5 \), \( 1 - 2x = 0 \). Thus, we need to split the integral at \( x = 0.5 \).
So we have:
\[
\int_0^1 |1-2x| \, dx = \int_0^{0.5} (1-2x) \, dx + \int_{0.5}^1 (2x-1) \, dx
\]
#### Step 3a: Calculate \( \int_0^{0.5} (1-2x) \, dx \)
\[
\int_0^{0.5} (1-2x) \, dx = \left[ x - x^2 \right]_0^{0.5} = \left[ 0.5 - (0.5)^2 \right] - [0 - 0] = 0.5 - 0.25 = 0.25
\]
#### Step 3b: Calculate \( \int_{0.5}^1 (2x-1) \, dx \)
\[
\int_{0.5}^1 (2x-1) \, dx = \left[ x^2 - x \right]_{0.5}^1 = \left[ 1^2 - 1 \right] - \left[ (0.5)^2 - 0.5 \right] = [0 - 0] - [0.25 - 0.5] = 0 + 0.25 = 0.25
\]
So, combining these results:
\[
\int_0^1 |1-2x| \, dx = 0.25 + 0.25 = 0.5
\]
### Step 4: Evaluate the second integral \( \int_1^2 1 \, dx \)
\[
\int_1^2 1 \, dx = [x]_1^2 = 2 - 1 = 1
\]
### Step 5: Combine the results
Now, we can combine the two parts of the integral:
\[
\int_0^2 ||x-1|-x| \, dx = 0.5 + 1 = 1.5
\]
### Final Answer
Thus, the value of the integral is:
\[
\int_0^2 ||x-1|-x| \, dx = \frac{3}{2}
\]
---