General solution of 2nd order ODE

There are 3 separate cases for a homogenous 2nd order linear ODE depending on the determinant of its characteristic equation and for each case there is a general solution. But in the Boyce and Diprima's text, when solving the equation: $$X^"+\lambda^2X=0$$ where the parameter $\lambda$ is not necessarily real, the general solution is given as:$$X(x)=k_1e^{i\lambda x}+k_2e^{-i\lambda x}$$ Could someone please explain how the general solution is derived regardless whether the parameter is real or not. Thanks.

• The characteristic equation is $m^2 + \lambda^2 = 0 \implies m_{1, 2} = \pm ~i \lambda$ – Moo Mar 19 '16 at 5:22
• When the change in something is proportional to the original amount, the solutions of the ODE always take the form $e^{cx}$. (Try the simplest example, y'=cy to see for yourself.) – Mallory Mar 19 '16 at 5:31