# If sinx+siny=a and cosx+cosy=b how do you find cos(x-y) ?

Sep 15, 2016

$\cos \left(x - y\right) = \frac{{a}^{2} + {b}^{2} - 2}{2}$

#### Explanation:

Using de Moivre's identity

${e}^{i \phi} = \cos \phi + i \sin \phi$

((i sin x + i sin y = i a), (cos x + cos y = b))

giving

${e}^{i x} + {e}^{i y} = \rho {e}^{i \alpha}$

with $\rho = \sqrt{{a}^{2} + {b}^{2}}$

((-i sin x - i sin y =-i a), (cos x + cos y = b))

${e}^{- i x} + {e}^{- i y} = \rho {e}^{- i \alpha}$

Multiplying term to term

$1 + {e}^{i \left(x - y\right)} + {e}^{- i \left(x - y\right)} + 1 = {\rho}^{2}$ or

$2 + 2 \cos \left(x - y\right) = {\rho}^{2}$ and finally

$\cos \left(x - y\right) = \frac{{a}^{2} + {b}^{2} - 2}{2}$

of course $a , b$ must obey

$\left\mid \frac{{a}^{2} + {b}^{2} - 2}{2} \right\mid \le 1$

Sep 16, 2016

$\cos \left(x - y\right) = \frac{1}{2} \left({a}^{2} + {b}^{2} - 2\right)$

#### Explanation:

As $\cos x + \cos y = b$, ${b}^{2} = {\cos}^{2} x + {\cos}^{2} y + 2 \cos x \cos y$, and similarly as $\sin x + \sin y = a$, ${a}^{2} = {\sin}^{2} x + {\sin}^{2} y + 2 \sin x \sin y$

${a}^{2} + {b}^{2} = {\cos}^{2} x + {\cos}^{2} y + 2 \cos x \cos y + {\sin}^{2} x + {\sin}^{2} y + 2 \sin x \sin y$ or
a^2+b^2=2+2×(cosxcosy+sinxsiny) or
a^2+b^2=2+2×cos(x-y) or
$\cos \left(x - y\right) = \frac{1}{2} \left({a}^{2} + {b}^{2} - 2\right)$