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?


1 Answer 1


You're on the right path. Like you said, why don't you use Euler's formula to turn your exponentials into sines and cosines and then collect like terms, remembering that




are just constants, so can be replaced with another letter of your choosing.

  • $\begingroup$ I see, the A and B from my exponential form is not the same A and B on the given answer. I would prefer to use the exponential form to calculate the non-homogeneous part of the solution. Thanks for the help. $\endgroup$
    – Chris Aung
    Commented Oct 7, 2014 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .