How do I come up with a continuous function between two functions?

129 Views Asked by At

Say $y = 0$ when $x \leq 0$, and $y = 1$ when $x \geq 1$. I want to create a function between these two that still makes everything continuous (continuous at $x = 0$ and $x = 1$) and is monotonically increasing. How can I come up with such a function? Basically, I am trying to find a function that would fit the part in blue (obviously not accurately drawn, but you get the idea):

enter image description here

3

There are 3 best solutions below

2
On BEST ANSWER

This function looks nice :

$$1-\frac{1}{1+\tan(x\frac{\pi}{2})^3} $$

2
On

$x \to x\mathbf{1}_{[0,1]} + \mathbf{1}_{]1, +\infty[}$ does the trick. It is continuous, monotone, and does what you want. However, it is not $\mathcal{C}^1$.

Edit (for if you want a closed-form). Define $f(x) = \frac{x + |x|}{2}$. Then $f$ take the value $0$ if $x \leq 0$ and the value $x$ otherwise. The function $$g(x) = f(x) - f(x-1)$$ does the thing.

0
On

What you draw looks rather like a piece of sine function in between constant "pieces".

Read here (I think it might be quite relevant for you): http://en.wikipedia.org/wiki/Non-analytic_smooth_function