TITLE: Why do we assume that the solutions to the differential equation y''=-ky are sines and cosines?
QUESTION [5 upvotes]: Why do we assume that the solutions to the second order differential equation of the form
$$y''=-ky$$
are sines and cosines? Just by inspection it seems pretty obvious that this is the case given that the only difference between $y$ and its second derivative is a negative constant. However, is there a formal way to show that sines and cosines are well-suited solutions to the differential equation?

REPLY [4 votes]: Normally, when you have an equation with constant coefficients, you assume that $e^{rx}$ is a solution because $e^{rx}$ has the amazing property that its derivative is $re^{rx}$ which then helps you obtain a polynomial, which is called the characteristic polynomial. In other words, suppose that your equation is:
$$a_ny^{(n)}+a_{n-1}y^{(n-1)}+\cdots+a_1y'+a_0y=g(x)$$
You will first try to solve it for the homogeneous case which is easier, i.e. the RHS is $0$. 
Now, suppose that $e^{rx}$ is a solution. You will get:
$$(a_nr^{n}+a_{n-1}r^{n-1}+\cdots+a_1r+a_0)e^{rx}=0$$
Since $e^{rx}$ never vanishes, the polynomial must vanish.
The roots of this polynomial, called the characteristic polynomial, if happen to be distinct, will give you independently linear functions. If a root had a multiplicity more than $n>1$, you take the functions like $e^{rx},xe^{rx},\cdots,x^{n-1}e^{rx}$ to obtain $n$ linearly independent functions.
We do all this because the solutions of a homogeneous ODE with constant coefficients is a vector space, in the sense that if $f(x)$ and $g(x)$ are two solutions, then $\alpha f(x) + \beta g(x)$ is also a solution for any $\alpha,\beta \in \mathbb{R}$. Therefore, as a vector space, if we can find enough linearly independent solutions to the homogeneous ODE, we will be able to describe the space of solutions using the linearly independent solutions. 
Most importantly, $\sin(x)$ and $\cos(x)$ are in fact exponential functions in disguise, linked by Euler's formula $$e^{irt}=\cos(rt)+i\sin(rt)$$ and this is why they appear in the process of solving differential equations very often.