<s>[INST] Find $\cos(\alpha+\beta)$ if $\alpha$, $\beta$ are the roots of the equation $a\cos x+b\sin x=c$ 
If $\alpha$, $\beta$ are the roots of the equation $a\cos x+b\sin x=c$, then prove that $\cos(\alpha+\beta)=\dfrac{a^2-b^2}{a^2+b^2}$

My Attempt
$$
b\sin x=c-a\cos x\implies b^2(1-\cos^2x)=c^2+a^2\cos^2x-2ac\cos x\\
(a^2+b^2)\cos^2x-2ac\cos x+(c^2-b^2)=0\\
\implies\cos^2x-\frac{2ac}{a^2+b^2}\cos x+\frac{c^2-b^2}{a^2+b^2}=0
$$
$$
a\cos\alpha+b\sin\alpha=c\implies a\cos^2\alpha\cos\beta+b\sin\alpha\cos\alpha\cos\beta=c\cos\alpha\cos\beta\\
a\cos\beta+b\sin\beta=c\implies a\sin\alpha\sin\beta\cos\beta+b\sin\alpha\sin^2\beta=c\sin\alpha\sin\beta\\
c\cos(\alpha+\beta)=a\cos\beta+a\sin\alpha\cos\beta.(\sin\beta-\sin\alpha)+b\sin\alpha+b\sin\alpha\cos\beta(\cos\alpha-\cos\beta)\\
$$
I think its getting complicated to solve now. What is the simplest way to solve this kind of problems? 
 [/INST] I would like to present you a geometric explanation of what is happening.
If $\xi = \cos x$ and $\eta=\sin x$, then you rewrite your equation as:
$$
  a\xi +b\eta=c,\qquad \xi^2+\eta^2=1.
$$
So you are trying to find intersection points of a line and a circle.

Simple geometry tells us that bisector $AF$ is perpendicular to line $DE$. If $\angle CAD = \alpha$ and $\angle CAE = \beta$, then $\angle CAF=(\alpha+\beta)/2$. On the other hand, coordinates of $F$ are
$$\xi_F = \pm \frac a{\sqrt{a^2+b^2}},\qquad \eta_F=\pm \frac b{\sqrt{a^2+b^2}}$$
because vector $(a,b)$ is normal to line $a\xi +b\eta=c$, and then we scale it so $F$ lies on a unit circle. We also have $\pm$ here, because bisector intersects circle in two points, and which of them is $F$ depends on the value of $c$.
$$\cos(\alpha+\beta)=\cos\left(2\frac{\alpha+\beta}2\right) = \cos^2\frac{\alpha+\beta}2 - \sin^2\frac{\alpha+\beta}2 = \xi_F^2 -\eta_F^2=\frac{a^2-b^2}{a^2+b^2}.$$
Notably, our answer doesn't depend on the choice of the signs, as $(\pm a)^2 = a^2$
</s>