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

Can anyone provide an example of a real-valued function f with a convergent Taylor series that converges to a function that is not equal to f (not even locally)?

-

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

-
Typo: you mean $e^{-1/t}$ for $t>0$. –  Kevin O'Bryant Nov 26 '09 at 21:59
Whoops! Thanks for pointing that out. I've corrected it (and converted to jsMath). –  Andrew Stacey Nov 29 '09 at 19:30
$e^{-1/t^2}$ is a bit nicer, as one can use a single formula for all real numbers. –  Zoran Skoda Mar 24 '10 at 20:17
All real numbers except zero! –  Andrew Stacey Mar 25 '10 at 1:21

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://www.math.niu.edu/~rusin/known-math/99/nowhere_analy

-
To make students happy, though, you'll have to define $\exp(-1/0^2)$ to be 0, and you're back in piecewise-town. –  Kevin O'Bryant Nov 26 '09 at 21:58