We need to analyze the function f(x)=∣x∣−∣x−1∣ in the interval [−1,2]. We consider the following cases:
Case 1: x<0. Then ∣x∣=−x and ∣x−1∣=−(x−1)=1−x. So, f(x)=−x−(1−x)=−x−1+x=−1. This is valid for −1≤x<0. Case 2: 0≤x<1. Then ∣x∣=x and ∣x−1∣=−(x−1)=1−x. So, f(x)=x−(1−x)=x−1+x=2x−1. This is valid for 0≤x<1. Case 3: x≥1. Then ∣x∣=x and ∣x−1∣=x−1. So, f(x)=x−(x−1)=x−x+1=1. This is valid for 1≤x≤2. Thus, we have:
f(x)=⎩⎨⎧−1,2x−1,1,−1≤x<00≤x<11≤x≤2 Now we find the area under the curve.
Area=∫−12∣f(x)∣dx. Since f(x) is sometimes negative, we need to take the absolute value. Since 2x−1<0 for 0≤x<1/2, and 2x−1≥0 for 1/2≤x<1, we need to split the integral from 0 to 1 into two parts. Area=∫−10∣−1∣dx+∫01/2∣2x−1∣dx+∫1/21∣2x−1∣dx+∫12∣1∣dx Area=∫−101dx+∫01/2(1−2x)dx+∫1/21(2x−1)dx+∫121dx Area=[x]−10+[x−x2]01/2+[x2−x]1/21+[x]12 Area=(0−(−1))+(21−41)−(0−0)+(1−1)−(41−21)+(2−1) Area=1+(41)+0−(4−1)+1 Area=1+41+41+1 Area=2+21 Area=25