# Why doesn't the Stone-Weierstrass theorem imply that every function has a power series expansion?

I know that not every function has a power series expansion. Yet what I don't understand is that for every $$C^{\infty}$$ functions there is a sequence of polynomial $$(P_n)$$ such that $$P_n$$ converges uniformly to $$f$$. That's to say :

$$\forall x \in [a,b], f(x) = \lim_{n \to \infty} \sum_{k = 0}^{\infty} a_{k,n}x^k$$

But then because it converges uniformly why can't I say that :

$$\forall x \in [a,b], f(x) = \sum_{k = 0}^{\infty} \lim_{n \to \infty} a_{k,n}x^k$$

And so $$f$$ has a power series expansion with coefficients: $$\lim_{n \to \infty} a_{k,n}x^k$$.

• Uniform convergence does not even guarantee the existence of $\lim_{n\to \infty} a_{k,n}$. If $p(x)=\sum a_kx^{k}$ then $a_i=p^{(i)} (0)/(i!)$ but Uniform convergence of continuous functions does not give convergence of derivatives. – Kavi Rama Murthy Oct 11 '18 at 11:46
• Note that it's also possible to "have a power series" for a function (like the Taylor series) and yet have it converge to the function only at a single point. The "bathtub" function $f(x) = \begin{cases}0 & x = 0 \\ e^{-x^2} & x \ne 0\end{cases}$ is a good example: its Taylor series $T$ at $x = 0$ exists and has all coefficients zero, but $f(x) = T(x)$ only for $x = 0$. – John Hughes Oct 11 '18 at 15:00
• @JohnHughes I think you meant $f(x) = \begin{cases}0 & x = 0 \\ e^{-1/x^2} & x \ne 0\end{cases}$. What you wrote is actually discontinuous at $x=0$. – leftaroundabout Oct 11 '18 at 15:52
• @leftaroundabout: you're completely correct. My fingers were on autopilot while my brain was in neutral. – John Hughes Oct 11 '18 at 16:52

Short answer. The sequence of polynomials guaranteed by the Stone Weierstrass theorem may not be constructible by appending terms of higher and higher order. The early coefficients can vary as the sequence grows. So you don't have the sequence of partial sums of a power series.

$$\lim_{n\to\infty}\left(\lim_{k\to\infty} a_{n,k}\right)$$ is, in general, not the same as $$\lim_{k\to\infty}\left(\lim_{n\to\infty} a_{n,k}\right)$$ and in order to switch the order of your infinite sum (which is in its definition a limit) and your limit, you would need something like that.

• Yes, but because I have the uniform convergence the switch of limits should work? – auhasard Oct 11 '18 at 11:41
• @auhasard It should? Why? – 5xum Oct 11 '18 at 11:44
• You have convergence uniform with respect to $x$, which is irrelevant for interchanging sum on $k$ with limit on $n$. – GEdgar Oct 12 '18 at 12:18

I'm not sure what sense you can give to $$\lim_{n\to\infty}a_{k,n}$$ There's nothing in the Stone-Weierstrass that can even hint to the existence of such limit.

The traditional example of a $$C^\infty$$ function that's not everywhere analytic well illustrates this. Try and find a polynomial approximation for $$f(x)=\begin{cases} 0 & x=0 \\[4px] e^{-1/x^2} & x\ne0 \end{cases}$$ and you'll realize that the exchange is not possible, because the limit under scrutiny cannot exist.

• By what argument would you conclude that the limit under scrutiny cannot exist? Sure, the Taylor series doesn't converge to the function, but that's because Taylor expansion is stupid. An e.g. Legendre polynomial expansion does converge to the function though, given any finite choice of interval. Pretty well in fact, practically speaking. I'm nor sure about the “uniform” part. – leftaroundabout Oct 11 '18 at 15:59
• @leftaroundabout The limit might exist for a particular polynomial approximation. It doesn't in general. – egreg Oct 11 '18 at 16:13

Yes, but because I have the uniform convergence the switch of limits should work?

As far as I understood correctly the theorem only says that the entire expression converges uniformly. It does not say anything about the convergence of each element inside the sum.

However a sum of functions can be uniformly convergent even if the functions inside the sum are not converging at all!

Counterexample:

$$g_{n,k}(x)=\begin{cases} nx\text{ if }k=1\\ (-nx)\text{ if }k=2\\ 0\text{ else}\\ \end{cases}$$

$$f_n(x)=\sum\limits_{k=0}^{\infty}g_{n,k}(x)$$

Then:

$$f_n(x)=(nx-nx)=0$$ which means that the value of $$f_n(x)$$ is independent of $$n$$ which means that all elements in the function series are the same function and therefore the function series converges uniformly to $$f(x)=0$$.

Please also note that $$\lim\limits_{x\to\pm\infty}f(x)=0$$ in this example.

The single elements in the sum ($$g_{n,1}(x)=nx$$ and $$g_{n,2}(x)=-nx$$) however are diverging both for $$n\to\infty$$ and for $$x\to\pm\infty$$.