Context: I am studying the construction of the two-soliton solution of the Sine-Gordon equation. Following this presentation, they obtain
\begin{align} a_1\left[\sin\left(\frac{\phi_2+\phi_1}{2}\right)-\sin\left(\frac{\phi_4+\phi_3}{2}\right)\right]&=a_2\left[\sin\left(\frac{\phi_3+\phi_1}{2}\right)-\sin\left(\frac{\phi_4+\phi_2}{2}\right)\right]\\ \tan\left(\frac{\phi_4-\phi_1}{4}\right)&=\frac{a_1+a_2}{a_1-a_2}\tan\left(\frac{\phi_2-\phi_3}{4}\right). \end{align} My question is trivial: I am unable to obtain the final trigonometric expression, which - for completeness - is the same (trivial) identity below (1.62) in the following book of C. Rogers - Bäcklund and Darboux Transformations

We need to use sum to product formula that is $$\sin\left(\frac{\phi_2+\phi_1}{2}\right)-\sin\left(\frac{\phi_4+\phi_3}{2}\right)=\\=2\sin\left(\frac{\phi_2+\phi_1-\phi_4-\phi_3}{4}\right)\cos\left(\frac{\phi_2+\phi_1+\phi_4+\phi_3}{4}\right)$$
$$\sin\left(\frac{\phi_3+\phi_1}{2}\right)-\sin\left(\frac{\phi_4+\phi_2}{2}\right)=\\=2\sin\left(\frac{\phi_3+\phi_1-\phi_4-\phi_2}{4}\right)\cos\left(\frac{\phi_2+\phi_1+\phi_4+\phi_3}{4}\right)$$
and proceeding form here cancelling out the two equal cosine terms and using that $\sin (A+B)=\sin A \cos B+\sin B \cos A$. All steps are elementary, just take the right conditions when dividing by the cosine terms.