Solveeit Logo

Question

Question: The range of the function \(f\left( x \right)=\left| x-1 \right|+\left| x-2 \right|\), \(-1\le x\le ...

The range of the function f(x)=x1+x2f\left( x \right)=\left| x-1 \right|+\left| x-2 \right|, 1x3-1\le x\le 3, is?
(a) [2,5]\left[ 2,5 \right]
(b) [1,5]\left[ 1,5 \right]
(c) [3,5]\left[ 3,5 \right]
(d) None of these

Explanation

Solution

Substitute all the expressions inside the modulus sign and find the values of x. Consider different intervals of values of x and find the functions by removing the modulus sign. Use the formulas: - if a > 0 then a=a\left| a \right|=a and if a < 0 then a=(a)\left| a \right|=\left( -a \right). Draw the graph of the function for different intervals and check the range of the function.

Complete step-by-step solution:
Here we have been provided with the function f(x)=x1+x2f\left( x \right)=\left| x-1 \right|+\left| x-2 \right|, where 1x3-1\le x\le 3. We are asked to find the range of f(x)f\left( x \right). First we need to remove the modulus function for different intervals of values of x.
Now, substituting each of the expressions inside the modulus sign equal to 0 we get,
(x1)=0\Rightarrow \left( x-1 \right)=0 and (x2)=0\left( x-2 \right)=0
x=1\Rightarrow x=1 and x=2x=2
Therefore, we can create three intervals as per the given interval 1x3-1\le x\le 3 and the values x = 1 and 2. Let us find the function f(x)f\left( x \right) for all the intervals one by one.
(i) When we have 1x<1-1\le x<1 then the values of (x1)\left( x-1 \right) and (x2)\left( x-2 \right) inside the modulus sign will be negative and we know that if a < 0 then a=(a)\left| a \right|=\left( -a \right). So we get,
f(x)=(x1)+((x2)) f(x)=2x+3 \begin{aligned} & \Rightarrow f\left( x \right)=-\left( x-1 \right)+\left( -\left( x-2 \right) \right) \\\ & \Rightarrow f\left( x \right)=-2x+3 \\\ \end{aligned}
(ii) When we have 1x<21\le x<2 then the value of (x1)\left( x-1 \right) will be positive and (x2)\left( x-2 \right) will be negative inside the modulus sign and we know that if a > 0 then a=a\left| a \right|=a. So we get,
f(x)=(x1)+((x2)) f(x)=1 \begin{aligned} & \Rightarrow f\left( x \right)=\left( x-1 \right)+\left( -\left( x-2 \right) \right) \\\ & \Rightarrow f\left( x \right)=1 \\\ \end{aligned}
(iii) When we have 2x32\le x\le 3 then the values of (x1)\left( x-1 \right) and (x2)\left( x-2 \right) inside the modulus sign will be positive. So we get,
f(x)=(x1)+(x2) f(x)=2x3 \begin{aligned} & \Rightarrow f\left( x \right)=\left( x-1 \right)+\left( x-2 \right) \\\ & \Rightarrow f\left( x \right)=2x-3 \\\ \end{aligned}
Drawing the graph of f(x)f\left( x \right) for the above three intervals of values of x we have,

Clearly we can see that the minimum value of the function is 1, which is for the interval 1x<21\le x<2, and the maximum value of the function is 5 which is at x = -1. Also, the function is continuous in the interval 1x3-1\le x\le 3, therefore the range of the function will be f(x)=[1,5]f\left( x \right)=\left[ 1,5 \right].
Hence, option (b) is the correct answer.

Note: We can also solve the question without using the graphical approach because the functions are only linear for different intervals of values of x. To find the maximum and minimum values we will check the values at the end-points of the functions because either the function will be increasing (for positive slope), decreasing (for negative slope) or constant (for slope = 0).