Q: Monotonic, continuous mapping $(-1, x)$ to $(-\infty, \infty)$, passing through origin? I'm looking for a simple function with these properties:

*

*maps $(-1, x)$ to $(-\infty, \infty)$, where x is a real number between 0 and 1,000.

*monotonic

*continuous

*passes through the origin.

It will look like a warped Logit: https://en.wikipedia.org/wiki/Logit. But I can't seem to work out the exact form it should take.

A: Assuming $x>0$. You've got many options there. A simple option for example would be $f(y) = \frac{1}{-1-x}+1$ for $y<0$ and $f(y)=\frac{1}{x-y}-1/x$ for $0\leq y<x$. Of course that is not smooth. You can also take something like the $\tan(\pi/2 x)$ that maps $(-1,1)$ to $(-\infty,\infty)$ and then transform $(-1,1)$ to $(-1,x)$ so that $0$ is fixed. You can even do this in a smooth manner.
One possible such transformation (if $x\neq 1$):
Take $F(X) = A\exp(BX)+D$ so that $F(0) = A+D = 0$ (so $D=-A$), $F(-1)= A/\exp(B) - A = A(1/\exp(B)-1) = -1$ and $F(x) = A\exp(Bx)-A=A(\exp(Bx)-1) = 1$. If we call $Y=\exp(B)$ this means
$$ \frac{Y^x-1}{Y^{-1}-1} = \frac{1}{-1} = -1$$
This does in turn mean
$$ Y^x-1 = 1-1/Y$$
and thus
$$ Y^{x+1}-2Y+1=0$$
This has two solutions if $x\neq1$, with the trivial solution $Y=1$ and a second solution. Take $Y$ that second solution, set
$$ B = \log(Y)$$
and
$$ A=\frac{1}{1/Y-1} = \frac{Y}{Y-1}$$
For calculating $Y$ we get: If $x<1$ then $Y>1$, else $0<Y<1$.

A: We can use for example the restriction of

*

*$f(x)=\frac{x}{1-x^2}$

*$f(x)=\tan\left(\frac \pi 2 x\right)$
for $x \in(-1,1)$ or

*

*$f(x)=\frac{x}{\sqrt{1-x^4}}$
which has $x \in(-1,1)$ as natural domain.
