2

I have the function $f(x)=x\cdot \sin\Bigl(\dfrac{1}{x}\Bigr)$ $(\mathbb R^*\rightarrow \mathbb R)$.

Is there a method to find the global minimum of $f$? Thanks

2 Answers2

4

$f$ is an even function, so it suffices to consider $x > 0$. We have

$$\lim_{x\to\infty} f(x) = 1, \text{ and } \lim_{x \searrow 0} f(x) = 0.$$

Also, $f$ is continuous and attains negative values, for example $f\left(\frac{2}{3\pi}\right) = -\frac{2}{3\pi} < 0$, hence it attains a global minimum (not a priori necessarily in a unique point).

For $x \geqslant \frac{1}{\pi}$, we have $f(x) \geqslant 0$, and for $0 < x < \frac{2}{3\pi}$, we have $$f(x) \geqslant - \left\lvert x\sin \frac1x\right\rvert \geqslant - \lvert x\rvert > - \frac{2}{3\pi},$$ so a point where a global minimum is attained must lie between $\frac{2}{3\pi}$ and $\frac{1}{\pi}$.

To find the global minimum, we can (numerically) solve $f'(x) = 0$, or

$$\sin \frac1x = \frac{1}{x}\cos \frac1x$$

in the interval $\left[\frac{2}{3\pi},\frac1\pi\right)$.

Since $f'\left(\frac{2}{3\pi}\right) = -1 < 0$, the minimum is actually attained in the interval $\left(\frac{2}{3\pi},\frac1\pi\right)$.

So let's use $y = \frac1x$ for ease of notation and solve

$$\sin y = y\cos y \iff y = \tan y$$

in the interval $(\pi, \frac{3\pi}{2})$. In that interval, we can also write it as $y = \arctan y + \pi$, where $\arctan$ denotes the principal branch. That gives a reasonably quickly converging approximation (of course, the Newton method converges faster, but the derivative of $\arctan$ is $\approx \frac{1}{20}$ near the fixed point, so the convergence is fast enough for double precision)

$$y \approx 4.493409457909064;\quad x \approx 0.22254815844566586; \quad f(x) \approx -0.21723362821122166,$$

and the global minimum is (except for the sign, since $f$ is even) indeed unique.

Daniel Fischer
  • 206,697
  • "For x⩾1/π, we have f(x)⩾0, and for 0<x⩽1/2π, we have f(x) >−1/2π > −2/3π, so a point where a global minimum is attained must lie between 12π and 1π." I'm not reealy convinced by that, but i'm pretty sure it can be proved. I mean there is no –  Dec 09 '13 at 20:29
  • We have $f(x) \geqslant - \lvert x\rvert$, since $\left\lvert \sin \frac1x\right\rvert \leqslant 1$. Thus a global minimum cannot be attained in a point $0 \leqslant x < \frac{2}{3\pi}$. And for $x > \frac1\pi$, we have $0 < \frac1x < \pi$, hence $\sin \frac1x > 0$. So the only possible locations for the point where the minimum is attained are in the interval $\left[\frac{2}{3\pi},\frac{1}{\pi}\right)$. – Daniel Fischer Dec 09 '13 at 20:35
  • Sorry, problem with the edit : You prove it like you know the minimum, by searching in the right interval, you can show it, but you already know where it is, so it is like trial and error. So my question become : Does a method , working for any function (infinitely differentiable), to find the global minimum exist ? Or some are only possible by testing intervals like that ? –  Dec 09 '13 at 20:43
  • For all methods I know, you must generally look at the function to determine the approximate location where a global minimum could lie. If you start your root-finder algorithm at the wrong point, it might converge to a local minimum that is not the global minimum (or it might not converge at all). – Daniel Fischer Dec 09 '13 at 20:50
  • So that means there is no quick algorithm to calculate the minimum of fonctions like that ... Not cool ! (by quick i understand not check all the values) –  Dec 09 '13 at 20:53
  • Thanks for answering to my questions :) –  Dec 09 '13 at 20:54
1

Let $F(x)=\frac{\sin x} x$. Consider $x>0$ is sufficient

the only number $x_0\in (\frac\pi 2,\frac{3\pi}2)$ such that $\tan x_0= x_0$

I think the global minimum of $F(x)$ is $F(x_0)$

If $x\le\pi$, then $F(x)\ge0$;

If $x\ge2\pi$, then $F(x)\ge -\frac1x\ge-\frac1{2\pi}$.

so Consider $x\in (\pi,2\pi)$ is sufficient.

$$F^\prime (x)=\frac{x\cos x-\sin x}{x^2}=\frac{\cos x}{x^2}(x-\tan x)$$

if $x\in (\pi,x_0), x-\tan x>0, \cos x <0$, so $F^\prime (x)<0$;

if $x\in (x_0,\frac{3\pi}2), x-\tan x<0, \cos x <0$, so $F^\prime (x)>0$;

if $x\in (\frac{3\pi}2,2\pi), \sin x<0, \cos x >0$, so $F^\prime (x)>0$;

we get that the global minimum of $F(x)$ is $F(x_0)$

ziang chen
  • 7,771
  • Thanks for answering, that's a nice other proof. But same comment as for @Daniel Fischer, you suppose you know the interval where the minimum is. –  Dec 09 '13 at 20:59