9. If $\sin x+\sin y=$ $\frac{\sqrt{3}-1}{2}, \cos x+\cos y=\frac{\sqrt{3}+1}{2}$, then the value of $\cos (x+y)$ is $\qquad$ .
$$
\left\{\begin{array}{l}
2 \sin \frac{x+y}{2} \cos \frac{x-y}{2}=\frac{\sqrt{3}-1}{2}, \\
2 \cos \frac{x+y}{2} \cos \frac{x-y}{2}=\frac{\sqrt{3}+1}{2}
\end{array} \Rightarrow \tan \frac{x+y}{2}=\frac{\sqrt{3}-1}{\sqrt{3}+1}=2-\sqrt{3},\right.
$$

So $\cos (x+y)=\frac{1-(2-\sqrt{3})^{2}}{1+(2-\sqrt{3})^{2}}=\frac{4 \sqrt{3}-6}{8-4 \sqrt{3}}=\frac{\sqrt{3}}{2}$.