To solve a 2nd order ODE, we can follow the steps as shown below. (Image 2 is a continuation from Image 1, apologies for the size difference.)

The method to obtain the solution is straightforward.

Let's say

If k = -1, a possible solution is y = sin x. If k = 1, a possible solution is y = e^x.

How do we obtain these two different solutions from one straightforward method?