How find the value of $\cos{x}+\cos{y}$ let 

$$\dfrac{\cos{x}\cos{\dfrac{y}{2}}}{\cos{(x-\dfrac{y}{2})}}+\dfrac{\cos{y}\cos{\dfrac{x}{2}}}{\cos{(y-\dfrac{x}{2})}}=1$$

Find the value $$cos{x}+\cos{y}=?$$
this following My  ugly solution: let

$$\tan{\dfrac{x}{2}}=a,\tan{\dfrac{y}{2}}=b$$
  then
  $$\cos{x}=\dfrac{1-a^2}{1+b^2},\cos{y}=\dfrac{1-b^2}{1+b^2}$$
  then
  $$\dfrac{\cos{x}\cos{\dfrac{y}{2}}}{\cos{(x-\dfrac{y}{2})}}=\dfrac{1}{1+\tan{x}\tan{\dfrac{y}{2}}}=\dfrac{1-a^2}{1-a^2+2ab}$$
  and
  $$\dfrac{\cos{y}\cos{\dfrac{x}{2}}}{\cos{(y-\dfrac{x}{2})}}=\dfrac{1-b^2}{1-b^2+2ab}$$
  so
  $$\dfrac{1-a^2}{1-a^2+2ab}+\dfrac{1-b^2}{1-b^2+2ab}=1$$
  then
  $$\Longrightarrow (1-a^2)(1-b^2+2ab)+(1-b^2)(1-a^2+2ab)=(1-a^2+2ab)(1-b^2+2ab)$$
  then
  $$(1-b^2)(1-a^2+2ab)=2ab(1-b^2+2ab)$$
  $$a^2+b^2=1-3a^2b^2$$
  so
  $$\cos{x}+\cos{y}=\dfrac{2-2a^2b^2}{1+a^2+b^2+a^2b^2}=1$$
  My question: this problem have nice methods? Thank you,because My methods is very ugly.Thank you 

 A: Here is a slight simplification of your method : one has
$$
\dfrac{\cos{x}\cos{\dfrac{y}{2}}}{\cos{(x-\dfrac{y}{2})}}=\frac{1}{1-\alpha},
\dfrac{\cos{y}\cos{\dfrac{x}{2}}}{\cos{(y-\dfrac{x}{2})}}=\frac{1}{1-\beta} \tag{1}
$$
with $\alpha=\tan(x)\tan(\frac{y}{2})$ and $\beta=\tan(y)\tan(\frac{x}{2})$.
Your equation then becomes $\frac{1}{1-\alpha}+\frac{1}{1-\beta}=1$, or equivalently
$\alpha\beta=1$, i.e.
$$
\tan(x)\tan(\frac{x}{2})\tan(y)\tan(\frac{y}{2})=1
$$
or (if we put $a=\tan(\frac{x}{2})$ and $b=\tan(\frac{y}{2})$),
$$
\frac{2a^2}{1-a^2}\frac{2b^2}{1-b^2}=1 \tag{2}
$$
so $4a^2b^2=(1-a^2)(1-b^2)$ and hence
$$
3a^2b^2+a^2+b^2=1 \tag{3}
$$
We deduce
$$
(1+a^2)(1+b^2)=1+(a^2)+(b^2)+(a^2b^2)=1+(1-3a^2b^2)+(a^2b^2)=
2(1-a^2b^2)
$$
Then
$$
\cos(x)+\cos(y)=\frac{1-a^2}{1+a^2}+\frac{1-b^2}{1+b^2}=
\frac{2(1-a^2b^2)}{(1+a^2)(1+b^2)}=\frac{2(1-a^2b^2)}{2(1-a^2b^2)}=1
$$
A: $$\dfrac{\cos x\cos{\dfrac y2}}{\cos\left(x-\dfrac y2\right)}+\dfrac{\cos y\cos{\dfrac x2}}{\cos\left(y-\dfrac{x}{2}\right)}=1$$
$$\implies\dfrac{\cos x\cos{\dfrac y2}}{\cos\left(x-\dfrac y2\right)}=1-\dfrac{\cos y\cos{\dfrac x2}}{\cos\left(y-\dfrac{x}{2}\right)}$$
$$\implies\frac1{1+\tan x\tan\frac y2}=\frac{\sin y\sin \frac y2}{\cos\left(y-\dfrac{x}{2}\right)}=\frac1{\cot y\cot\frac x2+1}$$
$$\implies \tan x\tan\frac y2=\cot y\cot\frac x2\iff \tan x\tan\frac y2\tan y\tan\frac x2=1$$
Now, $\displaystyle \tan x\tan\frac x2=\frac{2\tan\frac x2}{1-\tan^2\frac x2}\tan\frac x2=\frac{2\sin^2\frac x2}{\cos^2\frac x2-\sin^2\frac x2}$ (multiplying the numerator & the denominator by $\cos^2\frac x2$)
$\displaystyle\implies \tan x\tan\frac x2=\frac{1-\cos x}{\cos x}$
and similarly for $\displaystyle \tan y\tan\frac y2$
A: Multiplying through out the given Equation with 2 
$$ \frac{2 Cos(x)Cos(\frac{y}{2})}{Cos(x-\frac{y}{2})} + \frac{2 Cos(y)Cos(\frac{x}{2})}{Cos(y-\frac{x}{2})}=2$$ $\implies$
$$\frac{Cos(x+\frac{y}{2})+Cos(x-\frac{y}{2})}{Cos(x-\frac{y}{2})}+\frac{Cos(y+\frac{x}{2})+Cos(y-\frac{x}{2})}{Cos(y-\frac{x}{2})}=2$$ $\implies$
$$\frac{Cos(x+\frac{y}{2})}{Cos(x-\frac{y}{2})}+\frac{Cos(y+\frac{x}{2})}{Cos(y-\frac{x}{2})}=0$$ $\implies$
$$2Cos(x+\frac{y}{2})Cos(y-\frac{x}{2})+2Cos(y+\frac{x}{2})Cos(x-\frac{y}{2})=0$$ $\implies$
$$Cos(\frac{x+3y}{2})+Cos(\frac{3x-y}{2})+Cos(\frac{3x+y}{2})+Cos(\frac{x-3y}{2})=0 $$ $\implies$
$$Cos(\frac{x}{2})Cos(\frac{3y}{2})+Cos(\frac{3x}{2})Cos(\frac{y}{2})=0$$ $\implies$
$$Cos(\frac{x}{2})Cos(\frac{y}{2}) \left(4Cos^2(\frac{x}{2})+4Cos^2(\frac{y}{2})-6\right)=0$$ $\implies$
$$ 4Cos^2(\frac{x}{2})+4Cos^2(\frac{y}{2})-6=0$$ $\implies$
$$ 2\left(1+Cos(x)+1+Cos(y)\right)=6$$ $\implies$
$$Cos(x)+Cos(y)=1$$
