Proving tan((x + y)/2) = (sin x + sin y)/(cos x + cos y) with the angle sum and difference identities I've recently come across this problem of proving
$$ \tan \frac{x + y}{2} = \frac{\sin x + \sin y}{\cos x + \cos y} $$
Not a difficult problem, I thought. I would have rewritten the RHS using the sum-to-product identities of sine and cosine. 
But the solution given in the back of the book is
\begin{align}
\tan \frac{x + y}{2} &= \frac{\sin x \sin y}{\cos x + \cos y} \\
&= \frac{2\sin(\frac{x}{2})\cos(\frac{x}{2})+2\sin(\frac{y}{2})\cos(\frac{y}{2})}{2\cos^2(\frac{x}{2})-1 + 1 - 2\sin^2(\frac{y}{2})} \\
&= \frac{\sin(\frac{x}{2})\cos(\frac{x}{2}) + \sin(\frac{y}{2})\cos(\frac{y}{2})}{\cos^2(\frac{x}{2}) - \sin^2(\frac{y}{2})} \tag{1} \\
&= \frac{\sin(\frac{x+y}{2})}{\cos(\frac{x+y}{2})}  \tag{2} \\
&= \tan \frac{x + y}{2}
\end{align}
What I'm confused about is the step from (1) to (2). It appears they tried to use the angle sum identities, but Wikipedia says that the formulas are actually
$$ \sin(\alpha \pm \beta) = \sin \alpha \cos \beta \pm \cos \alpha \sin \beta \\
\cos(\alpha \pm \beta) = \cos \alpha \cos \beta \mp \sin \alpha \sin \beta
$$
which don't actually match the numerator or denominator in (1). Can the angle sum identities be used like this?
I'm also interested in knowing how one would actually go from (1) to (2) without the angle sum identities. It seems like there would be a few intermediate steps.

\begin{align}
   \frac{\sin x + \sin y}{\cos x + \cos y}
   &= \frac{\sin\left(\frac{x+y}{2} + \frac{x-y}{2}\right)
      +     \sin\left(\frac{x+y}{2} - \frac{x-y}{2}\right)}
           {\cos\left(\frac{x+y}{2} + \frac{x-y}{2}\right)
      +     \cos\left(\frac{x+y}{2} - \frac{x-y}{2}\right)}\\
   &= \frac{2\sin\left(\frac{x+y}{2}\right) \cos\left(\frac{x-y}{2}\right)}
           {2\cos\left(\frac{x+y}{2}\right) \cos\left(\frac{x-y}{2}\right)}\\
   &= \tan\left(\frac{x+y}{2}\right)
\end{align}
