# Solving trigonometric equations of the form $a\sin x + b\cos x = c$

Suppose that there is a trigonometric equation of the form $a\sin x + b\cos x = c$, where $a,b,c$ are real and $0 < x < 2\pi$. An example equation would go the following: $\sqrt{3}\sin x + \cos x = 2$ where $0<x<2\pi$.

How do you solve this equation without using the method that moves $b\cos x$ to the right side and squaring left and right sides of the equation?

And how does solving $\sqrt{3}\sin x + \cos x = 2$ equal to solving $\sin (x+ \frac{\pi}{6}) = 1$

-
Hint: Expand $\sin(x+\frac{\pi}{6})$. –  ᴊ ᴀ s ᴏ ɴ Oct 14 '12 at 9:42
I explained the general solution in my answer here: math.stackexchange.com/a/201405/4583 –  Ayman Hourieh Oct 14 '12 at 9:51

The idea is to use the identity $\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta$. You have $a\sin x+b\cos x$, so you’d like to find an angle $\beta$ such that $\cos\beta=a$ and $\sin\beta=b$, for then you could write

$$a\sin x+b\cos x=\cos\beta\sin x+\sin\beta\cos x=\sin(x+\beta)\;.$$

The problem is that $\sin\beta$ and $\cos\beta$ must be between $-1$ and $1$, and $a$ and $b$ may not be in that range. Moreover, we know that $\sin^2\beta+\cos^2\beta$ must equal $1$, and there’s certainly no guarantee that $a^2+b^2=1$.

The trick is to scale everything by $\sqrt{a^2+b^2}$. Let $A=\dfrac{a}{\sqrt{a^2+b^2}}$ and $B=\dfrac{b}{\sqrt{a^2+b^2}}$; clearly $A^2+B^2=1$, so there is a unique angle $\beta$ such that $\cos\beta=A$, $\sin\beta=B$, and $0\le\beta<2\pi$. Then

\begin{align*} a\sin x+b\cos x&=\sqrt{a^2+b^2}(A\sin x+B\cos x)\\ &=\sqrt{a^2+b^2}(\cos\beta\sin x+\sin\beta\cos x)\\ &=\sqrt{a^2+b^2}\sin(x+\beta)\;. \end{align*}

If you originally wanted to solve the equation $a\sin x+b\cos x=c$, you can now reduce it to $$\sqrt{a^2+b^2}\sin(x+\beta)=c\;,$$ or $$\sin(x+\beta)=\frac{c}{\sqrt{a^2+b^2}}\;,$$ where the new constants $\sqrt{a^2+b^2}$ and $\beta$ can be computed from the given constants $a$ and $b$.

-
+1 Nice, thoroughly explained answer. I wonder whether there's a trend of some askers to accept the question yet without upvoting it...? –  DonAntonio Oct 14 '12 at 10:58
@DonAntonio: Thanks. You need $15$ rep to upvote, so new users don’t have that option. –  Brian M. Scott Oct 14 '12 at 11:00
Well, that's a new one for me, @Brian. Thanks for bringing that to my attention. BTW, this seems to me a rather odd rule: if you trust them enough to ask/accept questions trust them to upvote, too. Anyway now I understand better this. –  DonAntonio Oct 14 '12 at 11:03

I'm assuming $ab\neq 0$, since otherwise trivial. $a\sin x+b\cos x-c=0$

$$\iff a\left(2\sin\frac{x}{2}\cos\frac{x}{2}\right)+b\left(\cos^2\frac{x}{2}-\sin^2\frac{x}{2}\right)-c\left(\sin^2\frac{x}{2} +\cos^2\frac{x}{2}\right)=0$$

• Assume $\cos\frac{x}{2}\neq 0$. Then

$$\stackrel{:\cos^2 \frac{x}{2}\neq 0}\iff (b+c)\tan^2\frac{x}{2}-2a\tan\frac{x}{2}+(c-b)=0$$

If $b+c\neq 0$, then

$$\iff \tan\frac{x}{2}=\frac{a\pm\sqrt{a^2+b^2-c^2}}{b+c}$$

$$\iff x=2\left(\arctan\left(\frac{a\pm\sqrt{a^2+b^2-c^2}}{b+c}\right)+n\pi\right),\, n\in\Bbb Z$$

Real solutions exist iff $a^2+b^2\ge c^2$.

If $b+c=0$, then

$$\iff \tan\frac{x}{2}=\frac{c-b}{2a}\iff x=2\left(\arctan\frac{c-b}{2a}+n\pi\right),\, n\in\Bbb Z$$

• Assume $\cos\frac{x}{2}=0$. Equality holds iff $b+c=0$.
-

Using complex numbers, and setting $z=e^{i\theta}$,

$$a\frac{z-z^{-1}}{2i}+b\frac{z+z^{-1}}2=c,$$ or

$$(b-ia)z^2-2cz+(b+ia)=0.$$

The discriminant is $c^2-b^2-a^2:=-d^2$, assumed negative, then the solution

$$z=\frac{c\pm id}{b-ia}.$$

Taking the logarithm, the real part $$\ln\left(\dfrac{\sqrt{c^2+d^2}}{\sqrt{a^2+b^2}}\right)=\ln\left(\dfrac{\sqrt{c^2+a^2+b^2-c^2}}{\sqrt{a^2+b^2}}\right)=\ln(1)$$ vanishes as expected, and the argument is

$$\theta=\pm\arctan\left(\frac dc\right)+\arctan\left(\frac ab\right).$$

The latter formula can be rewritten with a single $\arctan$, using

$$\theta=\arctan\left(\tan(\theta)\right)=\arctan\left(\frac{\pm\dfrac dc+\dfrac ab}{1\mp\dfrac dc\dfrac ab}\right)=\arctan\left(\frac{\pm bd+ac}{bc\mp ad}\right).$$

-