Proving $\frac{\sin x + \sin 2x + \sin3x}{\cos x + \cos 2x + \cos 3x} = \tan2x$ I need to prove:
$$
\frac{\sin x + \sin 2x + \sin3x}{\cos x + \cos 2x + \cos 3x} = \tan2x
$$
The sum and product formulae are relevant:
$$
\sin(A + B) + \sin (A-B) = 2 \sin A \cos B \\
\sin(A + B) - \sin (A-B) = 2 \cos A \sin B \\
\cos(A + B) + \cos (A-B) = 2 \cos A \cos B
$$
Taking the numerator first:
$$
\sin x + \sin 2x + \sin3x = 2\sin\left(\frac{3}{2}x\right) \cos\left(\frac{1}{2}x\right) + \sin 3x \\
\sin 3x = \sin\left(\frac{3}{2}x + \frac{3}{2}x\right) - \sin\left(\frac{3}{2}x - \frac{3}{2}x\right) = 2\cos\left(\frac{3}{2}x\right)\sin\left(\frac{3}{2}x\right) \\
\therefore \sin x + \sin 2x + \sin3x=2\sin\left(\frac{3}{2}x\right)\left[\cos\left(\frac{1}{2}x\right) + \cos\left(\frac{3}{2}x\right)\right]
$$
and now the the denominator:
$$
\cos x + \cos 2x + \cos 3x = 2\cos\left(\frac{3}{2}x\right) \cos\left(\frac{1}{2}x\right) + \cos 3x 
$$
But I don't know how to express $\cos3x$ in terms of a product, so I can't factorize and cancel. Can someone help me make the next few steps?

\begin{align}
\frac{\sin x + \sin 2x + \sin3x}{\cos x + \cos 2x + \cos 3x}&=\frac{\sin x + \sin 3x + \sin2x}{\cos x + \cos 3x + \cos 2x}\\
&=\frac{2\sin 2x\cos x+ \sin 2x}{2\cos 2x\cos x + \cos 2x}\\
&=\frac{\sin2x(2\cos x+1)}{\cos 2x(2\cos x + 1)}\\
& = \tan2x
\end{align}
