Results 1 to 8 of 8

Math Help - Solving a first-order nonlinear ordinary differential equation

  1. #1
    Junior Member
    Joined
    Sep 2009
    Posts
    34

    Solving a first-order nonlinear ordinary differential equation

    xy' + y^2 = 1, y(1) = 0
    xy' = 1 - y^2
    dy / (1-y^2) = dx / x

    Need to take into account the possiblity of having "divided away" solution. We check if = +/- 1 are solutions by inserting them into the equation. They aren't solutions.

    Moving on. We get (1/2)ln|1+y| - (1/2)ln|1-y| = ln|x| + C

    This is where I'm stuck. Since we have the initial condition y(1) = 0 we need to figure out C in this step before moving on, right? What I've done in previous exercises is to isolate y and take it from there, but I don't know how to do it in this case. I've tried doing the following:

    ln| (1+y) / (1-y) | = ln|x|^2 + 2C
    Multiply with e and we get
    | (1+y) / (1-y) | = x^2 + e^(2C)

    But, well, I can't get it to work out.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    11,548
    Thanks
    1418
    It's easiest if you write your starting arbitrary constant as ln(C), which is still a constant. Then you can simplify using logarithm rules.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Sep 2009
    Posts
    34
    Oh.

    So, then it goes:
    (1/2)ln| 1+y | - (1/2)ln| 1-y | = ln| x | + ln| C |
    ln (1+y) / (1-y) = ln| x |^2 + ln | C | ^2

    Multiply by e
    (1+y) / (1-y) = x^2 + C^2
    1+y = (x^2 + C^2)(1-y)
    y = x^2 + C^2 - 1 - y(x^2 + C^2)
    y(1 + x^2 + C^2) = x^2 + C^2 - 1
    y = (x^2 + C^2 - 1) / (x^2 + C^2 + 1)

    y(1) = 0 = (1^2 + C^2 - 1) / (1^2 + C^2 + 1) = C^2 / (2 + C^2) => C = 0

    Solution is y = (x^2 - 1) / (x^2 + 1) (Which according to wolfram is correct)

    I did end up at the correct answer, but is my path there correct?

    Also, it's fine to use ln|C| instead of C, since it's just a constant, that is, it's whatever we want it to be?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,929
    Thanks
    333
    Awards
    1
    Quote Originally Posted by Sabo View Post
    (1/2)ln| 1+y | - (1/2)ln| 1-y | = ln| x | + ln| C |
    ln (1+y) / (1-y) = ln| x |^2 + ln | C | ^2

    Multiply by e
    (1+y) / (1-y) = x^2 + C^2
    You got lucky. Look at the log rules:
    ln|x^2| + ln|C^2| = ln|C^2x^2|

    As it happened the final solution had a condition that gave you a C that worked.

    Quote Originally Posted by Sabo View Post
    Also, it's fine to use ln|C| instead of C, since it's just a constant, that is, it's whatever we want it to be?
    That's correct. Using ln(C) is a common trick to simplify the equations. Note though, you can still simply use C, it's just more complicated. (And not worth the extra trouble.)

    -Dan
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Sep 2009
    Posts
    34
    I can't help but to feel quite lost sometimes when it comes to math.

    You say I got lucky because of the way I did it. But, I didn't do anything wrong, did I? Just because the log rules say that you can do what you did doesn't mean one has to do it that way. Or? It may be a simpler way, but is it a must?

    I'm even a bit curious in regards to using the log rules like that. I can't get the equation to work if I do it.
    y + 1 = C^2x^2(1 - y) = C^2x^2 - C^2x^2y
    y(1 + C^2x^2) = C^2x^2 - 1
    y = (C^2x^2 - 1) / C^2x^2
    If y(1) = 0, that gives (C^2 - 1) / C^2, which would mean C = +/- 1, which isn't a solution. What am I doing wrong?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,929
    Thanks
    333
    Awards
    1
    Quote Originally Posted by Sabo View Post
    I can't help but to feel quite lost sometimes when it comes to math.

    You say I got lucky because of the way I did it. But, I didn't do anything wrong, did I? Just because the log rules say that you can do what you did doesn't mean one has to do it that way. Or? It may be a simpler way, but is it a must?

    I'm even a bit curious in regards to using the log rules like that. I can't get the equation to work if I do it.
    y + 1 = C^2x^2(1 - y) = C^2x^2 - C^2x^2y
    y(1 + C^2x^2) = C^2x^2 - 1
    y = (C^2x^2 - 1) / C^2x^2
    You dropped a "1" from the LHS when you divided:
    y = \frac{C^2x^2 - 1}{C^2x^2 + 1}

    -Dan
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,929
    Thanks
    333
    Awards
    1
    Quote Originally Posted by Sabo View Post
    You say I got lucky because of the way I did it. But, I didn't do anything wrong, did I? Just because the log rules say that you can do what you did doesn't mean one has to do it that way. Or? It may be a simpler way, but is it a must?
    The fact of the matter is that ln(a) + ln(b) = ln(ab). So
    e^{ln(a) + ln(b)} = e^{ln(ab)} = ab

    What you are suggesting is that
    e^{ln(a) + ln(b)} = a + b

    A simple numerical example will prove this wrong. You have to follow the rules. Like I said, you got lucky somewhere.

    -Dan
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Junior Member
    Joined
    Sep 2009
    Posts
    34
    Doh.
    Yeah, see what you mean now. For some reason I was doing e^ln|x|^2 + e^ln|C|^2, when it should be e^(ln|x|^2 + ln|C|^2).

    I still don't get the equation though. y = (C^2x^2 - 1) / (C^2x^2 + 1). y(1) = 0 = (C^2 - 1) / (C^2 + 1). For this to be 0 the numerator has to be 0, no? So C^2 = 1 => C = +/- 1, which is wrong.

    I can't help but to feel a bit stupid right about now. hrms.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. First-order nonlinear ordinary differential equation
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: September 12th 2011, 08:20 PM
  2. First-order nonlinear ordinary differential equations
    Posted in the Differential Equations Forum
    Replies: 3
    Last Post: September 11th 2011, 05:01 PM
  3. Second order ordinary differential equation.......
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: February 27th 2011, 03:26 PM
  4. problem with first-order nonlinear ordinary differential equation
    Posted in the Differential Equations Forum
    Replies: 2
    Last Post: January 23rd 2010, 07:07 AM
  5. Replies: 2
    Last Post: November 25th 2008, 09:29 PM

Search Tags


/mathhelpforum @mathhelpforum