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: Solve Y'=x-y

  1. Jan 12, 2006 #1
    y'= x-y

    I'm in Calc II and my teacher said that this isn't separable. I know this can be solved though. Does this involve an integrating factor? Any help and I'll try to finish it. This isn't for homework though.
  2. jcsd
  3. Jan 12, 2006 #2


    User Avatar
    Homework Helper

    You can solve the homogenous DE y'+y = 0, find a particular solution of the complete DE and add those.
  4. Jan 12, 2006 #3


    User Avatar
    Science Advisor

    That's not separable but it is a linear equation and there is a simple formula for the integrating factor of a linear equation. For this equation, which could be written as y'+ y= x, an integrating factor would be a function p(x) such that p(x)y'+ p(x)y= (p(x)y)'= p(x)x.
    (p(x)y)', by the product rule, is equal to p(x)y'+ p'(x)y. If that is equal to p(x)y'+ p(x)y, then p(x)y'+ p'(x)y= p(x)y'+ p(x)y which gives you a simple de for p(x).
  5. Jan 12, 2006 #4
    Hmm.. that makes sense. How do I go about finding p(x) though?
  6. Jan 12, 2006 #5
    Well if you have a linnear differential equation of the form
    y' + q(x)y = r(x)
    you want to find the integrating factor p(x) such that
    p(x)y' + p(x)q(x)y = p(x)r(x) and p(x)y' + p(x)q(x)y is integrable.
    If you look at that expression it looks a lot like teh product rule doesn't it
    [tex] \frac d {dx} [/tex] [p(x)y] = p(x)y' + p'(x)y
    well if we want p(x)y' + p(x)q(x)y to be integrable as a product we know that
    p'(x) = p(x)q(x) must be true so you can solve this differential equation which is seperable so you should be able to find a general equation for the integrating factor p(x)
  7. Jan 13, 2006 #6


    User Avatar
    Science Advisor

    I just told you that:
    From p(x)y'+ p'(x)y= p(x)y'+ p(x)y, subtract p(x)y' from both sides to get
    p'(x)y= p(x)y. Divide both sides by y (which, presumably, is not identically 0) to get p'(x)= p(x). That equation should be simple.
  8. Mar 29, 2006 #7
    Ok, so since this post I've done some work of basic D.E. and can do this problem now. Thanks to the above posters for their help. I'm going to restate some things that are said above just for my own sake.

    We have y+y'=x. Now I want to find an integrating factor p(x) such that d\dx(p(x)y)=p(x)+p(x)y'. Solving this out yields that p(x)=p'(x), so obviously this integrating factor is [itex]e^x[/itex].

    Multiplying through by the integrating factor shows that:

    So integrating by parts gives that:[tex](e^x)y=xe^x-e^x+C[/tex]

    Thus [tex]y=x-1+\frac{C}{e^x}[/tex] and I confirm this with the original D.E.

    Look good?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook