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: Another First Ord. Diff. Equation

  1. Jan 18, 2004 #1

    Once again I am having trouble verifying my answer.

    Here is the question:

    Solve the given first-order linear equation and verify that your solution indeed satisfies the equation:

    dy/dx = y/x + 1/x^2, x>0

    Now I get an answer of

    y = -1/2 * 1/x + xC

    But when I sub. back in the the equation

    dy/dx = y/x + 1/x^2

    It doesn't verify. I keep on trying it over and over again, but I keep on getting the same thing. What am I doing wrong?

    Any help is appreciated. Thankyou.
  2. jcsd
  3. Jan 18, 2004 #2


    User Avatar
    Science Advisor
    Gold Member

    I get

    [tex] y = -Cx - \frac{1}{2x} [/tex]

    I didn't verify it, so that may not be it, but maybe it is.

    EDIT: Just verified it, that's should be the answer; looks like you just missed a sign somewhere.
  4. Jan 18, 2004 #3
    How did you get


    I get this:

    1/x * y = integral of 1/x^3

    which becomes

    1/x * y = -1/2 * 1/x^2 + C


    y = -1/2 * 1/x + Cx

    How did you get -Cx?

    Some more nfo.

    When I try to find the integrating factor I know that

    f(x) = - 1/x

    Integrating that I get

    - ln x

    which is the same as

    ln x^-1

    When this is to the power of e

    e^ln x^-1 = 1/x

    This is correct right?

    So my integrating factor should be 1/x right?
    Last edited by a moderator: Jan 18, 2004
  5. Jan 18, 2004 #4


    User Avatar
    Science Advisor
    Gold Member

    First, I found the integrating factor to get an exact equation:

    - rearrange [tex] \frac{dy}{dx} = \frac{y}{x} + \frac{1}{x^2} [/tex] to get

    [tex] M(x,y)dx + N(x,y)dy = 0 [/tex]
    [tex] (yx + 1)dx + (-x^2)dy = 0 [/tex]

    find [tex] \frac{\frac{\partial M}{\partial y} - \frac{\partial N}{\partial x}}{N} = \frac{x-(-2x)}{-x^2} = -\frac 3 x [/tex]

    [tex] u(x) = e^{-\int{\frac{3}{x}dx}} = x^{-3} [/tex]

    Now multiply the factor (the equation is now exact, but I'll skip that step (you can check if you want)):

    [tex] \frac{yx+1}{x^3}dx + (-\frac 1 x)dy = 0 [/tex]


    [tex] F(x,y) = C = \int{N(x,y)dy} + \Phi(x) = -\frac y x + \Phi(x) [/tex]

    [tex] \frac{\partial F}{\partial x} = \frac{y}{x^2} + \Phi'(x) = M(x,y) = \frac{yx + 1}{x^3} [/tex]

    Solve for Φ(x) (using algebra and integration) and then find F(x,y):

    [tex] F(x,y) = -\frac y x - \frac{1}{2x^2} = C [/tex]

    Solving for y:

    [tex] y = -Cx - \frac{1}{2x} [/tex]

    which can be verified as the correct answer. Does that help?
    Last edited: Jan 18, 2004
  6. Jan 18, 2004 #5
    I'm not too familiar with the first part. If that is the way you did it then that is where I got into trouble. I am not too familiar with that notation either.

    Typically we try to get the equation into a form of

    y' + F(x)y = Q(x)

    and then try to find the integrating factor as such

    I(x) = e^integral of F(x) dx

    So I would then take the integral of F(x).

    I will have to look over the first part some more and try to figure it out. I might need some help in the first part. If that is not too much trouble.

    Thanks for your help so far.
  7. Jan 18, 2004 #6
    This is what we were shown to do in the text and lecture:

    Put into the form y' + P(x)y = Q(x)

    So that is what I did:

    y' - 1/x * y = 1/x^2.

    From that I have P(x) = -1/x.

    Now I find the integrating factor I(x) where

    I(x) = e^integral of P(x) dx

    So then

    e^integral of -1/x dx



    which is the same as

    x^-1 = 1/x

    That is how we are supposed to find the integrating factor. I haven't your procedure before. If you say your answer is correct I would have to believe you since my way is not checking out.

    Can you see any similarity to the way you are doing it and the way I am doing it? And if so, can you show me those similarities? If it isn't too much trouble.

    Thanks for your time james.
  8. Jan 19, 2004 #7


    User Avatar
    Science Advisor
    Gold Member

    Ugh. We're both right. Well, you're more right because I didn't realize you were right.

    Anyway, the sign on an arbitrary constant C clearly doesn't matter, so

    [tex] y = C_1x- \frac{1}{2x} = -C_2x-\frac{1}{2x} [/tex]

    same difference.

    Doublecheck your verification step; it should work out:
    [tex] y' = C + \frac{1}{2x^2} [/tex]
    [tex] \frac y x = C - \frac{1}{2x^2} [/tex]
    [tex] y' - \frac y x + \frac{1}{x^2} = (C + \frac{1}{2x^2}) - (C - \frac{1}{2x^2}) - \frac{1}{x^2} = 0 [/tex]

    So that works out.

    Sorry about any foreign notation/formulation I used. I'm a little rusty at this myself and that's just the way I remembered it. Rest assured that both of our formulations accomplish the same task.
  9. Jan 19, 2004 #8
    Hi James,

    First of all, I really appreciate your time and effort. Maybe I have just been looking at this too long.

    When I did what you said and did the verification yet again, it worked out. I must have had some sort of brain malfunction or something.

    Thanks again James.

    Have a good night.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook