<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] Since
\begin{align*}
p \cos(x+y+z) &= \cos x + \cos y + \cos z \\
p \sin(x+y+z) &= \sin x + \sin y +\sin z
\end{align*}
\begin{align*}
p e^{i(x+y+z)} & = e^{ix} + e^{iy} + e^{iz} 
\end{align*}
Multiplying throughout by $e^{-i(x+y+z)}$, we get
\begin{align*}
p = e^{-i(y+z)} + e^{-i(z+x)} + e^{-i(x+y)}
\end{align*}
Since $p$ is real, equating the real parts, we get
$$\cos(y+z) + \cos(z+x) + \cos(x+y) = p $$
</s>