Results 1 to 13 of 13

Math Help - Differential Eq. - Separation of Variables

  1. #1
    Member VitaX's Avatar
    Joined
    Feb 2009
    From
    Ohio
    Posts
    185

    Differential Eq. - Separation of Variables

    Solve the following Differential Equation:

    \frac{dy}{dx}=x(1-y) , y(1)=0

    \frac{1}{1-y}dy=xdx

    u= 1-y , du=-1dy \rightarrow dy=-du

    -\int \frac{1}{u}du=\int xdx

    -\ln(u) = \frac{x^2}{2} + C \rightarrow -\ln(1-y)=\frac{x^2}{2} + C

    \ln(1-y)=-\frac{x^2}{2} - C \rightarrow 1-y=e^{-\frac{x^2}{2} - C}

    y=-e^{-\frac{x^2}{2} - C} + 1

    Did I do up to here correctly?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    Joined
    Dec 2009
    From
    1111
    Posts
    872
    Thanks
    3
    Quote Originally Posted by VitaX View Post
    Solve the following Differential Equation:

    \frac{dy}{dx}=x(1-y) , y(1)=0

    \frac{1}{1-y}dy=xdx

    u= 1-y , du=-1dy \rightarrow dy=-du

    -\int \frac{1}{u}du=\int xdx

    -\ln(u) = \frac{x^2}{2} + C \rightarrow -\ln(1-y)=\frac{x^2}{2} + C

    \ln(1-y)=-\frac{x^2}{2} - C \rightarrow 1-y=e^{-\frac{x^2}{2} - C}

    y=-e^{-\frac{x^2}{2} - C} + 1

    Did I do up to here correctly?
    Dear VitaX,

    Yes, you are correct.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member VitaX's Avatar
    Joined
    Feb 2009
    From
    Ohio
    Posts
    185
    Quote Originally Posted by Sudharaka View Post
    Dear VitaX,

    Yes, you are correct.
    Alright my problem now is solving for C with the initial condition stated.

    0=-e^{-\frac{(1)^2}{2} - C} + 1

    How do I solve for C now because if I bring 1 to the left side and raise both sides to Ln, that doesn't work out since Ln of -1 is non real answer. What can I do to solve for C?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    11,696
    Thanks
    1512
    Quote Originally Posted by VitaX View Post
    Solve the following Differential Equation:

    \frac{dy}{dx}=x(1-y) , y(1)=0

    \frac{1}{1-y}dy=xdx

    u= 1-y , du=-1dy \rightarrow dy=-du

    -\int \frac{1}{u}du=\int xdx

    -\ln(u) = \frac{x^2}{2} + C \rightarrow -\ln(1-y)=\frac{x^2}{2} + C

    \ln(1-y)=-\frac{x^2}{2} - C \rightarrow 1-y=e^{-\frac{x^2}{2} - C}

    y=-e^{-\frac{x^2}{2} - C} + 1

    Did I do up to here correctly?
    You're missing an important modulus and \pm.


    \frac{dy}{dx} = x(1 - y)

    \frac{1}{1 - y}\,\frac{dy}{dx} = x

    \int{\frac{1}{1 - y}\,\frac{dy}{dx}\,dx} = \int{x\,dx}

    \int{\frac{1}{1 - y}\,dy} = \frac{x^2}{2} + C_1

    -\ln{|1 - y|} + C_2 = \frac{x^2}{2} + C_1

    -\ln{|1 - y|} = \frac{x^2}{2} + C where C = C_1 - C_2

    \ln{|1 - y|} = -\frac{x^2}{2} - C

    |1 - y| = e^{-\frac{x^2}{2} - C}

    |1 - y| = e^{-C}e^{-\frac{x^2}{2}}

    1 - y = Ae^{-\frac{x^2}{2}} where A = \pm e^{-C}

    y = 1 - Ae^{-\frac{x^2}{2}}.


    Now if y(1) = 0 then

    0 = 1 - Ae^{-\frac{1^2}{2}}

    0 = 1 - Ae^{-\frac{1}{2}}

    Ae^{-\frac{1}{2}} = 1

    A = e^{\frac{1}{2}}.


    Therefore y = 1 - e^{\frac{1}{2}}e^{-\frac{x^2}{2}}

    y = 1 - e^{\frac{1}{2} - \frac{x^2}{2}}

    y = 1 - e^{\frac{1 - x^2}{2}}.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member
    Joined
    Dec 2009
    From
    1111
    Posts
    872
    Thanks
    3
    Quote Originally Posted by Prove It View Post
    You're missing an important modulus and \pm.


    \frac{dy}{dx} = x(1 - y)

    \frac{1}{1 - y}\,\frac{dy}{dx} = x

    \color{red}{\int{\frac{1}{1 - y}\,\frac{dy}{dx}\,dx} = \int{x\,dx}}

    \int{\frac{1}{1 - y}\,dy} = \frac{x^2}{2} + C_1

    -\ln{|1 - y|} + C_2 = \frac{x^2}{2} + C_1

    -\ln{|1 - y|} = \frac{x^2}{2} + C where C = C_1 - C_2

    \ln{|1 - y|} = -\frac{x^2}{2} - C

    |1 - y| = e^{-\frac{x^2}{2} - C}

    |1 - y| = e^{-C}e^{-\frac{x^2}{2}}

    1 - y = Ae^{-\frac{x^2}{2}} where A = \pm e^{-C}

    y = 1 - Ae^{-\frac{x^2}{2}}.


    Now if y(1) = 0 then

    0 = 1 - Ae^{-\frac{1^2}{2}}

    0 = 1 - Ae^{-\frac{1}{2}}

    Ae^{-\frac{1}{2}} = 1

    A = e^{\frac{1}{2}}.


    Therefore y = 1 - e^{\frac{1}{2}}e^{-\frac{x^2}{2}}

    y = 1 - e^{\frac{1}{2} - \frac{x^2}{2}}

    y = 1 - e^{\frac{1 - x^2}{2}}.
    Dear Prove It,

    Silly me!! I did'nt notice the error of the modulus sign. Thank you very much for showing us that mistake. Anyhow although insignificant, there is a typo in your third line.

    Goodbye!!
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Member VitaX's Avatar
    Joined
    Feb 2009
    From
    Ohio
    Posts
    185
    I follow you up until you bring A into the equation. I'm not quite sure why you do that because I really wasn't taught anything about that.
    I should say that this question here is from Calculus II, and that we've only just gone into the intro to Differential Equations, nothing serious. Is there another way to do it without introducing the A? What's this modulus?

    Quote Originally Posted by Prove It View Post
    You're missing an important modulus and \pm.


    \frac{dy}{dx} = x(1 - y)

    \frac{1}{1 - y}\,\frac{dy}{dx} = x

    \int{\frac{1}{1 - y}\,\frac{dy}{dx}\,dx} = \int{x\,dx}

    \int{\frac{1}{1 - y}\,dy} = \frac{x^2}{2} + C_1

    -\ln{|1 - y|} + C_2 = \frac{x^2}{2} + C_1

    -\ln{|1 - y|} = \frac{x^2}{2} + C where C = C_1 - C_2

    \ln{|1 - y|} = -\frac{x^2}{2} - C

    |1 - y| = e^{-\frac{x^2}{2} - C}

    |1 - y| = e^{-C}e^{-\frac{x^2}{2}}

    1 - y = Ae^{-\frac{x^2}{2}} where A = \pm e^{-C}

    y = 1 - Ae^{-\frac{x^2}{2}}.


    Now if y(1) = 0 then

    0 = 1 - Ae^{-\frac{1^2}{2}}

    0 = 1 - Ae^{-\frac{1}{2}}

    Ae^{-\frac{1}{2}} = 1

    A = e^{\frac{1}{2}}.


    Therefore y = 1 - e^{\frac{1}{2}}e^{-\frac{x^2}{2}}

    y = 1 - e^{\frac{1}{2} - \frac{x^2}{2}}

    y = 1 - e^{\frac{1 - x^2}{2}}.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    11,696
    Thanks
    1512
    Quote Originally Posted by Sudharaka View Post
    Dear Prove It,

    Silly me!! I did'nt notice the error of the modulus sign. Thank you very much for showing us that mistake. Anyhow although insignificant, there is a typo in your third line.

    Goodbye!!
    No, there's nothing wrong. I've used the CORRECT notation, not the sloppy "treat the derivative as a fraction" notation.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    11,696
    Thanks
    1512
    Quote Originally Posted by VitaX View Post
    I follow you up until you bring A into the equation. I'm not quite sure why you do that because I really wasn't taught anything about that.
    I should say that this question here is from Calculus II, and that we've only just gone into the intro to Differential Equations, nothing serious. Is there another way to do it without introducing the A?
    You should know the rule for exponentials

    a^{m + n} = a^ma^n.

    All I've done is renamed \pm e^{-C} as A.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Super Member
    Joined
    Dec 2009
    From
    1111
    Posts
    872
    Thanks
    3
    Quote Originally Posted by Prove It View Post
    No, there's nothing wrong. I've used the CORRECT notation, not the sloppy "treat the derivative as a fraction" notation.
    Ah!! I get it. Thanks again.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Member VitaX's Avatar
    Joined
    Feb 2009
    From
    Ohio
    Posts
    185
    Quote Originally Posted by Prove It View Post
    You should know the rule for exponentials

    a^{m + n} = a^ma^n.

    All I've done is renamed \pm e^{-C} as A.
    Yah I know that rule. I guess I just didn't figure a substitution needed to be done here as we've never really used one like you did in our problems. Why the +/- though? I suppose that's because it is still an intro to Differential Equations. And also I was wondering what your 3rd line was about, but I see now. And the "sloppy" method of treating the derivative as a fraction. That's the method I was taught in class so far

    Edit:

    y=-e^{-\frac{x^2}{2}}e^{-C} + 1 \rightarrow 0=-e^{-\frac{(1)^2}{2}}e^{-C} + 1

    -\frac{1}{e^{-C}}=-e^{-\frac{1}{2}} \rightarrow -e^C=-e^{\frac{1}{2}}

    \ln-e^C=\ln-e^{\frac{1}{2}} \rightarrow -C=-\frac{1}{2}

    C=\frac{1}{2}

    So this is what you were getting at basically? If not where did I go wrong?

    Plug back in:

    y=-e^{\frac{-x^2-1}{2}} + 1
    Last edited by VitaX; April 14th 2010 at 03:26 AM.
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Member VitaX's Avatar
    Joined
    Feb 2009
    From
    Ohio
    Posts
    185
    The only differences between our answers is a minus sign:

    My answer: y=1-e^{\frac{-x^2-1}{2}}

    Prove's answer: y=1-e^{\frac{-x^2+1}{2}}

    I should say that I have to then compare or do % error between some values in Euler's Rule, which I already did. And Your answer is the correct one. Can anyone tell me how I got an extra minus sign in there? Or perhaps my value for C I obtained is wrong?
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Super Member
    Joined
    Dec 2009
    From
    1111
    Posts
    872
    Thanks
    3
    Quote Originally Posted by VitaX View Post
    Yah I know that rule. I guess I just didn't figure a substitution needed to be done here as we've never really used one like you did in our problems. Why the +/- though? I suppose that's because it is still an intro to Differential Equations. And also I was wondering what your 3rd line was about, but I see now. And the "sloppy" method of treating the derivative as a fraction. That's the method I was taught in class so far

    Edit:

    y=-e^{-\frac{x^2}{2}}e^{-C} + 1 \rightarrow 0=-e^{-\frac{(1)^2}{2}}e^{-C} + 1

    -\frac{1}{e^{-C}}=-e^{-\frac{1}{2}} \rightarrow \color{red}{-e^C=-e^{\frac{1}{2}}}

    \ln-e^C=\ln-e^{\frac{1}{2}} \rightarrow -C=-\frac{1}{2}

    C=\frac{1}{2}

    So this is what you were getting at basically? If not where did I go wrong?

    Plug back in:

    y=-e^{\frac{-x^2-1}{2}} + 1
    Dear VitaX,

    Please check the part highlighted. Did you find the mistake?
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Member VitaX's Avatar
    Joined
    Feb 2009
    From
    Ohio
    Posts
    185
    Quote Originally Posted by Sudharaka View Post
    Dear VitaX,

    Please check the part highlighted. Did you find the mistake?
    Oh, thanks for that. I would have been searching for a while to find my error.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. homogeneous differential equation->separation of variables
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: April 12th 2010, 09:19 AM
  2. Replies: 4
    Last Post: March 29th 2010, 05:55 PM
  3. Replies: 4
    Last Post: August 31st 2009, 06:10 AM
  4. Differential Equations-Separation of variables
    Posted in the Calculus Forum
    Replies: 4
    Last Post: February 5th 2008, 06:34 PM
  5. Separation of variables
    Posted in the Calculus Forum
    Replies: 5
    Last Post: September 9th 2007, 11:15 AM

Search Tags


/mathhelpforum @mathhelpforum