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.
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]$?

You can use the “smooth step function” $\phi$ defined as $$ \psi(t) = \begin{cases} e^{-1/t} & t >0\\ 0 & t \leq 0 \end{cases} \\ \phi(t) = \frac{\psi(t)}{\psi(t)+\psi(1-t)} $$ from Example of a smooth 'step'-function that is constant below 0 and constant above 1. $\phi$ is smooth, equal to $0$ on $(-\infty, 0]$, equal to $1$ on $[1, \infty)$, and strictly increasing on $(0, 1)$.
Together with an affine transformation from the interval $[x_0, x_1]$ to $[0, 1]$ we get that $$ h(x) = f(x) + (g(x) - f(x)) \phi \left( \frac{x-x_0}{x_1 - x_0}\right) $$ has the desired properties.