Find $\cos2\theta+\cos2\phi$, given $\sin\theta + \sin\phi = a$ and $\cos\theta+\cos\phi = b$ 
If 
  $$\sin\theta + \sin\phi = a \quad\text{and}\quad \cos\theta+\cos\phi = b$$
then find the value of   $$\cos2\theta+\cos2\phi$$

My attempt:
Squaring both sides of the second given equation:
$$\cos^2\theta+ \cos^2\phi + 2\cos\theta\cos\phi= b^2$$
Multiplying by 2 and subtracting 2 from both sides we obtain, 
$$\cos2\theta+ \cos2\phi = 2b^2-2 - 4\cos\theta\cos\phi$$
How do I continue from here? 
PS: I also found the value of $\sin(\theta+\phi)= \dfrac{2ab}{a^2+b^2}$
Edit: I had also tried to use $\cos2\theta + \cos2\phi= \cos(\theta+\phi)\cos(\theta-\phi)$ but that didn't seem to be of much use

HINT: use that $$\cos(2\theta)+\cos(2\phi)=\cos(\theta-\phi)\cos(\theta+\phi)$$
and $$\sin(\theta)+\sin(\phi)=2\cos\left(\frac{\theta-\phi}{2}\right)\sin\left(\frac{\theta+\phi}{2}\right)$$
and
$$\cos(\theta)+\cos(\phi)=2\cos\left(\frac{\theta-\phi}{2}\right)\cos\left(\frac{\theta+\phi}{2}\right)$$
so another idea, and this works:
use that
$$\sin(\theta)+\sin(\phi)=2\,{\frac {\tan \left( \theta/2 \right) }{1+ \left( \tan \left( \theta
/2 \right)  \right) ^{2}}}+2\,{\frac {\tan \left( \phi/2 \right) }{1+
 \left( \tan \left( \phi/2 \right)  \right) ^{2}}}
$$
and $$\cos(\theta)+\cos(\phi)={\frac {1- \left( \tan \left( \theta/2 \right)  \right) ^{2}}{1+
 \left( \tan \left( \theta/2 \right)  \right) ^{2}}}+{\frac {1-
 \left( \tan \left( \phi/2 \right)  \right) ^{2}}{1+ \left( \tan
 \left( \phi/2 \right)  \right) ^{2}}}
$$
and $$\cos(2\theta)+\cos(\phi)={\frac {1- \left( \tan \left( \theta \right)  \right) ^{2}}{1+ \left( 
\tan \left( \theta \right)  \right) ^{2}}}+{\frac {1- \left( \tan
 \left( \phi \right)  \right) ^{2}}{1+ \left( \tan \left( \phi
 \right)  \right) ^{2}}}
$$
now convert $$\tan(x)$$ into $\tan(x/2)$ and solve the equations above for $$\tan(\phi/2)$$ respective $$\tan(\theta/2)$$
