1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Inhomogeneous differential equations

  1. Sep 27, 2014 #1

    Maylis

    User Avatar
    Gold Member

    1. The problem statement, all variables and given/known data
    Solve the following ordinary differential equations, where ##\alpha##, ##\beta##, and ##\lambda## are constants.

    [tex]\frac {dy}{dx} + \beta y = 0 [/tex]

    [tex]\frac {dy}{dx} + \beta y + \alpha = 0[/tex]

    [tex] \frac {d^2y}{dx^2} - \lambda^2 y = 0[/tex]

    [tex] \frac {d^2y}{dx^2} + \lambda^2 y = 0[/tex]

    [tex] \frac {d^2y}{dx^2} - \lambda^2 y + \alpha = 0[/tex]


    2. Relevant equations



    3. The attempt at a solution
    It has been about two years since I've had to solve anything other than non-homogeneous, separable differential equations, so I am pretty rusty on this. I know I put 5 questions in one thread, but since this is an exercise just to make me remember some stuff I learned a couple years ago and long forgot, I am consolidating them here as to not have to post a few threads.

    1.
    [tex]\frac {dy}{dx} + \beta y = 0 [/tex]
    [tex] \int \frac {dy}{y} = \int -\beta dx [/tex]
    [tex] ln |y| = -\beta x + C [/tex]
    Assume y > 0
    ##y = e^{-\beta x + c}##
    ## y = Ce^{-\beta x}##

    2.
    [tex] \frac {dy}{dx} + \beta y + \alpha = 0 [/tex]
    for this one, I'm not sure since it is non-homogeneous.

    3.
    [tex] \frac {d^2y}{dx^2} - \lambda^2 y = 0[/tex]
    For this one,
    [tex] \frac {d^2y}{dx^2} = \lambda^2y[/tex]
    [tex]\frac {d}{dx} \frac {dy}{dx} = \lambda^2y[/tex]
    From here I have an idea but I'm unsure this is legitimate math operations. How would I go about this one? I can see some similarity with problem 1

    4.
    [tex] \frac {d^2y}{dx^2} + \lambda^2 y = 0[/tex]
    I believe this one has some sort of known solution, although I wouldn't know how to get it
    ##y = Acos(\lambda x) + Bsin(\lambda x)##

    5.
    [tex] \frac {d^2y}{dx^2} - \lambda^2 y + \alpha = 0[/tex]
    once again non-homogeneous, and 2nd order nonetheless, so not sure what to do
     
    Last edited: Sep 27, 2014
  2. jcsd
  3. Sep 27, 2014 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    (2) is a separable equation. It can be written as [itex]dy/dx= -\beta y- \alpha[/itex] and then
    [tex]\frac{dy}{\beta y+ \alpha}= dx[/tex]
    Integrate both sides.

    None of (3), (4), or (5) are first order equations so none of the methods you seem to want to use will apply. They are, however, second order linear equations. Most introductory differential equations courses devote most of the time to those. Do you know what the "characteristic equation" is? Do you know how to find a "particular solution" to a linear non-homogeneous equation.
     
  4. Sep 27, 2014 #3

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    @Maylis: These are all examples of constant coefficient linear differential equations, and can all be solved with the same technique. There are many online writeups about these DE's. One place to look is:
    http://www.math.wisc.edu/~dummit/docs/diffeq_2_linear_differential_equations.pdf [Broken]

    In particular look at sections 1.3 and 1.4.
     
    Last edited by a moderator: May 7, 2017
  5. Sep 28, 2014 #4

    Maylis

    User Avatar
    Gold Member

    Thanks guys. I remember the terms characteristic equations and particular solutions, but it's just been too long for me to actually remember how to do it. I will look at that PDF. I had a feeling number with (2) that I could do what HallsOfIvy was saying

    So for (2)

    [tex] \int \frac{dy}{-\beta y - \alpha} = \int dx [/tex]

    [tex] \frac {-1}{\beta} ln|-\beta y - \alpha | = x + C [/tex]

    Assume ##-\beta y - \alpha \gt 0##.

    [tex] \frac {-1}{\beta} ln(-\beta y - \alpha) = x + C [/tex]

    [tex] -\beta y - \alpha = e^{-\beta x + C} [/tex]

    [tex] y = \frac {\alpha + Ce^{-\beta x}}{-\beta} [/tex]
     
    Last edited: Sep 28, 2014
  6. Sep 28, 2014 #5

    Maylis

    User Avatar
    Gold Member

    Hey LCKurtz,

    Thanks a lot for the PDF, it is very helpful. However, I have a doubt, but before that I will post my solutions to the (3) and (4)
    (3)
    [tex] y'' - \lambda^2 y = 0 [/tex]
    [tex] r^2 - \lambda^2 = 0 [/tex]
    [tex](r + \lambda)(r - \lambda) = 0[/tex]
    Solving for the roots of the characteristic equation,
    ##r_{1} = -\lambda## and ##r_{2} = \lambda##.

    Therefore, the solution to this differential equation is
    [tex] y = c_{1}e^{\lambda x}+c_{2}e^{-\lambda x} [/tex]

    For (4)
    [tex] y'' + \lambda^2 y = 0 [/tex]
    [tex] r^2 + \lambda^2 = 0[/tex]
    The roots of the characteristic equation are
    ##r_{1} = \lambda i## and ##r_{2} = -\lambda i##.

    Using Euler's formula
    ##e^{r_{1}x} = cos(\lambda x) + i \hspace{0.05 in} sin(\lambda x)##
    ##e^{r_{2}x} = cos(\lambda x) - i \hspace{0.05 in} sin(\lambda x)##

    yields

    [tex] y = c_{1}cos(\lambda x) + c_{2}sin(\lambda x) [/tex]

    Okay, so hoping that those are right, now I look at a specific example in the PDF

    [tex] y'' + 4y = 0 [/tex]

    Okay, first of all, is it just me or does it seem that the characteristic equation for ##y'' + 4y = 0## and ##y'' + 4 = 0## are identical? Or am I missing something. Anyways,

    they go on and find ##r_{1} = 2i## and ##r_{2} = -2i##, then they say

    [tex] e^{r_{1}x} = cos(2x) + i \hspace{0.05 in} sin(2x) [/tex]
    [tex] e^{r_{2}x} = cos(2x) - i \hspace{0.05 in} sin(2x) [/tex]

    Then conclude that the solution is
    [tex] y = c_{1}cos(2x) + c_{2}sin(2x) [/tex]

    Now I assume this is exactly like before, where the solution would be ##y = c_{1}e^{r_{1}x} + c_{2}e^{r_{2}x}##. But if do this,

    [tex] y = c_{1}(cos(2x) + i \hspace{0.05 in} sin(2x)) + c_{2}(cos(2x) - i \hspace{0.05 in} sin(2x))[/tex]

    How does that simplify to the solution given??
     
    Last edited: Sep 28, 2014
  7. Sep 28, 2014 #6

    Maylis

    User Avatar
    Gold Member

    For (5),

    [tex] y'' - \lambda^2 y + \alpha = 0 [/tex]
    I get
    [tex] y'' - \lambda^2 y = -\alpha[/tex]
    Using the result from (3), the general solution is
    [tex] y_{g} = c_{1}e^{\lambda x} + c_{2}e^{-\lambda x} [/tex]

    Now I have to use my brain to guess for the particular solution (undetermined coefficients), and I come up with this
    ##y_{p} = A##
    ##y'_{p} = 0##
    ##y''_{p} = 0##

    Then plug back into the original differential equation
    [tex] 0 -\lambda^2 A = -\alpha [/tex]
    and conclude that ##A = \frac {\alpha}{\lambda^2}##. Combining the general and particular solution, I get

    [tex] y = c_{1}e^{\lambda x} + c_{2}e^{-\lambda x} + \frac {\alpha}{\lambda^2} [/tex]
     
  8. Sep 28, 2014 #7

    pasmith

    User Avatar
    Homework Helper

    Let [itex]C_1 = c_1 + c_2[/itex] and [itex]C_2 = i(c_1 - c_2)[/itex]. Then [tex]
    c_1(\cos(2x) + i\sin(2x)) + c_2(\cos(2x) - i\sin(2x)) = C_1 \cos(2x) + C_2\sin(2x).[/tex] If you want [itex]y[/itex] to be real, then you need [itex]c_1[/itex] and [itex]c_2[/itex] to be complex conjugates, so that [itex]c_1 = A + iB[/itex] and [itex]c_2 = A - iB[/itex] for real [itex]A[/itex] and [itex]B[/itex]. Then [tex]
    C_1 = c_1 +c_2 = 2A \in \mathbb{R}, \\
    C_2 = i(c_1 - c_2) = -2B \in \mathbb{R}.
    [/tex]
     
  9. Sep 28, 2014 #8

    Maylis

    User Avatar
    Gold Member

    Hello pasmith,

    Thanks for addressing that, it was not so obvious how they could equate the two. Are my solutions all good now? :)
     
  10. Sep 28, 2014 #9

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    The first DE is homogenous. The second one isn't because you move the 4 to the other side as it doesn't contain a ##y## or its derivatives. The characteristic equation therefore turns out to be just ##r^2=0##.

    I wouldn't call this the general solution. It's the homogeneous solution. The general solution is the sum of the homogeneous and particular solutions.
     
    Last edited: Sep 29, 2014
  11. Sep 28, 2014 #10

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    ##y''+4=0## is the same as ##y''=-4## and is a nonhomogeneous equation. The characteristic equation is ##r^2=0## giving ##y_c = Ax + B## for the homogeneous equation. Then you look for a particular solution for the NH equation (easy by inspection).

    I think someone else already answered that. Also, in the case of distinct real roots, you may sometimes see the function pair ##\{\cosh(\lambda x),\sinh(\lambda x)\}## used instead of ##\{e^{\lambda x},e^{-\lambda x}\}##.
     
    Last edited: Sep 28, 2014
  12. Sep 29, 2014 #11

    Maylis

    User Avatar
    Gold Member

    Hello Vela,

    I guess I should have used a different word (i.e. I moved alpha over) if you see the end of post #6, it is clear what my solution is. I believe you mistook that as my solution just doing one step of algebra
     
  13. Sep 29, 2014 #12

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    No, I just messed up the quote. I fixed it above. I was just correcting your terminology. Your solution looked fine.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted