<s>[INST] Proving trigonometric problem from given trigonometric equations If $p$ & $q$ are the solutions of $$a \cos x + b \sin x = c$$
Then how do I prove that, $$\cos (p + q) = \dfrac{a^2-b^2}{a^2 + b^2} $$
I tried all the adjustments I could think of, like dividing by $ \cos x $ and extracting $a$ and $b$ from the 2 equations. Also tried adding/subtracting and all the basics I know to no avail.
Any help is appreciated, thank you :)
 [/INST] We have
$$c-a\cos x=b\sin x$$ and by squaring and rewriting,
$$c^2-2ac\cos x+a^2\cos^2x=b^2(1-\cos^2x),$$
$$(a^2+b^2)\cos^2x-2ac\cos x+c^2-b^2=0.$$
Using the Vieta's formulas, the product of the roots is
$$\cos p\cos q=\frac{c^2-b^2}{a^2+b^2}.$$
Repeating the same reasoning symmetrically, 
$$\sin p\sin q=\frac{c^2-a^2}{a^2+b^2}.$$
Now by subtraction,
$$\cos(p+q)=\frac{a^2-b^2}{a^2+b^2}.$$
</s>