positive sum of sines This was asked but never answered at MSE.
Let $f(x) = \sin(a_1x) + \sin(a_2x) + \cdots + \sin(a_nx)$, where the $a_i$'s
represent distinct positive integers.  Suppose also that $f(x)$ satisfies the inequality  $f(x) \geq 0$ on the open interval  $0 < x < \pi.$ 
In the case n=1 of a single summand it is obvious that only $f(x) = \sin x$ satisfies the condition.  For two summands, a short argument shows that only
$f(x) = \sin x + \sin(3x)$ works.  Following up on this, we define $g_n(x) = \sin x 
+ \sin(3x) + \sin(5x) + \cdots + \sin((2n-1)x)$.  Computing the sum explicitly yields $g_n(x) = \frac{\sin^2(nx)}{\sin x}$ which makes it clear that $g_n(x)$ is
nonnegative on $(0,\pi).$  
Questions: (1) Are there any other examples of $f(x)$ as above besides $g_n(x)$?
If so, can one classify them all?
(2)  The special case $f(x) = g_1(x) = \sin x$ satisfies the stronger condition of being strictly positive over $0 < x < \pi$.  Is $\sin x$ the unique
such instance of $f(x) > 0$ on $(0,\pi)$?
Thanks
 A: Let me begin by restating your conjecture. Consider the sum
$$S(x):=\sum_{j=1}^nb_j\sin jx,\quad b_n=1,\quad b_j\in\{0,1\}.$$
Then $S(x)\geq 0$ on $[0,\pi]$ if and only if $b_j=1$ for all odd $j$ and $b_j=0$ for all even $j$ (in particular, $n$ is odd).
First of all, notice that $S(x)\geq 0$ on $[0,\pi]$ if and only if $S^*(x)\geq 0$ on $[-\pi,\pi]$, where
$$S^*(x):=2S(x)\sin x=\sum_{j=1}^nb_j\left(\cos(j-1)x-\cos(j+1)x\right)\geq 0.$$
Second, we must have $b_1=1$, by the well-known theorem that a trigonometric polynomial without a constant term must change sign on $[-\pi,\pi]$.
(This is because its integral over $[-\pi,\pi]$ equals zero).
Now transform $S^*$ as follows:
$$S^*(z)=1-\cos(n+1)x+A(x)+B(x),$$
where 
$$A(x)=b_2\cos x+(b_3-1)\cos 2x+(1-b_{n-2})\cos(n-1)x-b_{n-1}\cos nx,$$
and
$$B(x)=\sum_{j=3}^{n-2}(b_{j+1}-b_{j-1})\cos jx.$$
Let us set $z=\exp(ix),\;|z|=1$ and consider the first two summands in $S^*$:
$$1-\cos(n+1)x=(2-z^{n+1}-z^{-n-1})/2.$$
This is non-negative and has double zeros at the roots $z_k$ of degree $n+1$ of unity.
So for $S^*$ to be non-negative, it is necessary that $A+B$ be non-negative at
the points $x_k=2\pi k/(n+1)$ corresponding to $z_k$.
On the other hand, we have
$$\sum_{k=0}^n \left(A(x_k)+B(x_k)\right)=0, \quad x_k=2\pi k/(n+1),$$
by the well-known "orthogonality relations",
$$\sum_{k=0}^n z_k^m=0,\quad\mbox{when}\quad  |m|\leq n.$$
Therefore $A+B$ must be zero at all $n+1$-st roots of unity, moreover,
all these zeros must be multiple (if not, $S^*(x)$ will change sign near some $x_k$), from which we conclude that $A+B\equiv 0$, because a non-zero trigonometric polynomial of degree $n$ cannot have $n+1$ multiple zeros. This means that 
$$b_2=0,\; b_3=1,\; b_{n-2}=1,\; b_{n-1}=0,$$
and $b_{j+1}=b_{j-1}$ for all $j\in[3,n-2]$. This proves your statement.
A: A function can be expanded in a sine series if and only if it is odd. So, any polynomial in your function(s) with all exponents odd and all coefficients positive will satisfy your criterion.
A: This is a too long remark:


*

*The problem is similar to the lonely runner conjecture:


Lonely runner conjecture
  $$\max_{t\in \mathbb R}( \min_{v_1,...,v_j\in[0,1]} ( \min_{1\leq i\leq n} \|v_it\|_{\mathbb Z})) = \frac{1}{n+1}$$
  Where $v_i=\frac{q_i}{p_i}\in \mathbb Q$, $\forall 1\leq i\leq n$.

The point is $\sin(x)=\Im(e^{ix})$, so take $$g_n(x)=\sin(a_1x)+...+\sin(a_nx)$$
Then $g_n(x)=\sum_{1\leq j\leq n}\Im(e^{ia_jx})$. We could understand,
$$\Im:\mathbb S_1\to [-1,1]$$
As a deformation of metric space with small distortion. 


*It is not difficult to find the nontrivial part of your problem must assume $a_i$ is a rational multiplier of $\pi,\,\forall 1\leq i\leq n$. By the continued fractional argument or Dirichlete's approximation theorem you could always change your number from an irrational multiplier of $\pi$ to a rational multiplier of $\pi$ to optimize your tuple $(a_1,...,a_n)$, because we only need to consider the worst situation.

*Now if lonely runner conjecture is true we could say some thing for your problem, due to it carollay is there $\exists x$ such that $\{\pi a_ix\}$ constitute the vertex of a $n$ regular polygon on $S^1$, at this point, the value $g_n(x)=0$ and so we know $g_n'(x)\geq 0$.

*in fact we can get some lower bound estimate of $g_n(x)$ by combine a nontrivial estimate of Lonely runner conjecture, but this estimate always less than 0, so do not handle this problem and until now there is only more or less trivial estimate of LRC.
Forgive me, I can not go further temporarily...
