2.1002   ODE No. 1002

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

\[ y''(x)+y(x)=0 \] Mathematica : cpu = 0.0048476 (sec), leaf count = 16

\[\{\{y(x)\to c_1 \cos (x)+c_2 \sin (x)\}\}\] Maple : cpu = 0.005 (sec), leaf count = 13

\[\{y \left (x \right ) = c_{1} \sin \left (x \right )+c_{2} \cos \left (x \right )\}\]

Hand solution

\[ 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 \]