How to declare derivatives of a multivariable function as real in order to get Re and Im part of the expression?

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











up vote
2
down vote

favorite












Re and Im work properly, with appropriate assumptions, in the example like this



Assuming[g[_, _] ∈ Reals, Simplify[Im[3*I*g[r, r2] + 45]]]


On the other hand, if the derivative of the function is also present, similar approach does not work



Assuming[(r | g[_, _] | D[g[_, _], _]) ∈ Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


i.e. does not give back 3*D[g[r, r2], r]



More dramatically,



Assuming[(r | g[_, _] | f[_]) ∈ Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


gives 3 Re[g[r,r2] (f^′)[r]+f[r] (g^(1,0))[r,r2]].



In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.










share|improve this question



























    up vote
    2
    down vote

    favorite












    Re and Im work properly, with appropriate assumptions, in the example like this



    Assuming[g[_, _] ∈ Reals, Simplify[Im[3*I*g[r, r2] + 45]]]


    On the other hand, if the derivative of the function is also present, similar approach does not work



    Assuming[(r | g[_, _] | D[g[_, _], _]) ∈ Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


    i.e. does not give back 3*D[g[r, r2], r]



    More dramatically,



    Assuming[(r | g[_, _] | f[_]) ∈ Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


    gives 3 Re[g[r,r2] (f^′)[r]+f[r] (g^(1,0))[r,r2]].



    In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Re and Im work properly, with appropriate assumptions, in the example like this



      Assuming[g[_, _] ∈ Reals, Simplify[Im[3*I*g[r, r2] + 45]]]


      On the other hand, if the derivative of the function is also present, similar approach does not work



      Assuming[(r | g[_, _] | D[g[_, _], _]) ∈ Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


      i.e. does not give back 3*D[g[r, r2], r]



      More dramatically,



      Assuming[(r | g[_, _] | f[_]) ∈ Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


      gives 3 Re[g[r,r2] (f^′)[r]+f[r] (g^(1,0))[r,r2]].



      In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.










      share|improve this question















      Re and Im work properly, with appropriate assumptions, in the example like this



      Assuming[g[_, _] ∈ Reals, Simplify[Im[3*I*g[r, r2] + 45]]]


      On the other hand, if the derivative of the function is also present, similar approach does not work



      Assuming[(r | g[_, _] | D[g[_, _], _]) ∈ Reals, Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


      i.e. does not give back 3*D[g[r, r2], r]



      More dramatically,



      Assuming[(r | g[_, _] | f[_]) ∈ Reals, Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


      gives 3 Re[g[r,r2] (f^′)[r]+f[r] (g^(1,0))[r,r2]].



      In real problem, I have the function of four variables and mixed partial derivatives, so it would be great if there is some generic way to prescribe all of function's derivatives as Real.







      calculus-and-analysis functions function-construction symbolic complex






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      kglr

      161k8185384




      161k8185384










      asked 2 hours ago









      Thela Hun Ginjeet

      344




      344




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          Use the FullForm of the derivatives:



          Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) ∈ Reals, 
          Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


          enter image description here



          Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) ∈ Reals, 
          Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


          enter image description here






          share|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: "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
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182365%2fhow-to-declare-derivatives-of-a-multivariable-function-as-real-in-order-to-get-r%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
            2
            down vote













            Use the FullForm of the derivatives:



            Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) ∈ Reals, 
            Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


            enter image description here



            Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) ∈ Reals, 
            Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


            enter image description here






            share|improve this answer


























              up vote
              2
              down vote













              Use the FullForm of the derivatives:



              Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) ∈ Reals, 
              Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


              enter image description here



              Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) ∈ Reals, 
              Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


              enter image description here






              share|improve this answer
























                up vote
                2
                down vote










                up vote
                2
                down vote









                Use the FullForm of the derivatives:



                Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) ∈ Reals, 
                Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


                enter image description here



                Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) ∈ Reals, 
                Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


                enter image description here






                share|improve this answer














                Use the FullForm of the derivatives:



                Assuming[(r | g[_, _] | Derivative[1, 0][g][_, _]) ∈ Reals, 
                Simplify[Im[3*I*D[g[r, r2], r] + 45]]]


                enter image description here



                Assuming[(r | g[_, _] | f[_] | Derivative[1, 0][g][_, _] | Derivative[1][f][_]) ∈ Reals, 
                Simplify[Im[3*I*(D[g[r, r2]*f[r], r]) + 45]]]


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 31 mins ago

























                answered 2 hours ago









                kglr

                161k8185384




                161k8185384



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182365%2fhow-to-declare-derivatives-of-a-multivariable-function-as-real-in-order-to-get-r%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    Installing NextGIS Connect into QGIS 3?

                    One-line joke