# Showing that $\left|x-1+\frac 1{1+x}-\left(y-1+\frac 1{1+y}\right)\right|\leq 2|x-y|$

I asked a question here the other day and one of the steps in the answer I encountered was: $$\left|x-1+\frac 1{1+x}-\left(y-1+\frac 1{1+y}\right)\right|\leq 2|x-y|$$

when $x,y\ge0$

I can't seem to figure out why this is true.. Cans someone help me out?

Thanks :)

-

We have thanks to the triangular inequality \begin{align*}\left|x-1+\frac 1{1+x}-\left(y-1+\frac 1{1+y}\right)\right|&= \left|x-1+\frac 1{1+x}-y+1-\frac 1{1+y}\right|\\ &=\left|x+\frac 1{1+x}-y-\frac 1{1+y}\right|\\ &\leq |x-y|+\left|\frac 1{1+x}-\frac 1{1+y}\right|\\ &= |x-y|+\left|\frac {1+y-(1+x)}{(1+x)(1+y)}\right|\\ &=|x-y|+\frac {|y-x|}{(1+x)(1+y)}\\ &\leq 2|x-y|. \end{align*}

-

An alternative approach. Let $$f(x)=x-1+\frac{1}{x+1}\quad\text{so that}\quad f'(x)=1-\frac{1}{(x+1)^2}\,.$$ Then $0\le f'(x)<1$ for all $x\ge0$. If $x,y\ge0$, by the mean value theorem $$|f(x)-f(y)|=|f'(c)(x-y)|<|x-y|\,,$$ where $c$ is a point between $x$ and $y$.

-