# Given enough terms, does a taylor series become equivalent to the function it is approximating?

I've recently started learning about Taylor/Maclauren series and I'm finding it a bit hard to wrap my head around a few things.

So, if $f(x)$ is not infinitely differentiable and we construct a polynomial $p(x)$ such that $p(a) = f(a)$, $f'(a) = p'(a)$, $f''(a) = p''(a)$ etc, for all possible derivatives of $f(x)$, can we say that the functions $f(x)$ and $p(x)$ are equivalent?

Likewise, if $f(x)$ is infinitely differentiable, does the taylor series $p(x)$ become equivalent to $f(x)$ when given an infinite number of terms?

-
You'll have problems with functions like $\exp(-1/x^2)$... –  Ｊ. Ｍ. Nov 17 '11 at 2:01
For the last question, see A deceiving Taylor series‌​. –  Henning Makholm Nov 17 '11 at 2:02
What does it mean to you to say that two functions/expressions are "equivalent"? –  Gerry Myerson Nov 17 '11 at 2:18
That f(x) and p(x) will give the same output for any value of x. –  miscmanman Nov 17 '11 at 2:29

For your first question, such an $f$ will never be equal to its Taylor series for the simple fact that by assumption $f$ is not infinitely differentiable but its Taylor series (just a polynomial) is infinitely differentiable.
Your second question is more interesting. If $f(x)$ is infinitely differentiable then it may not be equal to its Taylor series anywhere! A classic example of this is the function$$f(x) = \begin{cases} e^{-1/x^2}; &x \ne 0 \\ 0; &x = 0. \end{cases}$$ You can check that all of its derivatives at zero are 0. This means the Maclaurin series is just the 0 polynomial. However, in no neighborhood of 0 is $f$ always zero, i.e. $f$ does not equal its Maclaurin series in any neighborhood. Functions that equal their Taylor series are called analytic and for real functions I don't know of an easy to check criteria for a function being analytic.
For complex functions the situation is much nicer: if a complex function is differentiable then at any point $a$ it is equal to its Taylor series centered at $a$ on the largest disk about $a$ that does not contain a singularity of the function.