<s>[INST] Find $\cos(x+y)$  if $\sin(x)+\sin(y)= a$ and $\cos(x)+\cos(y)= b$ Find $\cos(x+y)$  if $\sin(x)+\sin(y)= a$ and $\cos(x)+\cos(y)= b$.
 [/INST] Square and add the two to get $$2 + 2 \cos(x-y) = a^2 + b^2$$
$$2 \cos(x-y) = a^2 + b^2 - 2 $$
Square and subtract the two to get $$\cos(2x) + 2 \cos(x+y) + \cos(2y) = b^2 - a^2$$
Now, $$\cos(2x) + \cos(2y) = 2 \cos(x+y) \cos(x-y) = \cos(x+y) (a^2+b^2-2)$$
Hence, we get
$$\cos(x+y) (a^2 + b^2) = b^2 - a^2$$
Hence,
$$\cos(x+y) = \frac{b^2-a^2}{b^2+a^2}$$
</s>