Approximation of smooth compactly supported functions on $\mathbb{R}^2$ using sums of products of one variable functions Let $f \in C^{\infty}(\mathbb{R}^2)$  be smooth and compactly supported. Can we approximate $f(x,y)$ by sums of the form $\sum_{i=1}^m g_i(x) h_i (y)$ where $g_i, h_i \in C^{\infty}(\mathbb{R})$ are smooth with compact support.
Exact formulation:
Suppose $f \in C^{\infty}(\mathbb{R}^2)$ with $supp(f)\subseteq [a,b] \times [c,d]$, and $\varepsilon > 0$. Can we find a sum $\sum_{i=1}^m g_i(x) h_i (x)$ such that $supp(g_i) \subseteq [a,b]$ and $supp(h_i) \subseteq [c,d]$, with
$\| f(x,y)- \sum_{i=1}^m g_i(x) h_i (y)\|_\infty < \varepsilon$ ?
 A: As everyone says, yes it is possible. Here is an explicit way to do it though.
Take a smooth, orthonormal basis of $L^2([a,b])$. Then project the function $f$ onto each of these basis elements. 
More precisely, let $\left\{a_i(x)\right\}$ denote one such basis. Let $$m_i(y) = \frac{\int_a^b f(x,y) a_i(x) dx}{(\int_a^b a_i(x)dx)^2}$$ Then $$f(x,y) = \sum_i m_i(y) a_i(x)$$ on $[a,b]$.
Take a partition of unity of the interval $[a,b]$ called $\left\{ p_i(x) \right\}$ so that for each $n\in \mathbb{N}$ we have $$ \sum_{i=1}^n p_i(x) = \left\{ \begin{array}{cl} 1 & \textrm{ for } x\in [a + \frac{b-a}{2^n},b- \frac{b-a}{2^n}] \\ 0 & \textrm{ otherwise} \end{array}\right.$$
Then I believe $$\sum_{i=1}^n m_i(y) \left[ a_i(x) \sum_{j=1}^n p_j(x) \right]$$ is the approximation you are looking for.
A: The situation is even much better, because $C^\infty([a,b]\times [c,d])=C^\infty([a,b])\tilde{\otimes}_\pi C^\infty([c,d])$ (the completed projective tensor product) and due to a celebrated result of Grothendieck every Element of $X\tilde{\otimes}_\pi Y$ for two Frechet spaces is even a series $\sum\limits_{n=0}^\infty x_n\otimes y_n$ which converges in the topology of the projective tensor product. In the concerte situation this implies uniform convergence not only of the functions but of all partial derivatives.
