Minimum of $\left| \sin x- 1\right| + \left|\sin x- 2\right| + \left| \sin x -3\right| + \left| \sin x+1\right|$ I would like to know the minimum value of $$\left| \sin x- 1\right| + \left|\sin x- 2\right| + \left| \sin x -3\right| + \left| \sin x+1\right|$$ 
for $x \in \mathbb{R}$.

For every $x \in \mathbb{R}$ we have
$$
-1 \le \sin x\le 1 \quad \forall\ x \in \mathbb{R},
$$
and therefore:
\begin{eqnarray}
f(x)&:=&|\sin x-1|+|\sin x-2|+|\sin x-3|+|\sin x+1|\\
&=&(1-\sin x)+(2-\sin x)+(3-\sin x)+(\sin x+1)\\
&=&5+2(1-\sin x).
\end{eqnarray}
The minimum is therefore equal to $5=f(\pi/2)$.
