We have f(x)=∣x−2∣. The definition of absolute value is ∣t∣={t,−t,t≥0t<0, so we first write f(x) in simple algebraic form for each part of the domain [0,4].
When 0≤x≤2, the expression x−2≤0. Hence f(x)=−(x−2)=2−x.
When 2≤x≤4, the expression x−2≥0. Hence f(x)=x−2.
Next we define g(x)=f(f(x)), that is g(x)=∣f(x)−2∣. We substitute the two pieces of f(x) found above.
For 0≤x≤2 we already have f(x)=2−x, so
f(x)−2=(2−x)−2=−x≤0,g(x)=∣−x∣=x.
For 2≤x≤4 we have f(x)=x−2, so
f(x)−2=(x−2)−2=x−4≤0,g(x)=∣x−4∣=4−x.
Thus, on the interval we need, [0,3], the two functions are
0≤x≤2:2≤x≤3:f(x)=2−x,g(x)=x,f(x)=x−2,g(x)=4−x.
We have to evaluate the definite integral
∫03(g(x)−f(x))dx.
Because the formulas change at x=2, we split the integral:
∫03(g−f)dx=∫02(g−f)dx+∫23(g−f)dx.
First sub-integral: 0≤x≤2.
Here g(x)=x and f(x)=2−x, so
g(x)−f(x)=x−(2−x)=2x−2=2(x−1).
Integrate term-by-term:
∫022(x−1)dx=2∫02(x−1)dx=2[2x2−x]02=2((24−2)−0)=2(2−2)=0.
Second sub-integral: 2≤x≤3.
Here g(x)=4−x and f(x)=x−2, so
g(x)−f(x)=(4−x)−(x−2)=4−x−x+2=6−2x.
Integrate:
∫23(6−2x)dx=[6x−x2]23=(6⋅3−9)−(6⋅2−4)=(18−9)−(12−4)=9−8=1.
Adding the two results,
∫03(g−f)dx=0+1=1.
Hence, the correct answer is Option A.