I don't understand how the solutions of $y''+4y=0$ has solutions $A\cos(2x) + B\sin(2x)$ I was asked to find the (real) general solution to this DE. I tried using a characteristic equation but that gave me $t^2+4=0$ which will have complex solutions.
 A: If our characteristic equation has a root $k$, that means $Ce^{kx}$ is a solution to the homogeneous differential equation.
In this case, the roots are $2i$ and $-2i$, so we get $C_1e^{2ix}+C_2e^{-2ix}$.
But we know from Euler's Formula that $e^{ix} = \cos x + i \sin x$, so we get
$$C_1(\cos 2x + i\sin 2x) + C_2(\cos -2x + i\sin -2x)$$
And this we can reduce the number of different angles we have to look at, using the odd and even identities for cosine and sine:
$$C_1(\cos 2x + i\sin 2x) + C_2(\cos 2x - i\sin 2x)$$
Expanding and re-factoring, we get
$$(C_1+C_2)\cos 2x + (C_1-C_2)i\sin 2x$$
... huh.  Can we find a pair of complex numbers such that their sum is real and their difference is pure imaginary?  That would make both parts of this function real-valued.
How about two numbers that are complex conjugates?  Setting $C_1 = \frac{A-Bi}{2}$ and $C_2 = C_1^* = \frac{A+Bi}{2}$ (the $2$ is in there to make them add to exactly $A$), we get
$$\left(\frac{A-Bi}{2}+\frac{A+Bi}{2}\right)\cos 2x + \left(\frac{A-Bi}{2}-\frac{A+Bi}{2}\right)i\sin 2x=A\cos 2x+B\sin 2x$$
Which is exactly what we were looking for.
