Can the “radius of analyticity” of a smooth real function be smaller than the radius of convergence of its Taylor series without being zero?

Does there exist an infinitely differentiable function $f:U\to\mathbb{R}$, where $U$ is open subset of $\mathbb{R}$, such that

  1. the Taylor series of $f$ at $x=x_0\in U$ has radius of convergence $R>0$
  2. $f$ equals its Taylor series only on the subinterval $(x_0-r,x_0+r)$, where $\color{red}{0<}r<R$

The customary examples of smooth real functions that fail to be analytic, e.g. $e^{-1/x}$ or $e^{-1/x^2}$ at $x=0$, have $R=\infty$ but $r=0$. The substance of the question is whether we can find a less extreme example for which analyticity at $x=x_0$ gives out only at a nonzero radius smaller than the radius of convergence of the Taylor series.

Note: I don’t really know complex analysis, but I know that the easiest path to whatever the truth is here is probably through the complex domain.

Solutions Collecting From Web of "Can the “radius of analyticity” of a smooth real function be smaller than the radius of convergence of its Taylor series without being zero?"

$\newcommand{\Reals}{\mathbf{R}}$Yes: Fix $r > 0$. The function $f:\Reals \to \Reals$ defined by
$$
f(x) = \begin{cases}
0 & |x| \leq r, \\
e^{-1/(|x| – r)^{2}} & |x| > r,
\end{cases}
$$
has Taylor series equal to $0$ (radius $\infty$), but agrees with its Taylor series only on $(-r, r)$.

If you want finite radius instead, add your favorite analytic function with radius $R > r$, e.g.,
$$
g(x) = \frac{1}{x^{2} + R^{2}}.
$$