writing Cosines using De Moivre's formula Given the question:

Use De Moivre’s formula to find a formula for $\cos(3x)$ and $\cos(4x)$ in terms of $\cos(x)$ and $\sin(x)$. Then use the identity $\cos^2(x) + \sin^2(x) = 1$ to express these formulas only in terms of $\cos(x)$.

I started out by rewriting $\cos(3x)$:
$\cos(3x)$+$i \sin(3x)$=($\cos(x)$+$i \sin(x)$)$^3$
This could then be written into
$\cos(3x) = \cos^3(3x)-3 \cos(x) \sin^2(x)$
or
$\sin(3x) = \cos^2(x) \sin(x)- \sin^3(x)$
Then to use the identity I would substitute $1-\cos^2(x)$ for the $\sin^2(x)$
and in the second I would substitute $\sin(x)$ for $\sqrt{1 - cos(x)}$ right and would need to separate the $\sin^3(x)$ into $\sin^2(x) * \sin(x)$ and substitute from there. I'm a lot less confident about the second equation substitution. Would this be the right way to go about doing this problem?

$${ \left( \cos { x } +i\sin { x }  \right)  }^{ 3 }=\cos { \left( 3x \right) +i\sin { \left( 3x \right)  }  } \\ \cos ^{ 3 }{ x } +3i\cos ^{ 2 }{ x\sin { x } -3\cos { x\sin ^{ 2 }{ x } -i\sin ^{ 3 }{ x } = }  } \cos { \left( 3x \right) +i\sin { \left( 3x \right)  }  } \\ \\ \cos { \left( 3x \right) =\cos ^{ 3 }{ x } -3\cos { x } \sin ^{ 2 }{ x } =\cos ^{ 3 }{ x } -3\cos { x } \left( 1-\cos ^{ 2 }{ x }  \right) =4\cos ^{ 3 }{ x-3\cos { x }  }  } \\ \sin { \left( 3x \right) =3\cos ^{ 2 }{ x } \sin { x } -\sin ^{ 3 }{ x }  } =3\left( 1-\sin ^{ 2 }{ x }  \right) \sin { x } -\sin ^{ 3 }{ x } =3\sin { x } -4\sin ^{ 3 }{ x } \\ $$
