TITLE: Solving $a\sin \theta + b\cos \theta + c\sin 2\theta + d\cos 2\theta = k$
QUESTION [7 upvotes]: I have to solve (for $\theta$) an equation of the form:
$$a\sin \theta + b\cos \theta + c\sin 2\theta + d\cos 2\theta = k$$
I'm only interested in real-valued solutions where $0 ≤ \theta ≤ \frac\pi4$, if one exists, and also knowing if none exist.
Also, $a$, $b$, $c$, $d$, and $k$ are rational numbers.
Is there an "easy" way to attack this problem?
The only strategy I could come up with to express all sines and cosines
as $\sin \theta$, and then square the equation to get rid of square roots, and then solve a quartic equation, and then check the legitimacy of the roots.
Is there an easier approach, perhaps one that is more customized to this problem?

REPLY [4 votes]: Set $x=\sin\theta$, $y=\cos\theta$ and get the conic 
$$ax+by+2cxy+dx^2-dy^2=k,$$ which has solutions to your equation where it intersects the unit circle.
Since $(2c)^2-4d(-d)=4(c^2+d^2)>0$, we're looking at a hyperbola. (In fact, since the coefficients of $x^2$ and y^2$ are negatives of eachother, we're looking at a hyperbola whose asymptotes intercept at right angles.) 
Everything is still kind of a mess though.  If we rotate by $\frac{\arctan(-d/c)}{2}$ we should get a hyperbola that has its asymptotes running parallel to the new $u$- and $v$- coöridinate axes with equation $2c'uv+b'u+a'v=k$, which, after some more poking is 
$$\left(u-\frac{-a'}{2c'}\right)\left(v-\frac{-b'}{2c'}\right)=\frac{2c'k+a'b'}{4c'^2}. $$
If the center of the hyperbola is very far away from the unit circle you can probably check for intersection just by checking if the asymptotes intersect and then looking nearby.