Why Can't `DSolve` Find a Solution for this ODE with y[-x]

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











up vote
1
down vote

favorite












I wanted to find a accuracy solution of the following ODE.



$$y'(x)+y(x)=-y(-x).$$



But when I try to use DSolve as follows



DSolve[y'[x] + y[x] == -y[-x], y[x], x]


I get a warning message:




DSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in y[x]+(y^[Prime])[x]==-y[-x] should literally match the independent variables.




How can I solve this equation with $y(-x)$?










share|improve this question









New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2




    As the warning message says, the argument to the dependent variable must be exactly the same as in the last parameter. This is like as if you wrote DSolve[ y'[x]+1==y[z],y[x],x] . May be if you explain what you want to write y[-x] in there instead of y[x] it will help.
    – Nasser
    4 hours ago















up vote
1
down vote

favorite












I wanted to find a accuracy solution of the following ODE.



$$y'(x)+y(x)=-y(-x).$$



But when I try to use DSolve as follows



DSolve[y'[x] + y[x] == -y[-x], y[x], x]


I get a warning message:




DSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in y[x]+(y^[Prime])[x]==-y[-x] should literally match the independent variables.




How can I solve this equation with $y(-x)$?










share|improve this question









New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2




    As the warning message says, the argument to the dependent variable must be exactly the same as in the last parameter. This is like as if you wrote DSolve[ y'[x]+1==y[z],y[x],x] . May be if you explain what you want to write y[-x] in there instead of y[x] it will help.
    – Nasser
    4 hours ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I wanted to find a accuracy solution of the following ODE.



$$y'(x)+y(x)=-y(-x).$$



But when I try to use DSolve as follows



DSolve[y'[x] + y[x] == -y[-x], y[x], x]


I get a warning message:




DSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in y[x]+(y^[Prime])[x]==-y[-x] should literally match the independent variables.




How can I solve this equation with $y(-x)$?










share|improve this question









New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I wanted to find a accuracy solution of the following ODE.



$$y'(x)+y(x)=-y(-x).$$



But when I try to use DSolve as follows



DSolve[y'[x] + y[x] == -y[-x], y[x], x]


I get a warning message:




DSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in y[x]+(y^[Prime])[x]==-y[-x] should literally match the independent variables.




How can I solve this equation with $y(-x)$?







differential-equations






share|improve this question









New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 4 hours ago









AccidentalFourierTransform

4,6771839




4,6771839






New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 5 hours ago









slogvintage

63




63




New contributor




slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






slogvintage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 2




    As the warning message says, the argument to the dependent variable must be exactly the same as in the last parameter. This is like as if you wrote DSolve[ y'[x]+1==y[z],y[x],x] . May be if you explain what you want to write y[-x] in there instead of y[x] it will help.
    – Nasser
    4 hours ago













  • 2




    As the warning message says, the argument to the dependent variable must be exactly the same as in the last parameter. This is like as if you wrote DSolve[ y'[x]+1==y[z],y[x],x] . May be if you explain what you want to write y[-x] in there instead of y[x] it will help.
    – Nasser
    4 hours ago








2




2




As the warning message says, the argument to the dependent variable must be exactly the same as in the last parameter. This is like as if you wrote DSolve[ y'[x]+1==y[z],y[x],x] . May be if you explain what you want to write y[-x] in there instead of y[x] it will help.
– Nasser
4 hours ago





As the warning message says, the argument to the dependent variable must be exactly the same as in the last parameter. This is like as if you wrote DSolve[ y'[x]+1==y[z],y[x],x] . May be if you explain what you want to write y[-x] in there instead of y[x] it will help.
– Nasser
4 hours ago











2 Answers
2






active

oldest

votes

















up vote
4
down vote













Take
$$
y'(x)+y(x)+y(-x)=0
$$



Write the same equation, with $xto-x$:
$$
y'(-x)+y(x)+y(-x)=0
$$

and subtract the two equations:
$$
y'(x)-y'(-x)=0
$$



Integrate this equation:
$$
y(x)+y(-x)=2y(0)
$$

and plug this back into the initial equation:
$$
y'(x)+2y(0)=0
$$

with solution
$$
y(x)=y(0)(1-2x)
$$



It is easy to check that this solves the initial equation:



y'[x] + y[x] == -y[-x] /. y -> ((-2 y[0] # + y[0]) &)
(* True *)


I hope I didn't mess up the algebra though, so please double check everything.






share|improve this answer



























    up vote
    1
    down vote













    Put g[x] =f[-x], change the sign x in the equation, then we get a system of two equations that has a solution



     DSolve[f'[x] + f[x] + g[x] == 0, -g'[x] + g[x] + f[x] == 
    0, f, g, x]

    Out= f -> Function[x, (1 - x) C[1] - x C[2]],
    g -> Function[x, x C[1] + (1 + x) C[2]]


    From the condition g[x] =f[-x]we find C[1] = C[2]






    share|improve this answer


















    • 1




      You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
      – Carl Woll
      2 hours ago










    • Thank you. We can also use the condition g[x]=f[-x]
      – Alex Trounev
      2 hours ago











    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: "387"
    ;
    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: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    slogvintage is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183870%2fwhy-cant-dsolve-find-a-solution-for-this-ode-with-y-x%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    Take
    $$
    y'(x)+y(x)+y(-x)=0
    $$



    Write the same equation, with $xto-x$:
    $$
    y'(-x)+y(x)+y(-x)=0
    $$

    and subtract the two equations:
    $$
    y'(x)-y'(-x)=0
    $$



    Integrate this equation:
    $$
    y(x)+y(-x)=2y(0)
    $$

    and plug this back into the initial equation:
    $$
    y'(x)+2y(0)=0
    $$

    with solution
    $$
    y(x)=y(0)(1-2x)
    $$



    It is easy to check that this solves the initial equation:



    y'[x] + y[x] == -y[-x] /. y -> ((-2 y[0] # + y[0]) &)
    (* True *)


    I hope I didn't mess up the algebra though, so please double check everything.






    share|improve this answer
























      up vote
      4
      down vote













      Take
      $$
      y'(x)+y(x)+y(-x)=0
      $$



      Write the same equation, with $xto-x$:
      $$
      y'(-x)+y(x)+y(-x)=0
      $$

      and subtract the two equations:
      $$
      y'(x)-y'(-x)=0
      $$



      Integrate this equation:
      $$
      y(x)+y(-x)=2y(0)
      $$

      and plug this back into the initial equation:
      $$
      y'(x)+2y(0)=0
      $$

      with solution
      $$
      y(x)=y(0)(1-2x)
      $$



      It is easy to check that this solves the initial equation:



      y'[x] + y[x] == -y[-x] /. y -> ((-2 y[0] # + y[0]) &)
      (* True *)


      I hope I didn't mess up the algebra though, so please double check everything.






      share|improve this answer






















        up vote
        4
        down vote










        up vote
        4
        down vote









        Take
        $$
        y'(x)+y(x)+y(-x)=0
        $$



        Write the same equation, with $xto-x$:
        $$
        y'(-x)+y(x)+y(-x)=0
        $$

        and subtract the two equations:
        $$
        y'(x)-y'(-x)=0
        $$



        Integrate this equation:
        $$
        y(x)+y(-x)=2y(0)
        $$

        and plug this back into the initial equation:
        $$
        y'(x)+2y(0)=0
        $$

        with solution
        $$
        y(x)=y(0)(1-2x)
        $$



        It is easy to check that this solves the initial equation:



        y'[x] + y[x] == -y[-x] /. y -> ((-2 y[0] # + y[0]) &)
        (* True *)


        I hope I didn't mess up the algebra though, so please double check everything.






        share|improve this answer












        Take
        $$
        y'(x)+y(x)+y(-x)=0
        $$



        Write the same equation, with $xto-x$:
        $$
        y'(-x)+y(x)+y(-x)=0
        $$

        and subtract the two equations:
        $$
        y'(x)-y'(-x)=0
        $$



        Integrate this equation:
        $$
        y(x)+y(-x)=2y(0)
        $$

        and plug this back into the initial equation:
        $$
        y'(x)+2y(0)=0
        $$

        with solution
        $$
        y(x)=y(0)(1-2x)
        $$



        It is easy to check that this solves the initial equation:



        y'[x] + y[x] == -y[-x] /. y -> ((-2 y[0] # + y[0]) &)
        (* True *)


        I hope I didn't mess up the algebra though, so please double check everything.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 4 hours ago









        AccidentalFourierTransform

        4,6771839




        4,6771839




















            up vote
            1
            down vote













            Put g[x] =f[-x], change the sign x in the equation, then we get a system of two equations that has a solution



             DSolve[f'[x] + f[x] + g[x] == 0, -g'[x] + g[x] + f[x] == 
            0, f, g, x]

            Out= f -> Function[x, (1 - x) C[1] - x C[2]],
            g -> Function[x, x C[1] + (1 + x) C[2]]


            From the condition g[x] =f[-x]we find C[1] = C[2]






            share|improve this answer


















            • 1




              You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
              – Carl Woll
              2 hours ago










            • Thank you. We can also use the condition g[x]=f[-x]
              – Alex Trounev
              2 hours ago















            up vote
            1
            down vote













            Put g[x] =f[-x], change the sign x in the equation, then we get a system of two equations that has a solution



             DSolve[f'[x] + f[x] + g[x] == 0, -g'[x] + g[x] + f[x] == 
            0, f, g, x]

            Out= f -> Function[x, (1 - x) C[1] - x C[2]],
            g -> Function[x, x C[1] + (1 + x) C[2]]


            From the condition g[x] =f[-x]we find C[1] = C[2]






            share|improve this answer


















            • 1




              You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
              – Carl Woll
              2 hours ago










            • Thank you. We can also use the condition g[x]=f[-x]
              – Alex Trounev
              2 hours ago













            up vote
            1
            down vote










            up vote
            1
            down vote









            Put g[x] =f[-x], change the sign x in the equation, then we get a system of two equations that has a solution



             DSolve[f'[x] + f[x] + g[x] == 0, -g'[x] + g[x] + f[x] == 
            0, f, g, x]

            Out= f -> Function[x, (1 - x) C[1] - x C[2]],
            g -> Function[x, x C[1] + (1 + x) C[2]]


            From the condition g[x] =f[-x]we find C[1] = C[2]






            share|improve this answer














            Put g[x] =f[-x], change the sign x in the equation, then we get a system of two equations that has a solution



             DSolve[f'[x] + f[x] + g[x] == 0, -g'[x] + g[x] + f[x] == 
            0, f, g, x]

            Out= f -> Function[x, (1 - x) C[1] - x C[2]],
            g -> Function[x, x C[1] + (1 + x) C[2]]


            From the condition g[x] =f[-x]we find C[1] = C[2]







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 2 hours ago

























            answered 3 hours ago









            Alex Trounev

            3,0951312




            3,0951312







            • 1




              You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
              – Carl Woll
              2 hours ago










            • Thank you. We can also use the condition g[x]=f[-x]
              – Alex Trounev
              2 hours ago













            • 1




              You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
              – Carl Woll
              2 hours ago










            • Thank you. We can also use the condition g[x]=f[-x]
              – Alex Trounev
              2 hours ago








            1




            1




            You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
            – Carl Woll
            2 hours ago




            You could also add f'[0] + 2f[0] == 0 as in @AccidentalFourierTransform's answer.
            – Carl Woll
            2 hours ago












            Thank you. We can also use the condition g[x]=f[-x]
            – Alex Trounev
            2 hours ago





            Thank you. We can also use the condition g[x]=f[-x]
            – Alex Trounev
            2 hours ago











            slogvintage is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            slogvintage is a new contributor. Be nice, and check out our Code of Conduct.












            slogvintage is a new contributor. Be nice, and check out our Code of Conduct.











            slogvintage is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183870%2fwhy-cant-dsolve-find-a-solution-for-this-ode-with-y-x%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery