Suppose I have some nice infinitely differentiable function $$f$$. Lets denote by $$T_{n,a}$$ Taylor polynomial of $$f$$ at $$a$$ of order $$n$$.

$$T_{n,a}(x) = a_0+a_1(x-a)+a_2(x-a)^2+...+a_n(x-a)^n$$ where $$a_k = \frac{f^{(k)}(a)}{k!}$$

Am I right that Taylor polynomial does good job of approximating function $$f$$ only in the neighborhood of $$a$$?

According to Weierstrass theorem any continuous function on the closed interval $$[a,b]$$can be approximated as closely as desired by polynomial functions.

Suppose then $$f(x) = b_0+b_1x+b_2x^2+...$$ where right side is infinite sum given by Weierstrass theorem.

And by theorem right side approximates function $$f$$ very well on the whole interval $$[a,b]$$

If I wanted to find the coefficients $$b_k$$ I would proceed just like finding Taylor coefficients and I would find that $$b_k = \frac{f^{(k)}(0)}{k!}$$

But polynomial with coefficients $$\frac{f^{(k)}(0)}{k!}$$ is Taylor polynomial of $$f$$ at $$0$$.

So I dont understand does Taylor polynomial good job of approximating function $$f$$ in the neighborhood of $$0$$ or at the whole interval $$[a,b]$$?

• Any continuous function can be approximated as closely as desired by polynomials, but 1) not every sequence of polynomials approximates the initial function (converse would be absurd, why should $\sin x$ be approximated well by polynomials $1, 1, 1, 1, \ldots$?). 2) Your $f(x)$ is not polynomial (a polynomial is a finite sum). – enedil Feb 24 at 17:40
• @Bernard, thanks, edited – Studying Optimization Feb 24 at 17:55
• @enedil 1) I didnt say any sequnce of polynomials should approximate function. 2) My question is: I constructed Taylor polynomial of function $f$ at $0$. Does this polynomial good job approximating function on the whole closed interval $[a,b]$ or only near $0$? – Studying Optimization Feb 24 at 17:55
• en.m.wikipedia.org/wiki/Flat_function – trii Feb 24 at 18:13

The approximation given by Weierstrass theorem is not based on Taylor's polynomials. Even in the case of an infinitely differentiable functions, it is possible for its Taylor's polynomial at one point to completely "forget" about the function. The best know example is due to Cauchy: take $$f(x)=e^{-1/x^2}$$ for $$x\neq 0$$ and $$f(0)=0$$. This function is infinitely differentiable at zero yet its Taylor's series at zero is identically zero, thus different from the function at any point except for $$x=0$$.
What you need is analyticity. You have to make sure (in case you want to stick to Taylor's polynomial) that the remainder in Taylor's formula converges to zero at all points of your interval as $$n\to\infty$$.