ODE $ x(y+4)+fracdydx=0 $, with conditions leading to a log of negative number?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












Trivial ODE and trivial question:



$$ x(y+4)+fracdydx=0 $$ with initial conditions $y=-5, x=0$



After we separate variables we get:
$$ -fracdyy+4=x,dx $$



Integrate left and write parts:



$$-ln(y+4)=frac12x^2 + C $$



Here we see that if $y=-5 $ we have a log of negative number.
Trying not to think about it, I proceed as follows:



Exponentiation of both parts:



$$y = e^-1/2x^2-C - 4$$
And then:
$$y = e^-1/2x^2e^-C - 4$$
$$y = e^-1/2x^2C - 4$$
(this new $C $ to $e^-C$ and cannot be negative)
$$-5 = e^0C - 4$$
$$C=-1$$
(but we see that it is in fact negative under given initial conditions)



which gives us the correct answer:



$$y = -e^-1/2x^2 - 4$$



Now I feel that I've cheated somewhere. My only guess that I was able to deal with a log of a negative number and get negative $C $ (which shouldn't be negative) is because I have involved complex numbers between the lines. Is it so? If not, how can I make this solution rigorous?



Thanks!







share|cite|improve this question

















  • 4




    Re your first integration, remember that $int fracf'(y)f(y) dy$ on the left, is $ln(|f(y)| + C$. So in your case, the LHS should result in $-ln(|y+4|)$. Hence ...
    – amWhy
    Jul 23 at 21:47











  • @amWhy Thanks, I totally forgot about it. Then $ |y+4| = e^-1/2x^2-C $. Should I get rid of abs value by considering $ y<-4 $ and $ y ge-4 $ next ?
    – type2
    Jul 23 at 21:58











  • That would be a good idea!
    – amWhy
    Jul 23 at 22:01










  • @amWhy So if $ y<-4 $: $ -y-4=e^-1/2x^2-C $ and $ y= -e^-1/2x^2-C - 4$, then $ -5 = -e^-C - 4 $ and hence $ C=0 $ which gives the correct answer. Now if if $ y ge -4 $: $ y+4=e^-1/2x^2-C $ and and $ y= e^-1/2x^2-C - 4$ then $ -5= e^-C - 4$ which has no real solutions for $ C $, right?
    – type2
    Jul 23 at 22:16










  • @amWhy btw, feel free to post your first comment as an answer and I will accept it, thanks!
    – type2
    Jul 23 at 22:18














up vote
3
down vote

favorite












Trivial ODE and trivial question:



$$ x(y+4)+fracdydx=0 $$ with initial conditions $y=-5, x=0$



After we separate variables we get:
$$ -fracdyy+4=x,dx $$



Integrate left and write parts:



$$-ln(y+4)=frac12x^2 + C $$



Here we see that if $y=-5 $ we have a log of negative number.
Trying not to think about it, I proceed as follows:



Exponentiation of both parts:



$$y = e^-1/2x^2-C - 4$$
And then:
$$y = e^-1/2x^2e^-C - 4$$
$$y = e^-1/2x^2C - 4$$
(this new $C $ to $e^-C$ and cannot be negative)
$$-5 = e^0C - 4$$
$$C=-1$$
(but we see that it is in fact negative under given initial conditions)



which gives us the correct answer:



$$y = -e^-1/2x^2 - 4$$



Now I feel that I've cheated somewhere. My only guess that I was able to deal with a log of a negative number and get negative $C $ (which shouldn't be negative) is because I have involved complex numbers between the lines. Is it so? If not, how can I make this solution rigorous?



Thanks!







share|cite|improve this question

















  • 4




    Re your first integration, remember that $int fracf'(y)f(y) dy$ on the left, is $ln(|f(y)| + C$. So in your case, the LHS should result in $-ln(|y+4|)$. Hence ...
    – amWhy
    Jul 23 at 21:47











  • @amWhy Thanks, I totally forgot about it. Then $ |y+4| = e^-1/2x^2-C $. Should I get rid of abs value by considering $ y<-4 $ and $ y ge-4 $ next ?
    – type2
    Jul 23 at 21:58











  • That would be a good idea!
    – amWhy
    Jul 23 at 22:01










  • @amWhy So if $ y<-4 $: $ -y-4=e^-1/2x^2-C $ and $ y= -e^-1/2x^2-C - 4$, then $ -5 = -e^-C - 4 $ and hence $ C=0 $ which gives the correct answer. Now if if $ y ge -4 $: $ y+4=e^-1/2x^2-C $ and and $ y= e^-1/2x^2-C - 4$ then $ -5= e^-C - 4$ which has no real solutions for $ C $, right?
    – type2
    Jul 23 at 22:16










  • @amWhy btw, feel free to post your first comment as an answer and I will accept it, thanks!
    – type2
    Jul 23 at 22:18












