Show that $\tan 3x =\frac{ \sin x + \sin 3x+ \sin 5x }{\cos x + \cos 3x + \cos 5x}$ I was able to prove this but it is too messy and very long. Is there a better way of proving the identity? Thanks.

More generally, for any arithmetic sequence, denoting $z=\exp(i x)$ and $2\ell=an+2b$, we have
$$\begin{array}{c l}
\blacktriangle & =\frac{\sin(bx)+\sin\big((a+b)x\big)+\cdots+\sin\big((na+b)x\big)}{\cos(bx)+\cos\big((a+b)x\big)+\cdots+\cos\big((na+b)x\big)} \\[2pt]
& \color{Red}{\stackrel{1}=}
\frac{1}{i}\frac{z^b\big(1+z^a+\cdots+z^{na}\big)-z^{-b}\big(1+z^{-a}+\cdots+z^{-na}\big)}{z^b\big(1+z^a+\cdots+z^{na}\big)+z^{-b}\big(1+z^{-a}+\cdots+z^{-na}\big)} \\[2pt]
& \color{LimeGreen}{\stackrel{2}=}\frac{1}{i}\frac{z^b-z^{-b}z^{-na}}{z^b+z^{-b}z^{-na}} \\[2pt]
& \color{Blue}{\stackrel{3}=}\frac{(z^\ell-z^{-\ell})/2i}{(z^\ell+z^{-\ell})/2} \\[2pt] 
& \color{Red}{\stackrel{1}{=}}\frac{\sin (\ell x)}{\cos(\ell x)}. 
\end{array}$$
Hence $\blacktriangle$ is $\tan(\ell x)$ - observe $\ell$ is the average of the first and last term in the arithmetic sequence.
$\color{Red}{(1)}$: Here we use the formulas $$\sin \theta = \frac{e^{i\theta}-e^{-i\theta}}{2i} \qquad \cos\theta = \frac{e^{i\theta}+e^{-i\theta}}{2}.$$
$\color{LimeGreen}{(2)}$: Here we divide numerator and denominator by $1+z^a+\cdots+z^{na}$.
$\color{Blue}{(3)}$: Multiply numerator and denominator by $z^{na/2}/2$.
Note: there are no restrictions on $a$ or $b$ - they could even be irrational!
