<s>[INST] Hard contest type trigonometry proof Suppose that real numbers $x, y, z$ satisfy:
$$\frac{\cos x + \cos y + \cos z}{\cos(x + y + z)}
=
\frac{\sin x + \sin y + \sin z}{\sin (x + y + z )}
= p$$
Then prove that:
$$\cos (x + y) + \cos (y + z ) + \cos (x + z) = p$$
I am not even getting where to start? Please help.
 [/INST] I prefer @math110's solution, but here's a brute force method using complex exponentials, 
with 
$$\cos \theta = \frac{e^{i\theta}+e^{-i\theta}}{2} \qquad \sin\theta = \frac{e^{i\theta}-e^{-i\theta}}{2i}$$
We define
$$a := e^{ix} \qquad b := e^{iy} \qquad c := e^{iz}$$
so that
$$p = \frac{\cos x + \cos y + \cos z}{\cos(x+y+z)} \implies p(a^2b^2c^2 +1) = abc (a+b+c) + bc + ca + ab \qquad (1)$$
$$p = \frac{\sin x + \sin y + \sin z}{\sin(x+y+z)} \implies p(a^2b^2c^2 - 1 ) = abc (a+b+c) - bc - ca - ab \qquad (2)$$
Thus, from $(1)-(2)$ and $(1)+(2)$, we have
$$p = bc + ca + ab \qquad\qquad p = \frac{a+b+c}{abc} = \frac{1}{bc}+\frac{1}{ca}+\frac{1}{ab}$$
whereupon
$$2p = bc+\frac{1}{bc}\;+\;ca+\frac{1}{ca}\;+\;ab+\frac{1}{ab} = 2\left( \cos(y+z)+\cos(z+x)+\cos(x+y)\right)$$
</s>