The least value of the function $f(x)=|x-a|+|x-b|+|x-c|+|x-d|$

3.4k Views Asked by At

If $a<b<c<d$ and $x\in\mathbb R$ then what is the least value of the function $$f(x)=|x-a|+|x-b|+|x-c|+|x-d|\ ?$$

$f(x)= \begin{cases} a-x+b-x+c-x+d-x & x\leq a \\ x-a+b-x+c-x+d-x & a< x\leq b \\ x-a+x-b+c-x+d-x & b< x\leq c \\ x-a+x-b+x-c+d-x & c< x\leq d \\ x-a+x-b+x-c+x-d & x> d \end{cases}$

then $f'(x)=\begin{cases} -4 & x\leq a \\ -2 & a< x\leq b \\ 0 & b< x\leq c \\ 2 & c< x\leq d \\ 4 & x> d \end{cases}$

From here on,i am stuck.Help me out

1

There are 1 best solutions below

4
On BEST ANSWER

HINT: Forget derivatives. The number $f(x)$ is just the sum of the distances from $x$ to $a,b,c$, and $d$. Imagine starting $x$ somewhere to the left of $a$ and moving it to the right. Initially all four of the terms are decreasing. When $x$ passes $a$ and starts moving on to $b$, the distance from $x$ to $a$ increases, but the distance from $x$ to $b$ decreases at the same rate, so $|x-a|+|x-b|$ is constant. The distances from $x$ to $c$ and $d$ are decreasing, so $f(x)$ is still decreasing. Now continue this analysis as $x$ continues to move to the right.

Try to finish it on your own. If you get completely stuck, there's more information in the spoiler-protected block below.

The function is decreasing to the left of $b$, constant on the interval $[b,c]$, and increasing to the right of $c$, so its minimum value, in terms of $a,b,c$, and $d$, is ... ?