<s>[INST] If $\sin\theta+\sin\phi=a$ and $\cos\theta+ \cos\phi=b$, then find $\tan \frac{\theta-\phi}2$. I'm trying to solve this problem:

If $\sin\theta+\sin\phi=a$ and $\cos\theta+ \cos\phi=b$, then find $\tan \dfrac{\theta-\phi}2$.

So seeing $\dfrac{\theta-\phi}2$ in the argument of the tangent function, I first thought of converting the left-hand sides of the givens to products which gave me:
$$2\sin\frac{\theta+\phi}2\cos\frac{\theta-\phi}2=a\quad,\quad2\cos\frac{\theta+\phi}2\cos\frac{\theta-\phi}2=b$$
But then, on dividing the two equations (assuming $b\ne0$), I just get the value of $\tan\dfrac{\theta+\phi}2$.
I don't know how else to proceed.
Any help would be appreciated! 
 [/INST] Method $1:$
Squaring & adding what you have derived $$4\cos^2\frac{\theta-\phi}2=a^2+b^2$$
$$\implies \sec^2\frac{\theta-\phi}2=\frac4{a^2+b^2}$$
$$\implies \tan^2\frac{\theta-\phi}2=\frac4{a^2+b^2}-1=\frac{4-a^2-b^2}{a^2+b^2}$$
Method $2:$
$$\text{As  }\quad2\cos\frac{\theta+\phi}2\cos\frac{\theta-\phi}2=b,$$
$$\implies \sec\frac{\theta-\phi}2=\frac2{b\sec\frac{\theta+\phi}2}$$
$$\implies \sec^2\frac{\theta-\phi}2=\frac4{b^2\sec^2\frac{\theta+\phi}2} =\frac4{b^2\left(1+\tan^2\frac{\theta-\phi}2\right)}=\frac4{b^2\left(1+\frac{a^2}{b^2}\right)}$$  as $\tan\frac{\theta+\phi}2=\frac ab$
$$\implies \sec^2\frac{\theta-\phi}2=\frac4{b^2+a^2}$$
$$\text{Now, }\tan^2\frac{\theta-\phi}2=\sec^2\frac{\theta-\phi}2-1$$
</s>