I'm looking for a function that is continuous and monotone increasing between a and b and maps to the entire real line.

2.1k Views Asked by At

After some trial-and-error I've got this:

$$f(x;a,b)=\textrm{arctanh}\left( 2\frac{x-a}{b-a}-1 \right)$$

Illustrated here on WolframAlpha: arctanh((2*((x-a)/(b-a))-1)) where a=2 and b=12

arctanh((2*((x-a)/(b-a))-1)) where a=2 and b=12

It kind of does what I wanted, but I wonder if there are any functions like this that doesn't use trigonometric functions. Maybe something like an inverse general sigmoid function. I haven't been able to come up with anything like that.

3

There are 3 best solutions below

2
On BEST ANSWER

$\frac1 {a-x}+\frac 1 {b-x}$ is continuous and increasing on $(a,b)$ and its range is $(-\infty, \infty)$.

The derivative is $\frac 1 {(a-x)^{2}}+\frac 1 {(b-x)^{2}} >0$.

1
On

Here's another one $$\ln \left( \left| \frac{x-a}{b-x} \right| \right)$$

4
On

Let us follow your suggestion of finding something like an inverse general sigmoid function.

Start with the sigmoid expression $\frac{1}{1+e^{-y}}$.

We can scale the expression by $b-a$, and add $a$ to get an expression whose values lie in $(a,b)$. Then we can solve the equation

$x = a+\frac{b-a}{1+e^{-y}}$

for $y$ to find an expression for the inverse function. This gives us the expression

$y = -\ln(\frac{b-a}{x-a}-1) = \ln(\frac{x-a}{b-x})$,

which is the same answer as Tony Mathew gave.