# Finding the homogeneous part of general solution to second order non-homogeneous differential equation

I was given this non-homogeneous second order differential equation:

$\dfrac{d^2y}{dx^2} + y = sec(x)$

In order to solve this, I need to find the general solution to the homogeneous part by finding the characteristic equation which is:

$\lambda^2 + 1 = 0$

$\lambda^2 = -1$

$\lambda = \pm i$

According to my understanding, based on the roots from characteristic equation , the general solution to homogeneous part should be

$y_{homogeneous} = Ae^{ix} + Be^{-ix}$

But Instead,In my text, it was written as this:

$y_{homogeneous} = Acos(x) + Bsin(x)$

I am aware that I could use Euler's formula to convert my exponential terms into sine and cosine but even then I would not be able to get the solution given in the text.

What am i missing?