# checking if a function is positive using Fourier coefficients

Given a function $$f(x) = \sum_{k=0}^N a_k\ \sin(k\pi x)$$ defined over the region $S = [0, 1]$, is there some way to check if $f(x) \geq 0$ for all $x \in S$ using the coefficients $\{ a_k;\ k \leq N \}$? In particular, I was hoping there'd some inequality involving the coefficients that'll enable us to check this quickly.

-
I'm not sure in general, but without at least some assumption of continuity, it's certainly not possible; you can see this by changing $f$ on some set of 0 measure (like say a point). –  anonymous Jan 13 '13 at 14:16
Positivity of polynomials, both algebraic and trigonometric, is not easy to determine. There's a book on this subject. // @anonymous The function is explicitly written as a trigonometric polynomial. –  user53153 Jan 13 '13 at 16:09

I do know a few cases in which positivity can be proved. For instance if for each $k$, $a_k \gt 2 a_{k+1}$. A more general situation in which positivity holds is if for some $s \in (0,1)$ one can write $a_k=c_k s^k$ where $c_k-(1+s)c_{k+1}+s c_{k+2} \gt 0$.