Find the minimum value of $$|x-2|+|2x+1|-|x-1|$$
My way of doing it
$|x|$ is also known as distance of x from the origin
$|x-2|$ distance from the origin will be $2$
$|2x+1|$ distance from the origin will be $-1/2$
$|x-1|$ distance from the origin will be $1$
Now in order to find the minimum value, I assumed that on the number line.
Suppose $A=2$, $B=-1/2$ and $C=1$ are friends. Now they all want to meet at a point on the number line where minimum distance is covered. That minimum point will be 1.
Now in order to find the minimum value, I know A will cover $1 unit$ to reach C and B will cover $3/2 \text{ units }$ to reach C.
Total distance covered is $5/2$. But, the correct answer is 1. What is wrong in my way of doing it?
The value of $x \in \mathbb{R}$ such that $f(x)$ is minimal belong the set $A=\{2,-1/2,1\}$ (these values are the values such that vanish each module individually). But $f(2)=f(1)=4$ and $f(-1/2)=1$, thus the minimal value of function is $1$.