Solving a trigonometric equation linear in \sin \theta and \cos \theta
Solve
a\sin\theta+b\cos\theta=c (9)
where a, b, and c are constant and either a\neq0 or b\neq0.
Divide each side of equation (9) by {\sqrt{a^{2}+b^{2}}}\,. Then
{\frac{a}{\sqrt{a^{2}+b^{2}}}}\sin\theta+{\frac{b}{\sqrt{a^{2}+b^{2}}}}\cos\theta={\frac{c}{\sqrt{a^{2}+b^{2}}}} (10)
There is a unique angle \phi,0\,\leq\,\phi\lt 2\pi, for which
\cos\phi={\frac{a}{\sqrt{a^{2}+b^{2}}}}\quad{\mathrm{and}}\quad\sin\phi={\frac{b}{\sqrt{a^{2}+b^{2}}}} (11)
Figure 30 shows the situation for a\gt0 and b\gt0. Equation (10) may be written as
\sin\theta\cos\phi+\cos\theta\sin\phi={\frac{c}{\sqrt{a^{2}+b^{2}}}}or, equivalently,
\sin\left(\theta+\phi\right)\,={\frac{c}{\sqrt{a^{2}+b^{2}}}} (12)
where \phi satisfies equation (11).
If |c|\gt {\sqrt{a^{2}+b^{2}}}, then \sin\left(\theta+\phi\right)\gt 1 or \sin\left(\theta+\phi\right)\lt -1, and equation (12) has no solution.
If |c|\leq{\sqrt{a^{2}+b^{2}}}, then the solution of equation (12) are
\theta+\,\phi=\sin^{-1}\frac{c}{\sqrt{a^{2}+b^{2}}}\;\;\;\mathrm{or}\;\;\;\theta+\,\phi=\pi-\sin^{-1}\frac{c}{\sqrt{a^{2}+b^{2}}}Because the angle \phi is determined by equations (11), these give the solutions to equation (9).