What's an example of a function whose Taylor series converges to the wrong thing?

If you take the classic non-analytic smooth function: $e^{-1/t}$ for $t \gt 0$ and $0$ for $t \le 0$ then this has a Taylor series at $0$ which is, err, $0$. However, the function is non-zero for any positive number so it does not agree with its Taylor series in any neighbourhood of $0$.


Another thing to note is that there are smooth functions whose Taylor series do not converge to the function in a neighborhood of ANY point! An easy example of this can be found here:

http://web.archive.org/web/20141230224759/http://www.math.niu.edu/~rusin/known-math/99/nowhere_analy

The example looks as follows:

$$F(x) = \sum_{n=0}^{\infty} \frac {\exp(2^n i x)} {n!}, \quad F^{(k)}(x) = \sum_{n=0}^{\infty} (2^n i)^k \frac {\exp(2^n i x)} {n!}$$

For every $k$, the above series converges absolutely for real $x$, so the function $F$ is smooth. On the other hand, if $x=a/2^N$ for some integers $a$ and natural number $N$, then for $k\in 4\mathbb{Z}$ we have

$$|F^{(k)}(x)| \geq \frac {2^{Nk}} {N!} - \sum_{n<N} \frac {2^{nk}} {n!} > \frac {2^{Nk-1}} {N!}$$

provided that $2^k > 2N$. Therefore, the Taylor series of $F$ has convergence radius $0$ at $x$. Since the set on which $F$ is analytic is open, this means that $F$ is nowhere analytic on $\mathbb{R}$.


I always thought the classic non-analytic smooth function was $\exp(-1/t^2)$ over the reals. This example is probably more satisfying to students (which is why you see it in texts) because when you look at that expression it's not obvious that anything funny should be happening at 0, whereas that's not so obvious for Andrew's piecewise-defined functions