find a function such that $f''(x) = -f(x)$ find a function $f(x) = \sum_{k=0}^\infty a_{k} x^{k}  $, converges on $\mathbb R$ and  :

*

*$f(0) = 1$.

*$f'(0) = 1$

*$f''(x) = -f(x)$ for all x$\in \mathbb R $
I tried it with the function sinh(x) but failed miserably because $f'(0) = 0$ and $f''(x) = f(x)$ and not $f''(x) = -f(x)$, help !!
 A: Simply by asking "what are the functions which, upon differentiating twice, return the negative of themselves?" you may be able to reason that $\sin(x)$ and $\cos(x)$ work, at which point you just need to combine them correctly so as to satisfy the "initial" conditions.
However, it is likely more in the spirit of the problem to insert the power series into the differential equation and try to solve for the coefficients. If we put $f(x) = \sum_{k=0}^\infty a_k x^k$ into the equation, we find that $$\sum^\infty_{k=2} k(k-1)a_k x^{k-2} = - \sum^\infty_{k=0} a_k x^{k}.$$ By reindexing the first sum, we see this is the same as $$\sum^\infty_{k=0}(k+2)(k+1)a_{k+2} x^k = - \sum^\infty_{k=0} a_k x^k.$$ This shows that $$a_{k+2} = -\frac{a_{k}}{(k+2)(k+1)}.$$ Using this relation, along with $a_0 = a_1 = 1$ (which come from $f(0) = f'(0) = 1$), you can show that $$a_{2n} = \frac{(-1)^n}{(2n)!}, \,\,\,\,\,\,\,\,\,\, a_{2m+1} = \frac{(-1)^m}{(2m+1)!}.$$ Then after splitting into even and odd terms, you can recognize these as the coefficients of the power series for $\cos(x)$ and $\sin(x)$ respectively.
A: Let $f(x)=\sin(x)+\cos(x)$ then it staifies all the conditions .
