Proving the double differential of z = -z implies z= sinx In common usage, we know that $$\frac{d^2z}{dx^2}=-z\,$$ implies $z$ is of the form $a\sin x + b\cos x$. Is there a proof for the same. I was trying to arrive at the desired function but couldn't understand how to get these trigonometric functions in the equations by integration. Does it require the use of taylor polynomial expansion of $\sin x\, \text {or}\, \cos x$?

We assume the solution is of the form 
$$z=\sum_{n=0}^{\infty}a_nx^n=a_0+a_1x+a_2x^2+\cdots+a_nx^n+\cdots$$
then
$$
z''
=\sum_{n=2}^{\infty}n(n-1)a_nx^{n-2} 
=1\cdot2a_2+2\cdot3a_3x+3\cdot4a_4x^2+\cdots
$$
from $z''=-z$ then with arbitrary $a_0$ and $a_1$ we have
\begin{eqnarray*}
&&
 a_2=-\frac{1}{1\times2}a_0 ~~~,~~~ 
 a_4=-\frac{1}{3\times4}a_2=\dfrac{1}{4!}a_0   ~~,~~~ 
 a_6=-\frac{1}{5\times6}a_4=-\dfrac{1}{6!}a_0  ~~,~~~ \cdots\\
&&
 a_3=-\frac{1}{2\times3}a_1 ~~~,~~~ 
 a_5=-\frac{1}{4\times5}a_3=\dfrac{1}{5!}a_1   ~~,~~~ 
 a_7=-\frac{1}{6\times7}a_5=-\dfrac{1}{7!}a_0  ~~,~~~ \cdots
\end{eqnarray*}
then
$$z=a_0\left(1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\cdots\right) + a_1\left(x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\cdots\right)=\color{blue}{a_0\cos x+a_1\sin x}$$
