# If $f(x) = \max\left|2\sin y-x\right|,$ Then $\min.$ value of $f(x)$

If $f(x) = \max\left|2\sin y-x\right|\;,$ Where $y\in \mathbb{R}\;,$ Then $\min.$ value of $f(x)$

$\bf{My\; try}$ We know that $-2 \leq 2\sin y\leq 2$. Now I did not Understand How Can I open That

help me, Thanks

• I think there is a typing error. 'max' operator needs two argument. – user153245 Aug 13 '15 at 13:23
• he probably means $\sup_y |2\sin y - x|$. – Zarrax Aug 13 '15 at 13:26

$$f(x) = \sup_{y \in \mathbb{R}}\left|2\sin y-x\right|$$ Method-$1$

Define a function, $g_{x}(y)=\left|2\sin y-x\right|, \text{ where } y \in \mathbb{R}$. So, $f(x) = \sup_{y \in \mathbb{R}}g_{x}(y)$. Now, $-1\leq \sin(x) \leq 1$. So, this optimization problem of $g_x(y)$ can be posed as another equivalent optimization problem. That is, $$f(x) = \sup_{a \in [-2,2]} h_{x}(a)$$ where, $$h_{x}(a) = |a-x|, \text{ where } a \in \mathbb{R}.$$ $$\implies f(x) = \max_{t \in [(-2-x),(2-x)]} |t|.$$ (From the attainability argument we can replace $sup$ by $max$.) $$\implies f(x) =\begin{cases} 2-x, & x \leq 0 \\ x+2, & x > 0 \end{cases}$$

Method-$2$ Credit to @A.G.'s comment.

$$\left|2\sin y-x\right| \leq \left|2\sin y\right|+\left|-x\right|$$ Equality holds when, $sgn(sin{y}) = -sgn(x)$. $$\implies \sup_{y \in \mathbb{R}}\left|2\sin y-x\right| \leq 2 + \sup_{y \in \mathbb{R}}\left|x\right|.$$ Because, $\sup(A+B) \leq \sup{A}+\sup{B}$, but here equality will hold. A detailed discussion can be found here- link.

So, we can say that-

$$f(x) = 2+|x|, x \in \mathbb{R}$$

So, then it is clear that, $$\inf_{x \in \mathbb{R}} f(x) = 2, \text{ when } x=0$$ (Again one can replace $inf$ by $min$ from the same argument.)

• One could write $f(x)=2+|x|$. – A.Γ. Aug 13 '15 at 14:27
• Yes, that is true. I am also ultimately doing the same, but there might be a shorter version to derive the expression. – Rajat Aug 13 '15 at 14:30
• Something like: $|2\sin y-x|\le|2\sin y|+|x|\le 2+|x|$ and "$\le$" becomes "$=$" for $\sin y=-\text{sign}(x)$, thus RHS is the maximum. – A.Γ. Aug 13 '15 at 14:36

Since $2 \sin y$ ranges continuously from $-2$ to $2$, $f(x)$ is the maximum of the absolute value function on the interval from $-2 -x$ to $2 - x$. As $x$ varies this interval can be any interval of length 4, and this maximum absolute value is minimized when this interval is exactly $[-2,2]$, in other words when $x = 0$. So the minimum of $f(x)$ would be $2$.