From the last two equations,
, so we have (by the general solutions to trig equations)
or
for some integer
.
So either
or
.
The former implies that
, so it cannot be true.
Looking at the first two equations,
so
.
Now changing
can only flip the sign of the LHS, since
. Because we really only care about
, we can just pick
for simplicity. Make the substitution
to get
.
We can expand the LHS using angle sum formulae. Then use
to write everything in powers of
:
Now
cannot be true, otherwise
would be an odd multiple of
and so
.
Thus
and so
.
for
any integer
.
The positive case with
is numerically equivalent to
. Put these in a calculator to convince yourself this is true (or even better, try proving it).
At this point we're done, but if you want to graph these results you can solve for
by using
.