# Find all $\theta$ such that sin$\theta$ and cos$\theta$ are both rational number.

Find all $\theta$ such that sin$\theta$ and cos$\theta$ are both rational number.

I thought this question might have been asked by someone else, but I couldn't find any.

Currently I'm studying Pythagorean triple, so naturally I put $X$=cos$\theta$ and $Y$=sin$\theta$, then

$$X^2 +Y^2 =1: X,~Y \in \Bbb{Q}$$

By using graph or from the graphical proof of Pythagorean triple, one can show that

$$X=\frac{a^2-b^2}{a^2+b^2},~Y=\frac{2ab}{a^2+b^2}$$

where $(a, b)=1$. But then, we have to find $\theta$ which makes $X$ and $Y$ in that form. So I got stuck. I've thought of using the inverse trigonometric function, but we still have two equations then. So I was wondering if there is any simpler way to express $\theta$ which satisfies the given condition. I'm even more confused because I don't have the answer!

Thanks.

-
Any $$\theta=\arctan\frac{2ab}{a^2-b^2}$$ with $b\ne0,a$ integers will satisfy this – lab bhattacharjee Nov 17 '13 at 6:05
@labbhattacharjee Yeah... I also think this is the best answer. I actually expected somewhat more 'integer like' answer since I'm studying baby number theory. Thanks. – Taxxi Nov 17 '13 at 6:11
I don't understand 'baby number theory' and 'integer like' answer. – lab bhattacharjee Nov 17 '13 at 6:12
@labbhattacharjee I mean since I'm studying easy elementary number theory problems, most of the solutions were in the form of integers or rational numbers, not like the solution of this question. That was why I was baffled at this question and wondering if there might be more simple answer (since I don't have the solution). – Taxxi Nov 17 '13 at 6:17
It can be shown that apart from the obvious ones, none are of shape $r\pi$ where $r$ is rational. – André Nicolas Nov 17 '13 at 7:10

$$2, \; r-\frac 1r, \; \text{ and } r + \frac 1r$$