up vote
3
down vote

favorite









up vote
3
down vote

favorite











Trivial ODE and trivial question:



$$ x(y+4)+fracdydx=0 $$ with initial conditions $y=-5, x=0$



After we separate variables we get:
$$ -fracdyy+4=x,dx $$



Integrate left and write parts:



$$-ln(y+4)=frac12x^2 + C $$



Here we see that if $y=-5 $ we have a log of negative number.
Trying not to think about it, I proceed as follows:



Exponentiation of both parts:



$$y = e^-1/2x^2-C - 4$$
And then:
$$y = e^-1/2x^2e^-C - 4$$
$$y = e^-1/2x^2C - 4$$
(this new $C $ to $e^-C$ and cannot be negative)
$$-5 = e^0C - 4$$
$$C=-1$$
(but we see that it is in fact negative under given initial conditions)



which gives us the correct answer:



$$y = -e^-1/2x^2 - 4$$



Now I feel that I've cheated somewhere. My only guess that I was able to deal with a log of a negative number and get negative $C $ (which shouldn't be negative) is because I have involved complex numbers between the lines. Is it so? If not, how can I make this solution rigorous?



Thanks!







share|cite|improve this question













Trivial ODE and trivial question:



$$ x(y+4)+fracdydx=0 $$ with initial conditions $y=-5, x=0$



After we separate variables we get:
$$ -fracdyy+4=x,dx $$



Integrate left and write parts:



$$-ln(y+4)=frac12x^2 + C $$



Here we see that if $y=-5 $ we have a log of negative number.
Trying not to think about it, I proceed as follows:



Exponentiation of both parts:



$$y = e^-1/2x^2-C - 4$$
And then:
$$y = e^-1/2x^2e^-C - 4$$
$$y = e^-1/2x^2C - 4$$
(this new $C $ to $e^-C$ and cannot be negative)
$$-5 = e^0C - 4$$
$$C=-1$$
(but we see that it is in fact negative under given initial conditions)



which gives us the correct answer:



$$y = -e^-1/2x^2 - 4$$



Now I feel that I've cheated somewhere. My only guess that I was able to deal with a log of a negative number and get negative $C $ (which shouldn't be negative) is because I have involved complex numbers between the lines. Is it so? If not, how can I make this solution rigorous?



Thanks!









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 26 at 16:32









amWhy

189k25219431




189k25219431









asked Jul 23 at 21:43









type2

1285




1285







  • 4




    Re your first integration, remember that $int fracf'(y)f(y) dy$ on the left, is $ln(|f(y)| + C$. So in your case, the LHS should result in $-ln(|y+4|)$. Hence ...
    – amWhy
    Jul 23 at 21:47











  • @amWhy Thanks, I totally forgot about it. Then $ |y+4| = e^-1/2x^2-C $. Should I get rid of abs value by considering $ y<-4 $ and $ y ge-4 $ next ?
    – type2
    Jul 23 at 21:58











  • That would be a good idea!
    – amWhy
    Jul 23 at 22:01










  • @amWhy So if $ y<-4 $: $ -y-4=e^-1/2x^2-C $ and $ y= -e^-1/2x^2-C - 4$, then $ -5 = -e^-C - 4 $ and hence $ C=0 $ which gives the correct answer. Now if if $ y ge -4 $: $ y+4=e^-1/2x^2-C $ and and $ y= e^-1/2x^2-C - 4$ then $ -5= e^-C - 4$ which has no real solutions for $ C $, right?
    – type2
    Jul 23 at 22:16










  • @amWhy btw, feel free to post your first comment as an answer and I will accept it, thanks!
    – type2
    Jul 23 at 22:18












  • 4




    Re your first integration, remember that $int fracf'(y)f(y) dy$ on the left, is $ln(|f(y)| + C$. So in your case, the LHS should result in $-ln(|y+4|)$. Hence ...
    – amWhy
    Jul 23 at 21:47











  • @amWhy Thanks, I totally forgot about it. Then $ |y+4| = e^-1/2x^2-C $. Should I get rid of abs value by considering $ y<-4 $ and $ y ge-4 $ next ?
    – type2
    Jul 23 at 21:58











  • That would be a good idea!
    – amWhy
    Jul 23 at 22:01










  • @amWhy So if $ y<-4 $: $ -y-4=e^-1/2x^2-C $ and $ y= -e^-1/2x^2-C - 4$, then $ -5 = -e^-C - 4 $ and hence $ C=0 $ which gives the correct answer. Now if if $ y ge -4 $: $ y+4=e^-1/2x^2-C $ and and $ y= e^-1/2x^2-C - 4$ then $ -5= e^-C - 4$ which has no real solutions for $ C $, right?
    – type2
    Jul 23 at 22:16










  • @amWhy btw, feel free to post your first comment as an answer and I will accept it, thanks!
    – type2
    Jul 23 at 22:18







