1. Limited time only! Sign up for a free 30min personal 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!

Homework Help: Solution conflict!

  1. Jan 4, 2006 #1
    I have a basic differential equation:
    [tex]\frac{dy}{dx} = x + y, y(0) = 1[/tex]

    Now, when I try to solve this by making it exact
    [tex]\mu \frac{dy}{dx} + \mu y = \mu x[/tex]
    I get [tex]\mu = e^{-x}[/tex] and solution [tex]-x-1[/tex]. This doesn't satisfy the initial condition. But when I try to solve it as a non-homogenous equation as:
    [tex]\frac{dy}{dx} + y= x[/tex]
    I get
    [tex]y_p = 2e^x, y_c = -x-1[/tex]
    [tex]y = 2e^x-x-1[/tex]

    Which seems to be a correct & full solution. What was I missing in the first try?
  2. jcsd
  3. Jan 4, 2006 #2
    You are solving dy/dx + y = x which is wrong since the original equation is
    dy/dx = x + y, or dy/dx - y = x so now u(x) = e^(-x) and so on and it works out.

    And yes, the answer is y = 2e^x - x - 1
  4. Jan 4, 2006 #3

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    I assume this was just a typo, but that equation should be
    [tex]\mu \frac{dy}{dx} - \mu y = \mu x[/tex]
    Your error: you forgot the constant of integration. You should have obtained
    [tex]y = -(x+1) + c/\mu = ce^x - (1+x)[/tex]
    and then solved for the initial condition [itex]y(0)=1[/itex] yielding [itex]c=2[/itex] or
    [tex]y = 2e^x -(x+1)[/tex]
    You're nomenclature is backward here. The solution to the homogeneous equation is called the complementary function and is denoted as [itex]y_c[/itex]. The complementary function generally involves arbitrary constants. A solution to the inhomogeneous equation is called a particular function and is denoted as [itex]y_p[/itex].
    In this case, the solution to the homogeneous equation [itex]y^\prime-y=0[/itex] is
    [tex]y_c = ce^x[/tex]
    where [itex]c[/itex] is an arbitrary constant and
    [tex]y_p = -(x+1)[/tex]
    is a particular solution to the inhomogeneous equation. Combining these,
    [tex]y = ce^x - (1+x)[/tex]
    which meets the initial conditions when [itex]c=2[/itex].
    Last edited: Jan 4, 2006
  5. Jan 19, 2006 #4
    Oh, that was just a typo. Thanks D_H, it ends up that I've forgotten the integration constant.
    About naming, take it easy, I'm just a freshman!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook