I have two functions $f(x)$ and $g(x)$, and I am looking for a continuous function $h(x)$, or rather $\hat{h}(x)$, which smoothly transitions from $f$ to $g$ over a fixed interval $[x\_0,x\_1]$, i.e.

$$h(x)=\begin{cases}f(x), &x \le x\_0\\ \hat{h}(x), &x\_0 < x < x\_1\\ g(x) ,& x\_1 \le x\end{cases}$$

On here <https://kitchingroup.cheme.cmu.edu/blog/2013/02/27/Smooth-transitions-between-two-constants> I found the example of
$$h(x) \ =\ f(x) \ +\ \Big(g(x)-f(x)\Big) \cdot \left(1 - \frac{1}{1 + \exp\{-(x\_c-x)/a\}}\right)$$

which gives e.g.

      [![sample plot](https://i.stack.imgur.com/Grbya.png)](https://i.stack.imgur.com/Grbya.png)

This is a very nice transition function, but the problem with this approach is that there is only one center point $x\_c$. That is, the transition is not perfectly bound between two points $x\_0$ and $x\_1$, but rather converges to $0$ as we move away from $x\_c$.

Can this idea be tweaked to support a fixed transition interval $[x\_0,x\_1]$?