Let there be a decomposition $φ(x)=\displaystyle\sum_{n=1}^\infty c_n\sin{nx}$ on the segment $[0,π]$, and on our segment $φ(x)≥0$. How do I prove that the series $\displaystyle\sum_{n=1}^\infty c_ne^{-n^2} \sin{nx}$ converges to a non-negative function on $[0, π]$?
Let me give a solution for the case of a continuous piecewise smooth function $φ(x)$. Consider a boundary value problem:
$$u_t=u_{xx},\,0\lt x \lt \pi, \, t\gt 0$$
$$u(x,0)=φ(x)$$
$$u(0,t)=u(\pi,t)=0.$$
According to the maximum principle for the heat equation, the continuous solution $u(x,t)$ reaches its maximum and minimum values only at the boundary of the considered region, i.e. or at $x=0$, or at $x=π$, or at $t=0$.
It remains to write down the solution to the problem by the method of separation of variables(due to the conditions on $φ(x)$, this solution will be continuous): $u(x,t)=\displaystyle\sum_{n=1}^\infty c_ne^{-n^2t} \sin{nx}$, where $\displaystyle\sum_{n=1}^\infty c_n\sin{nx}=φ(x)$ and substitute $t=1$.
The task seemed to me beautiful. It was not possible to find any "direct" solution (even in the class of continuous functions). If someone suggests one, I will accept it as an answer.
Fix $\epsilon$.
Since $\phi\in L^2$ and continuous functions are dense in $L^2$, there exists $f\in C([0,\pi])$ such that $\|f-\phi\|_2\leq\epsilon$. Moreover, since $\phi\geq0$, the function $f^+=\max{(f,0)}$ must be closer to $\phi$…thus we may assume $f\geq0$ as well. (Likewise for vanishing at $\{0,\pi\}$.)
Write $f(x)=\sum_{n=1}^{\infty}{d_n\sin{nx}}$ formally; then $d_n=\langle f,\sin{(n(\cdot))}\rangle$ and $c_n=\langle\phi,\sin{(n(\cdot))}\rangle$. By Cauchy-Schwarz, \begin{align*} |d_n-c_n|&=|\langle f-\phi,\sin{(n(\cdot))}\rangle \\ &\leq\|f-\phi\|_2\|\sin{(n(\cdot))}\|_2 \\ &\leq\epsilon\cdot1 \end{align*} (I may have dropped a constant or two.)
In fact, the series for $\phi$ converges a.e. by Carleson's theorem. So \begin{align*} \phi(x)=\sum_{n=1}^{\infty}{c_ne^{-n^2}\sin{nx}}&\geq\sum_{n=1}^{\infty}{\left(\begin{cases} d_n-\epsilon&\sin{nx}\geq0\\ d_n+\epsilon&\sin{nx}<0 \end{cases}\right)e^{-n^2}\sin{nx}} \\ &=\sum_{n=1}^{\infty}{d_ne^{-n^2}\sin{nx}}-\epsilon\sum_{n=1}^{\infty}{e^{-n^2}|\sin{nx}|} \end{align*} Call the first term $u$ and the second $\epsilon\theta$. By the argument you give in the problem, $u\geq0$. Taking $\epsilon\to0^+$, it suffices to find a uniform bound on $\theta$.
But $$\sum_{n=1}^{\infty}{e^{-n^2}|\sin{nx}|}\leq\sum_{n=1}^{\infty}{e^{-n^2}}\leq\sum_{n=1}^{\infty}{e^{-n}}=\frac{1}{e-1}$$ So we're done.