Equivalence of Solutions to Wave Equation The differential equation $$\ddot x = -\omega^2 x$$ apparently has solutions of $$x = Ae^{i\omega t} + Be^{-i\omega t} \tag{1}$$
AND
$$x = A\sin(\omega t) + B\cos(\omega t) \tag{2}$$
AND
$$x = A\sin(\omega t + \phi) \tag{3}$$
How are all of these equivalent?  Isn't $(1)$ a complex number where $(2)$ and $(3)$ are real?  And how is the sum of a sine wave and a cosine wave just a sine wave?
 A: From (2) to (3):
$$A\sin(\omega t) + B\cos(\omega t)=\sqrt{A^2+B^2}\left(\frac{A}{\sqrt{A^2+B^2}}\sin(\omega t) + \frac{B}{\sqrt{A^2+B^2}}\cos(\omega t)\right)\\\sqrt{A^2+B^2}(\cos\phi\sin{(\omega t)}+\sin\phi\cos{(\omega t)})\\
=C\sin{(\omega t+\phi)}$$
It can also be written as $C\cos{(\omega t+\phi)}$. For simplicity, we start from this to derive (1):
$$C\cos{(\omega t+\phi)}=\frac{1}{2}\left(Ce^{i(\omega t+\phi)}+ Ce^{(-i(\omega t+\phi)}\right)\\
=Ae^{i\omega t}+Be^{\omega t}$$
where $A=\frac{1}{2}Ce^{i\phi}, B=\frac{1}{2}Ce^{-i\phi}$.
A: Something the other answers didn't mention that I think should be: if your answers are supposed to be real -- because this is the solution of an oscillator undergoing SHM from the looks of it -- then your solutions are NOT equivalent as written.  You have to add a condition to the first one.
So your first solution is $$x(t) = Ae^{i\omega t} + Be^{-i\omega t}$$ as you astutely noticed the RHS is a complex number.  But maybe we're only interested in real solutions -- so is our answer wrong?  No, we just need to pick out the real solutions from the complex solution set.
As you may or may not recall, one condition that specifies a real number is that it is invariant under complex conjugation.  That is if $z \in \Bbb C$ and $z = \bar z$, then $z$ is a real number of the form $z=a+0i$.
So we need the number $Ae^{i\omega t} + Be^{-i\omega t}$ to have this property.  So some math:
$$\overline {Ae^{i\omega t} + Be^{-i\omega t}} = \overline {Ae^{i\omega t}} + \overline{Be^{-i\omega t}} = \overline A e^{-i\omega t} + \overline B e^{i\omega t}$$
Comparing this to $x(t) = Ae^{i\omega t} + Be^{-i\omega t}$, we see that the only way $x$ is real is if $A=\overline B$ and $B = \overline A$.  So the way your solution should really be written -- if you want a real function -- is:
$$x(t) = Ae^{i\omega t} + \overline A e^{-i\omega t}$$
Notice that because $A = a + bi$ is a complex number you have the same number of arbitrary constants in this equation as you do your other two solutions.
You can look at the above answers to prove that this solution is the same as $(2)$ and $(3)$.
A: $x=A e^{i \omega t}+Be^{-i \omega  t}$ 
It can be written in terms of trig ratios, using de-moivre's theorem.
$x=A \cos \omega t+Ai \sin \omega t+B \cos \omega t- Bi \sin \omega t $
Now , grouping the terms, we will get.
$x= (A+B) \cos \omega t + i(A-B) \sin \omega t$
Now the interesting thing here is that, Whatever be the nature of these constants $A, B , i$ they are never the less still constant, and we can set any arbitrary value to them as we desire, hence we define another constant C , D for them.
$x=C \cos \omega t+D \sin \omega t$ , where $C,D$ are the names we assigned to the constant and in general you can assign any name to them.
Now , we will express the above as a single trig ratio, by expressing it in terms of identity of $\sin (\omega t + \phi) = \sin\omega t \ cos \phi + \cos \omega t \sin \phi$
For this we will multiply our solution as follow,
$x=\sqrt{C^2+D^2} \left[\left(\frac {D}{\sqrt{C^2+D^2}}\right)\sin \omega t+\left(\frac {C}{\sqrt{C^2+D^2}}\right)\cos \omega t\right]$
Set, $\sin \phi = \left(\frac {C}{\sqrt{C^2+D^2}}\right)$ , $\cos \phi = \left(\frac {D}{\sqrt{C^2+D^2}}\right)$
Now we can express $x=\sqrt {C^2+D^2}(\sin \omega t \cos \phi + \cos \omega t \sin \phi)$
$x=\sqrt {C^2+D^2}(\sin (\omega t + \phi)$
$x=R \sin (\omega t + \phi)$
This proves that the three cases are equivalent in cases of functions, provided the constant are chosen suitably.
