How do you use DeMoivre's formula to derive triple-angle formulas? 
Use DeMoivre's formula to derive the trig identities
$$\begin{cases}
\cos3\theta = (\cos\theta)^2-3\cos\theta(\sin\theta)^2\\
\sin3\theta=3(\cos\theta)^2\sin\theta-(\sin\theta)^3
\end{cases}$$
and note: $(a+b)^3 = a^3+3a^2b+3ab^2+b^3$

I'm kind of clueless on how to do this. I missed class when we learned how to apply DeMoivre's formula.
 A: DeMoivre's formula looks like this:
$$
\color{maroon}{\cos(n\theta)} + i\color{navy}{\sin(n\theta)} = (\cos(\theta) + i\sin(\theta))^n
$$
Use the case where $n=3$ and multiply out the RHS. So $\color{maroon}{\cos(3\theta)} + i\color{navy}{\sin(3\theta)}  = $
$$
\begin{align}
&= (\cos(\theta) + i\sin(\theta))^3 \\
&=\big(\cos^2(\theta)-\sin^2(\theta)+2i\sin(\theta)\cos(\theta)\big)(\cos(\theta) + i\sin(\theta)) \\
&=\cos^3(\theta)-\sin^2(\theta)\cos(\theta)+2i\sin(\theta)\cos^2(\theta)+i\sin(\theta)\cos^2(\theta)-i\sin^3(\theta)-2\sin^2(\theta)\cos(\theta)\\
&= \dotsc
\end{align}
$$
And then we can group the terms with a coefficient of $i$ and those without a coefficient of $i$:
$$
\begin{align}
\dotsc &= \color{maroon}{\big(\cos^3(\theta)-3\sin^2(\theta)\cos(\theta)\big)} + 
          i\color{navy}{\big(-\sin^3(\theta)+3\sin(\theta)\cos^2(\theta)\big)}
\end{align}
$$
Then looking back at the $(\color{maroon}{\cos(3\theta)} + i\sin(3\theta))$ that we started with, we can see that the $\color{maroon}{\text{real term}}$ in this expression must be equal to the $\color{maroon}{\text{real term}}$ in our result, and the $\color{navy}{\text{imaginary term}}$ in this expression must be equal to the $\color{navy}{\text{imaginary term}}$ in our result. So,
$$
\begin{cases}\color{maroon}{\cos(3\theta) = \cos^3(\theta)-3\sin^2(\theta)\cos(\theta)}\\
\color{navy}{\sin(3\theta) = -\sin^3(\theta)+3\sin(\theta)\cos^2(\theta)}
\end{cases}
$$