4




4




Re your first integration, remember that $int fracf'(y)f(y) dy$ on the left, is $ln(|f(y)| + C$. So in your case, the LHS should result in $-ln(|y+4|)$. Hence ...
– amWhy
Jul 23 at 21:47





Re your first integration, remember that $int fracf'(y)f(y) dy$ on the left, is $ln(|f(y)| + C$. So in your case, the LHS should result in $-ln(|y+4|)$. Hence ...
– amWhy
Jul 23 at 21:47













@amWhy Thanks, I totally forgot about it. Then $ |y+4| = e^-1/2x^2-C $. Should I get rid of abs value by considering $ y<-4 $ and $ y ge-4 $ next ?
– type2
Jul 23 at 21:58





@amWhy Thanks, I totally forgot about it. Then $ |y+4| = e^-1/2x^2-C $. Should I get rid of abs value by considering $ y<-4 $ and $ y ge-4 $ next ?
– type2
Jul 23 at 21:58













That would be a good idea!
– amWhy
Jul 23 at 22:01




That would be a good idea!
– amWhy
Jul 23 at 22:01












@amWhy So if $ y<-4 $: $ -y-4=e^-1/2x^2-C $ and $ y= -e^-1/2x^2-C - 4$, then $ -5 = -e^-C - 4 $ and hence $ C=0 $ which gives the correct answer. Now if if $ y ge -4 $: $ y+4=e^-1/2x^2-C $ and and $ y= e^-1/2x^2-C - 4$ then $ -5= e^-C - 4$ which has no real solutions for $ C $, right?
– type2
Jul 23 at 22:16




@amWhy So if $ y<-4 $: $ -y-4=e^-1/2x^2-C $ and $ y= -e^-1/2x^2-C - 4$, then $ -5 = -e^-C - 4 $ and hence $ C=0 $ which gives the correct answer. Now if if $ y ge -4 $: $ y+4=e^-1/2x^2-C $ and and $ y= e^-1/2x^2-C - 4$ then $ -5= e^-C - 4$ which has no real solutions for $ C $, right?
– type2
Jul 23 at 22:16












@amWhy btw, feel free to post your first comment as an answer and I will accept it, thanks!
– type2
Jul 23 at 22:18




@amWhy btw, feel free to post your first comment as an answer and I will accept it, thanks!
– type2
Jul 23 at 22:18










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










Hint:



Re: your first integration: remember that $$int fracf'(y)f(y)dy = ln(|f(y)|) + C$$



So in your case, the LHS should result in $−ln(|y+4|).$ Hence ...






share|cite|improve this answer





















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2860803%2fode-xy4-fracdydx-0-with-conditions-leading-to-a-log-of-negative-nu%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    Hint:



    Re: your first integration: remember that $$int fracf'(y)f(y)dy = ln(|f(y)|) + C$$



    So in your case, the LHS should result in $−ln(|y+4|).$ Hence ...






    share|cite|improve this answer

























      up vote
      3
      down vote



      accepted










      Hint:



      Re: your first integration: remember that $$int fracf'(y)f(y)dy = ln(|f(y)|) + C$$



      So in your case, the LHS should result in $−ln(|y+4|).$ Hence ...






      share|cite|improve this answer























        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        Hint:



        Re: your first integration: remember that $$int fracf'(y)f(y)dy = ln(|f(y)|) + C$$



        So in your case, the LHS should result in $−ln(|y+4|).$ Hence ...






        share|cite|improve this answer













        Hint:



        Re: your first integration: remember that $$int fracf'(y)f(y)dy = ln(|f(y)|) + C$$



        So in your case, the LHS should result in $−ln(|y+4|).$ Hence ...







        share|cite|improve this answer













        share|cite|improve this answer



        share|cite|improve this answer











        answered Jul 23 at 22:24









        amWhy

        189k25219431




        189k25219431






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2860803%2fode-xy4-fracdydx-0-with-conditions-leading-to-a-log-of-negative-nu%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Color the edges and diagonals of a regular polygon

            Relationship between determinant of matrix and determinant of adjoint?

            What is the equation of a 3D cone with generalised tilt?