TITLE: How do we know $\sin$ and $\cos$ are the only solutions to $y'' = -y$?
QUESTION [15 upvotes]: According to Wikipedia, one way of defining the sine and cosine functions is as the solutions to the differential equation $y'' = -y$.
How do we know that sin and cos (and linear combinations of them, to include $y=e^{ix}$) are the only solutions to this equation?
It seems like a clever combination of inverse polynomials or exponentials could do the same.

REPLY [4 votes]: Consider the initial value problem $y'' = -y$, with $y(0) = 0$ and $y'(0) = 0$. Multiplying both sides by $2y'$,
$$2y'' y' = -2y y' \implies ((y')^2)' = -(y^2)' \implies (y')^2 + y^2 = C$$
for some constant $C$. Applying the initial values yields
$$C = (y'(0))^2 + (y(0))^2 = 0.$$
Thus,
$$0 = (y')^2 + y^2 \ge y^2 \ge 0 \implies y = 0.$$
Hence, the initial value problem has only the unique solution $y = 0$.
Now, fix $a, b \in \Bbb{R}$ and consider two solutions $y_1$ and $y_2$ of the initial value problem $y'' = -y$ with $y(0) = a$ and $y'(0) = b$. Let $y = y_1 - y_2$. Then,
$$y'' = (y_1 - y_2)'' = y_1'' - y_2'' = -y_1 + y_2 = -y.$$
Further,
$$y(0) = y_1(0) - y_2(0) = a - a = 0$$
and similarly $y'(0) = 0$. Hence, $y$ satisfies the original initial value problem, thus $y = 0$ by the previous result, hence $y_1 = y_2$.
That is, we can choose $a$ and $b$ as we like, and we obtain at most one solution given the initial values. In particular, we can define $\sin$ with $a = 0$ and $b = 1$ and $\cos$ with $a = 1$ and $b = 0$.
Note that this doesn't guarantee a solution to the differential equation, but it's a way to get uniqueness.