Number theory problem, trigonometry Suppose $p$ and $q$ are relatively prime positive integers, and that $x$ is a positive rational number. Given that $x \in [-\frac{1}{2}, \frac{1}{2}]$ and $$q\sin{\pi x} = p$$ how can we compute $p, q$ and $x$? 
I'm not really sure how to approach this. Of course we must have $q > p$; however to find $x$ it would seem that one must pick a standard reference angle, for example by setting $x = 0.1$. This leads to surds and the like, which won't work. The constraints in the problem also prevent us from selecting something like $x = 1/2, p = 1, q = 2$.  

You will find a complete answer in the Wikipedia article on Niven's Theorem.
The only rational $x$ between $0$ and $1/2$ such that $\sin(\pi x)$ is rational are $x=0$, $1/6$, and $1/2$. You can deduce the answer for negative $x$. 
