\[ y''(x)+y(x)=0 \] ✓ Mathematica : cpu = 0.00482152 (sec), leaf count = 16
\[\left \{\left \{y(x)\to c_2 \sin (x)+c_1 \cos (x)\right \}\right \}\]
✓ Maple : cpu = 0.023 (sec), leaf count = 13
\[ \left \{ y \left ( x \right ) ={\it \_C1}\,\sin \left ( x \right ) +{\it \_C2}\,\cos \left ( x \right ) \right \} \]
\[ y^{\prime \prime }+y=0 \]
Let \(y=e^{\lambda x}\), substitution in above gives
\begin {align*} \lambda ^{2}e^{\lambda x}+e^{\lambda x} & =0\\ \lambda ^{2}+1 & =0 \end {align*}
Hence \(\lambda =\pm i\), therefore the solution is
\begin {align*} y & =Ae^{ix}+Be^{-ix}\\ & =A\left ( \cos x+i\sin x\right ) +B\left ( \cos x-i\sin x\right ) \\ & =\cos x\left ( A+B\right ) +\sin x\left ( Ai-iB\right ) \\ & =\cos x\left ( A+B\right ) +\sin x\left ( i\left ( A-B\right ) \right ) \end {align*}
Let \(A+B=c_{1},i\left ( A-B\right ) =c_{2}\) hence
\[ y=c_{1}\cos x+c_{2}\sin x \]