Test whether the function $\frac{x}{2}+\frac{1}{x}$ is contraction or NOT 
Let , $X=\{x\in \Bbb R: x\ge 1\}$. Define a map $f:X\to X$ by $\displaystyle f(x)=\frac{x}{2}+\frac{1}{x}$ for all $x\in X$. Examine if $f$ is contraction map or not w.r.t. usual metric on $\Bbb R$. Find the smallest $\lambda$, as contraction constant.

We have $|f(x)-f(y)|=\left |\left(\frac{1}{2}-\frac{1}{xy}\right)(x-y)\right |\le |x-y|.\left(\frac{1}{2}+\frac{1}{|xy|}\right)\le \frac{3}{2}|x-y|$
From here how I can say that $f$ is a contraction map ?
As, $x,y\ge 1$ so , $1/xy \le 1$. If we take $x,y\in X$ such that $1/xy=1/4$ then the constant $\lambda=1/2+1/4=3/4<1$. But $f$ to be contraction we have to show for all $x,y\in X$ , $|f(x)-f(y)|\le \lambda|x-y|$. So why I will take $x,y$ such that $1/xy=1/4$ ?
 A: You gave up too much when you used the triangle inequality to get
$$\left|\frac12 -\frac{1}{xy}\right| \le \left(\frac12 + \frac{1}{xy}\right).$$
Since $x,y\ge 1, 0 < \displaystyle \frac{1}{xy}\le 1$, as you said. So the greatest distance $\displaystyle \frac{1}{xy}$ can have from $\displaystyle \frac12$ is $\displaystyle \frac12$.
Now you have a contraction. Before, with Lipschitz constant $\displaystyle \frac32$, you did not have a contraction.
A: Hint: The estimate
$$\Big|\frac12 - \frac1{xy}\Big| \le \frac12 + \frac1{xy}$$
is too bad. Try to find a better estimate. (What are the possible values for $xy$?)
A: $f(x)
=\frac{x}{2}+\frac{1}{x}
$
so
$f'(x)
=\frac{1}{2}-\frac{1}{x^2}
\le \frac12
$
for
$x \ge 1$/
Therefor,
by the mean value theorem,
$f(x)-f(y)
=(x-y)f'(z)
$
where
$x \le z \le y$
so that
$|f(x)-f(y)|
\le\frac12|x-y|
$.
If 
$M
\lt x < y$,
then,
if
$x \le z \le y$,
$f'(z)
\gt \frac12-\frac1{M^2}
$
so that
$|f(x)-f(y)|
=|x-y||f'(z)|
\gt (\frac12-\frac1{M^2})|x-y|
$
so that
$\frac12$
is the best possible value.
