<s>[INST] Solving $a \sin\theta + b \cos\theta = c$ Could someone help me with the steps for solving the below equation $$a \sin\theta + b \cos\theta = c$$
I know that the solution is $$\theta = \tan^{-1} \frac{c}{^+_-\sqrt{a^2 + b^2 - c^2}} - \tan^{-1} \frac{a}{b} $$
I just can't figure out the right steps to arrive at this solution.
 [/INST] Well, we have:
$$\text{a}\cdot\sin\left(x\right)+\text{b}\cdot\cos\left(x\right)=\text{c}\tag1$$
Substitute $\text{y}=\tan\left(\frac{x}{2}\right)$, so $\sin\left(x\right)=\frac{2\cdot\text{y}}{1+\text{y}^2}$ and $\cos\left(x\right)=\frac{1-\text{y}^2}{1+\text{y}^2}$:
$$\text{y}^2-\frac{\text{b}-\text{c}}{\text{b}+c}-\frac{2\cdot\text{a}\cdot\text{y}}{\text{b}+\text{c}}=0\tag2$$
Solving for $\text{y}$, gives:
$$\text{y}=\pm\sqrt{\frac{\text{a}^2}{\text{b}+\text{c}}+\frac{\text{b}-\text{c}}{\text{b}+\text{c}}}+\frac{\text{a}}{\text{b}+\text{c}}\tag3$$
</s>