How to construct a non-piecewise differentiable S curve with constant quick turning flat tails and a linear slope? I need to find an example of a non-piecewise differentiable $f:\mathbb{R}\to\mathbb{R}$ such that
$$
\begin{cases}
     f(x)=C_1 &\text{ for } x<X_1,\\
     C_1 < f(x) < C_2 &\text{ for } X_1 < x < X_2,\\
     f(x)=C_2 &\text{ for } X_2<x.
\end{cases}
$$
For example, $\log(1+e^{Ax})$ is sort meets some characteristics in that 


*

*quickly flat lines around 0 for large A

*has a linear slope for 0 < x < Xc


But it 


*

*does not flatline for Xc < x

*I can't seem to control the slope of the linear section


So am looking for something different
Is there some other differentiable function that exhibits the above behavior?

After a bit of trying to mix various segments I came up with the following for my problem
f(x) = (1/(1+e^(100*(x-1))))(1/(1+e^(-100(x+1))))x-(1/(1+e^(100(x+1))))+(1/(1+e^(-100*(x-1))))
Which atleast seems to be in the right direction to meet all the requirements


*

*Has a slope between -1 to +1.

*Flatens quickly > 1 and < 1. How quickly can be controlled by changing the constant 100 

*is continuous and not pieceswise

*is differentiable


I still haven't generalized it yet, but the general idea is to build it out of 3 segments


*

*(1/(1+e^(100*(x-1))))(1/(1+e^(-100(x+1)))) multiplied by a slope and X for the sloping part

*bottom flatline -(1/(1+e^(100*(x+1))))

*top flat line (1/(1+e^(-100*(x-1))))

