My solution: $$ y^{\prime \prime}(t)=-y \cdot k^{2} \Leftrightarrow \ddot{y}+k^{2} \cdot y=0 \\ \Rightarrow \lambda^{2}+k^{2}=0 \Rightarrow \lambda_{1,2}= \pm i k \\ y(t)=A e^{i k t}+B e^{-i k t}$$
with $A, B \in \mathbb{R} $.
Books solution: $$ y_b(t)=A \cos (k t)+B \sin (k t) $$
The index $b$ just refers to the solution given in the book.
Both solution are correct but how do you calculate the $y_b$ solution?
Edit: There seems to be a printing error in the book, I corrected the function $y_b$. The question remains the same.