Let $$f(x)=(x^2-1)^2\,,\quad g(x)=x^2$$ for $x>0$. Their plots cross at two points, the largest is $x_0=\frac{1+\sqrt 5}{2}$.
$g(x)$, in purple: $f(x)$, black dot: $x_0$" />
I would like to build a smooth function $F\in C^\infty(0,\infty)$ such that $$ F(x) \,=\,\begin{cases} \,f(x) &\textrm{for } x\geq x_0+\delta\\[4pt] \,g(x) &\textrm{for }0<x\leq x_0-\delta \end{cases} $$ for some small $\delta>0\,$. In other terms I have to interpolate on the interval $[x_0-\delta,\,x_0+\delta]$ respecting infinitely many conditions at the endpoints: $$ F^{(k)}(x_0+\delta)=f^{(k)}(x_0+\delta) \;,\quad F^{(k)}(x_0-\delta)=g^{(k)}(x_0-\delta) $$ for all $k\in\mathbb N\,$. Questions:
- Does $F$ exist?
- Is it possible to write it explicitely?
- Does asking only $F\in C^2(0,\infty)$ make things easier?
- Can I require that $F$ is convex on $(0,\infty)$ ?
Edit. In a previous answer, that has been deleted, it was suggested to take $$ F(x) \,:=\, (1-h(x))\,g(x)\,+\, h(x)\,f(x) $$ setting $h(x):=0$ for $x<x_0-\delta$, $h(x):=1$ for $x>x_0+\delta$, and $$ h(x) \,:=\, \exp\bigg(-\frac{1}{x-(x_0-\delta)}\;\exp\bigg(-\frac{1}{(x_0+\delta)-x}\bigg)\bigg)$$ for $x_0-\delta\leq x\leq x_0+\delta\,$. This choice of $F$ is $C^\infty(0,\infty)$, but it is not convex.
Edit2. As suggested in the comments, I tried to compute $5^{th}$ degree polynomial interpolation, namely $$ F(x)= c_0+c_1 x+c_2x^2+c_3x^3+c_4x^4+c_5x^5\,, \quad x\in[x_0-\delta,x_0+\delta]$$ where the six coefficients are chosen to verify six conditions: $$ F^{(k)}(x_0-\delta)=g^{(k)}(x_0-\delta) \,,\quad F^{(k)}(x_0+\delta)=f^{(k)}(x_0+\delta)\,,\quad k=0,1,2 \;.$$ For $\delta=\frac{1}{10}$, the resulting function turns out to be $C^2$ and convex on $(0,\infty)$, with $F''\geq g''$. Is there a way to prove this without computing the interpolating polynomial?