Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Steps for solving ODE

  1. May 10, 2010 #1
    Hi, could someone show me the steps to solve the equation

    d^2y/dx^2 = -ky

    for the solution

    A*exp(i*sqrt(k)*x) + B*exp(-i*sqrt(k)*x)


    I am trying to solve the time independent Schrodinger equation for a free particle, and the above question is of the same form. Wikipedia says it is the above solution, and I can kind of see where it's going in doing some of the math for myself, but am stuck at several places. Don't ask me what I did, it will not help me for you to correct me at steps, I just need to see it done so that I can "assimilate" the knowledge for me to use in other problems (I am rather inexperienced with these types of (O)DEs, and I'm learning subjects in tandem to learn them, quantum mechanics I would like to learn, and DEs I would like to strengthen my knowledge of; it's just how I learn best, don't ask me why).


  2. jcsd
  3. May 10, 2010 #2


    User Avatar
    Homework Helper

    No offense, but that is a pretty bad attitude. You won't learn mathematics properly by just copying people.

    Anyhow to get you started. These equations are usually solved by inserting a try out solution [itex]y=e^{\lambda x}[/itex].
  4. May 10, 2010 #3
    Take this with a grain of salt, as I am doing it completely from memory. If you have y'' = -ky, then y = erx is a solution since y'' = r2erx, and substituting this into the original ODE you have

    r2erx = -kerx ==> r2 = -k ==> r = +/- sqrt(-k)

    then r = +/- i sqrt(k) therefore let

    [tex]y_1 = e^{i\sqrt{k}x}, y_2 = e^{-i\sqrt{k}x}[/tex]

    But we can take a linear combination of these:

    [tex]\hat{y_1} = \frac{y_1 + y_2}{2}, \hat{y_2} = \frac{y_1 - y_2}{2i}[/tex]

    Then by superposition

    [tex]y(x) = A\hat{y_1} + B\hat{y_2} = A\cos(\sqrt{k}x) + B\sin(\sqrt{k}x)[/tex]

    where A,B are constants.

    This is assuming that k > 0 since k <= 0 has no nontrivial solutions (again, from memory).
    Last edited: May 10, 2010
  5. May 10, 2010 #4

    I never said I was going to copy anyone, I only mean that I'm going to use the ideas in the steps being taken to solve other problems. _That_ is how I learn, not by copying.
  6. May 10, 2010 #5


    User Avatar
    Homework Helper

    Both k=0 and k<0 have nontrivial solutions.
  7. May 10, 2010 #6

    I guess there is no exponentials in your final answer becasue the solution should be in the form:

    y(t)=e^(alpha*t)*(Acos(beta*t) + Bsin(beta*t))

    Where i guess in this case:
    alpha=0 (Therefore making e^(alpha*t) equal to 1)

    Just trying to understand your logic becasue this is the first time i have seen such an equation solved using that particular method. And yes, i realize your equation was in terms of x not t, but this really dosent matter...

    Thanks for the post.
  8. May 10, 2010 #7


    User Avatar
    Homework Helper

    Why would you put that exponential in front in this case?
  9. May 10, 2010 #8
    An equation of the form

    [tex]y(x) = c_1 e^{i\sqrt{k}x} + c_2 e^{-i\sqrt{k}x}[/tex]

    would also solve the ODE, but that technique made use of the definitions

    [tex]\cos x = \frac{e^{ix} + e^{-ix}}{2}[/tex]

    [tex]\sin x = \frac{e^{ix} - e^{-ix}}{2i}[/tex]

    to get rid of the imaginary units.
  10. May 10, 2010 #9

    i believe the reason for multiplying e^(alpha*t) by (Acos(beta*t) + Bsin(beta*t)) is becasue when solving an ODE with imaginary roots you are left dealing with an exponential of the form e^(alpha + i*beta). This can be expanded into a form involving sines and cosines. If you would like a can post a completely solved example problem using this technique.

    I hope this clarifyed.
  11. May 10, 2010 #10


    User Avatar
    Homework Helper

    You're only left with an exponential of that form if the differential equation also involves a first derivative, which is absent here. I see no point in adding it to the solution. The best way to deal with differential equations like this is to just use a try out function [itex]y=e^{\lambda x}[/itex].
  12. May 10, 2010 #11

    Thanks, that's exactly what I needed. :) I feel dumb now, it was so simple (I'm still a bit fresh on differential equations). XP I know what to do for all the QM wave equations (as well as any other wave equation) now. \o/

  13. May 10, 2010 #12

    Absense of a first derivative really has nothing to do with whether or not exponentials will be in the answer. as far as i know an equation such as that will always have a constant times an exponential in the solution. In this case there is no exponential because it is raised to the zero power and is therefore only 1.
  14. May 10, 2010 #13


    User Avatar
    Homework Helper

    I am talking about the superfluous exponential you put in front of the general solution. The constant alpha will always be 0 and therefore the exponent will always be 1 with the type of differential equation we're discussing. If we add a first derivative term this will change, which is quite easy to see if you look at the characteristic equation.
    Last edited: May 10, 2010
  15. May 10, 2010 #14
    Yes, any changes to the characteristic equation could yeild large differences in the solution. The exponential term i had out in front that you are referring too was simply a factored out term. And yes again, if the coefficient of the first derivative term equals zero then alpha would then be zero bue to quadratic formula. we seem to be on the same page here... WHat exactly are we differing on?
  16. May 11, 2010 #15


    User Avatar
    Homework Helper

    The issue here is that it is a useless addition. You can multiply any solution by 1 and that solution will again be a solution to the differential equation. I suggest you plug your 'general' solution into the differential equation and check if both sides are the same. I think you will see my point once you're finished.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook