The range of the function f(x)=|x-1|+|x-2|,-1≤x≤3, is
[2,5]
[1,5]
[3,5]
None of these
Find the range of the given function
Given, f(x)=x-1+x-2
For, -1≤x≤1
f(x)=-(x-1)-(x-2)=-2x+3
For, 1≤x≤2
f(x)=(x-1)-(x-2)
=1
For, 2≤x≤3
f(x)=(x-1)+(x-2)=2x-3
∴f(x) has the maximum value at, x=-1
⇒f(-1)=-2(-1)+3=5
∴f(x)has the minimum value at, x=1 and 2
⇒ƒ(1)=1⇒ƒ(2)=2(2)-3=1
f(1)=f(2)=1
The range of the function is 1,5
Hence, the correct answer is B, 1,5.