TITLE: Uniqueness of solutions of $y''+y=0$
QUESTION [5 upvotes]: Recently I was asked about the uniqueness of the solutions of the equation $y'=y$. It could be obtained by multiply $e^{-x}$. 
This time I was wondering about the same question regarding a different equation. We know that the solutions of $y''+y=0$ are of the form $a\sin(x)+b\cos(x) $. 
How can we explain that these are the ONLY solutions?

REPLY [3 votes]: We shall show that every solution of the equation $y''+y=0$ is of the form $y(x)=a\cos x+b\sin x$, for some $a,b\in\mathbb R$.
In particular, we shall show that $$y(x)=y(0)\cos x+y'(0)\sin x$$ or equivalently
$\,z(x)\equiv 0,\,$
where $z(x)=y(x)-\big(y(0)\cos x+y'(0)\sin x\big)$.
First of all, it can be readily shown that
$$
z''(x)+z(x)=0,
$$
and
$$
z(0)=z'(0)=0. \tag{1}
$$
Hence
$$
0=z'(z''+z)=z'z''+zz'=\frac{1}{2}\big((z')^2+z^2\big)'
$$
and thus $w(x)=\big(z(x)\big)^2+\big(z'(x)\big)^2$ is a constant function, and in particular $w(x)=w(0)$
$$
\big(z(x)\big)^2+\big(z'(x)\big)^2=w(x)=w(0)=\big(z(0)\big)^2+\big(z'(0)\big)^2=0.
$$
Thus $z\equiv 0$.