Let $0\leq f\in\mathscr{D}(\mathbb{R}^n)$. As shown e.g. by J.-M. Bony, F. Broglia, F. Colombini and L. Pernazza, *Nonnegative functions as squares or sums of squares*, [J. Funct. Anal. **232** (2006) 137-147](http://www.cmls.polytechnique.fr/perso/bony/BBCP_jfa.pdf) (see also [this MO question](https://mathoverflow.net/questions/105438/square-root-of-a-positive-c-infty-function) and [this math.SE question](https://math.stackexchange.com/questions/186433/square-root-of-compactly-supported-c-infinity-function)), not every such an $f$ is of the form $f=g^2$ for $g\in\mathscr{D}(\mathbb{R}^n)$ or even a finite sum of such. On the other hand, as mentioned in the paper above, C. Fefferman and D. H. Phong sketched a proof (*On positivity of pseudo-differential operators*, Proc. Natl. Acad. Sci. U.S.A. **75** (1978) 4673-4674) of the fact that any $0\leq f\in\mathscr{C}^\infty(\mathbb{R}^n)$ can be written as a sum of squares $$f=\sum^k\_{j=1}g\_j^2$$ with $g\_j\in\mathscr{C}^{1,1}(\mathbb{R}^n)$ (i.e. $g\_j$ is a differentiable function whose derivatives are locally Lipschitz) for all $1\leq j\leq k$ for some $k\in\mathbb{N}$. This fact was a key ingredient of the proof of the important inequality for scalar pseudodifferential operators with non-negative symbols that bears their name. For a modern, more detailed proof of the above formula, see N. Lerner, *Some Facts About the Wick Calculus*, in L. Rodino, M.W. Wong (eds.), *Pseudodifferential Operators: Quantization and Signals*, Lectures given at the C.I.M.E. Summer School held in Cetraro, Italy June 19–24, 2006 (Springer Lecture Notes in Mathematics **1949**, 2008), pp. 135-174, particularly Theorem 5.2, pp. 167-172, and the discussion right after Theorem 1.1 in the paper by Bony *et alii* above on page 139. It immediately follows by multiplication by squares of smooth bump functions that the $g\_j$'s may be chosen to be compactly supported if $f\in\mathscr{D}(\mathbb{R}^n)$. Bony *et alii* showed above that this regularity for $n\geq 4$ is sharp.


All this leads naturally to the following



> 
> **Question:** Is every $0\leq f\in\mathscr{D}(\mathbb{R}^n)$ the *limit of a 
>  sequence* of sums of squares *in* $\mathscr{D}(\mathbb{R}^n)$ in the latter's topology?
> 
> 
> 


In other words, is the cone of non-negative elements of $\mathscr{D}(\mathbb{R}^n)$ the (sequential) closure of the cone of sums of squares in $\mathscr{D}(\mathbb{R}^n)$?


I am particularly interested in arguments that do not rely on the result by Fefferman and Phong.



> 
> **EDIT - Follow-up subquestion:** (suggested by André Henriques) Is every $0\leq f\in\mathscr{D}(\mathbb{R}^n)$ the limit of an *increasing* sequence of sums of squares in $\mathscr{D}(\mathbb{R}^n)$ in the latter's topology? Particularly, can $f$ be written as $$f=\sum^\infty\_{j=1}g\_j^2$$ with $g\_j\in\mathscr{D}(\mathbb{R}^n)$ for all $j$ and convergence in $\mathscr{D}(\mathbb{R}^n)$?
> 
> 
> 



Is every non-negative test function the limit of a sequence of sums of squares of test functions?
Given $f\in\mathcal{D}(\mathbb{R}^n)$, $f\ge0$ choose a $g\in\mathcal{D}(\mathbb{R}^n)$, $g\ge0$ such that $\mathrm{supp}(f)\subset \{g>0\}$, and let $\epsilon>0$. Then $\sqrt{f+\epsilon^2 g^2}$ is $C^\infty$: by composition, at any point where $g(x)>0$, and because it locally coincides with $\epsilon g$, at any point where $g(x)=0$. 


