Range of the function f(x)=|x−1|+|x−2|+|x+1|+|x+2| where xϵ[−2,2], is
[6,8]
f(x)=|x−1|+|x−2|+|x+1|+|x+2|
When xϵ[−2,−1]f(x)=−(x−1)−(x−2)−(x+1)+x+2=−2x+4
When xϵ[−1,1], f(x)=−(x−1)−(x−2)+x+1+x+2=6
When xϵ[1,2], f(x)=(x−1)−(x−2)+x+1+x+2=2x+4
Plotting the graph of the function, range of f(x)=[6,8]