# How to prove that for $x,y>0$, the inequality $|x-y|\leq \max\{x,y\} \left|\log x-\log y\right|$ holds?

I am reading a paper and it states the following inequality. It appears to look trivial but I am struggling to show it.

Is it the following: For $x,y>0$, we have $$|x-y|\leq \max\{x,y\} \left|\log x-\log y\right|.$$ Does anyone have any hints/idea how to proceed?

• have you tried the mean value Theorem? – Dr. Sonnhard Graubner Oct 23 '17 at 16:48
• Yep, this also works, thanks. – Mr Martingale Oct 23 '17 at 17:05

Here is a second way. WLOG, assume $x < y$. Then

$$y-x = \int_x^y dt = y\int_x^y {dt\over y} \le y\int_x^y {dt\over t} = y(\log(y) - \log(x)).$$

• Probably my favourite method, thanks. – Mr Martingale Oct 23 '17 at 17:01
• Small typo: you're missing a $y$ before the second integral. – Clement C. Oct 23 '17 at 17:16
• I inserted the rogue y. – ncmathsadist Oct 23 '17 at 19:49

Maybe not the most elegant: but well, it gets the job done without too much thinking.

If $x=y$, then we are done. Without loss of generality, assume $x>y>0$.

We want to show that $$x - y \leq x \log\frac{x}{y}$$ so that it's sufficient to show that the function (once $y$ is fixed) $f_y\colon x> y \mapsto x \log\frac{x}{y} - (x-y)$ is non-decreasing (as $f_y(y)=0$).

It is differentiable, and $$f_y'(x) = \log x -\log y \geq 0$$ for all $x>y$, leading to the conclusion.

W.L.O.G we can say $x>y$ then we get $$1/x<\frac{\log{x}-\log{y}}{x-y}$$ now consider $f(x)=\log{x}$ thus $f'(x)=\frac{1}{x}$ and as we can say $f'(x)$ is always decreasing and our R.H.S is nothing but slope of a line segment which will be higher in magnitude than our L.H.S