Example of a function that behaves like another function I need a function $f(x)$ with the following properties -


*

*It should be monotonically non-decreasing.

*For $x \geq 1$, $x + \frac{1}{x} - f(x) < \epsilon$ where $\epsilon$ is an extremely small positive real number.

*It should look simple. I know this sounds like a very vague requirement, but I hope the meaning of "simple" is clear to some extent. For example, the function should definitely not have a piecewise definition. One should be able to write it by using not more than 15 characters, etc. etc.


Can anyone think of such a function? It's fine even if the above requirements are satisfied only for positive values of $x$.
 A: Here's a general way of doing something like this. One way we could achieve what we want is to multiply the function x+1/x by something that's very like a step function -- 0 up to 1 and 1 from then on.
Now to get a step function in a nice clean way a simple method is to take a Gaussian that's centred at 1 and has very small variance, and integrate it. Multiplying the resulting function by x+1/x should do the trick.
If you don't count the integral of $e^{-x^2}$ as nice, then you have to find another function that looks like a step function. Something based on $\tan^{-1}(x)$ should do the trick. At a guess, $(\tan^{-1}(1000(x-1))+\pi/2)/\pi$ ought to be OK.
A: This may be more than 15 symbols, but 
$$
f(x)= x + \frac{1}{1+(x+\delta-1)^{2n/(2n-1)}}
$$
where $\delta>0$ is small and $n$ is large. For $n=2$ and $\delta=1/10$ it looks like this:
 (source)

EDIT:
Motivation
The idea is that we want $y=x+g(x)$ where $g$ is a bell curve of some sort, say $g(x)=e^{-x^2}$. Something that is a little more reminiscent of $1/x$ is
$$ 
g_{1,1}(x)=\frac{1}{1+x^2}
$$ 
but the $x^2$ term means that the rate of approach to $1/x$ is not so good. On the other hand
$$ 
g_{\infty,0}(x)=\frac{1}{1+|x-1|}
$$ 
would be perfect, were it differentiable. The formula 
$$
g_{n,\delta}(x)= \frac{1}{1+(x+\delta-1)^{2n/(2n-1)}}
$$
gives something that looks like the latter from far away ($n=\infty$, $\delta=0$), and like the former from up close ($n=\delta=1$). Note that $|a|=(a^2)^{1/2}$.
EDIT #2: 
Or...
Here is a plot of Gowers' more general solution (in another answer to this question), for this specific case, together with the original curve:
 (source)
