<s>[INST] Derive $\tan(3x)$ in terms of $\tan(x)$ using De Moivre's theorem 
Derive the following identity: $$\tan(3x)=\frac{3\tan(x)-\tan^3(x)}{1-3\tan^2(x)}$$

The way I approached the questions is that I first derived $\sin(3x)$ and $\cos(3x)$ because $\tan(\theta)=\frac{\sin(\theta)}{\cos(\theta)}$. Then substituting:
$$\tan(3x)=\frac{\sin(3x)}{\cos(3x)}=\frac{-4\sin^3(x)+3\sin(x)}{4\cos^3(x)-3\cos(x)}$$
I transformed it into $$\tan(3x)=\frac{-4\sin^2(x)\tan(x)+3\tan(x)}{4\cos^2(x)-3}$$ and also to $$\tan(3x)=-\tan(x)\frac{4\sin^2(x)-3}{-4\sin^2(x)+1}$$ but I'm stuck on either of these forms. Any help?
 [/INST] Hint:
Notice that
\begin{align*}
\frac{4\sin^2 x-3}{-4\sin^2 x +1}&=\frac{1-4\cos^2 x}{4\cos^2 x-3 }\\[5pt]
&=\frac{\frac{1}{\cos^2 x}-4}{4-\frac{3}{\cos^2x}},\qquad\text{for }\cos x\neq 0\\[5pt]
&=\frac{\sec^2 x-4}{4-3\sec^2 x}\\[3pt]
&=\frac{(\color{blue}{\tan^2 x+1})-4}{4-3(\color{blue}{\tan^2 x+1})}
\end{align*}
Then, the identity follows straightforward.
</s>