Evaluate $\int\frac {\sin 4x }{\sin x}\ dx$ 
Evaluate $$\int \frac{\sin 4x}{\sin x} dx$$

Attempt:
I've tried to use the double angle formulas and get it all into one identity, which came out as:
$$
\int \left( 8\cos^3x - 4\cos x \right) dx
$$
But I'm not sure if this is the right way to go about it. Any help would be much appreciated!

We can put the complex identity
$$\sin \alpha := \frac{\exp(i \alpha) - \exp(-i \alpha)}{2i}$$ to efficient use here.
Taking $\alpha = 4 x$ gives
$$\sin 4x = \frac{\exp(4 i x) - \exp(-4 i x)}{2i},$$
We can use a difference-of-squares factorization to write the numerator as
\begin{align*}
\exp(4 i x) - \exp(-4 i x)
&= [\exp(2 i x) + \exp(-2 i x)][\exp(2 i x - \exp(2 i x)] \\
&= [\exp(2 i x) + \exp(-2 i x)][\exp (i x) + \exp(- i x)][\exp (i x) - \exp(- i x)]
\end{align*}
Now, substituting using the complex identity for $\alpha = x$ gives
\begin{align*}
\sin 4x = [\exp(2 i x) + \exp(-2 i x)][\exp (i x) + \exp(- i x)] \cdot \frac{\exp (i x) - \exp(- i x)}{2 i} = [\exp(2 i x) + \exp(-2 i x)][\exp (i x) + \exp(- i x)] \sin x.
\end{align*}
So, expanding and using the corresponding cosine identity
$$\cos \alpha = \frac{\exp(i \alpha) + \exp(-i \alpha)}{2}$$ gives
\begin{align*}
\frac{\sin 4x}{\sin x}
&= [\exp(2 i x) + \exp(-2 i x)][\exp (i x) + \exp(- i x)]\\
&= \exp(3 i x) + \exp(-3 i x) + \exp(i x) + \exp(-i x) \\
&= 2 (\cos 3x - \cos x) .
\end{align*}
In this form, we can compute the antiderivative quickly.
