Relations between two reciprocal partial derivatives?












3












$begingroup$


My question is similar to How to get the partial derivative of the inverse functions?

But they are different.



If we have a function $z=z(x,y)$, we can calculate the partial derivative $left.frac{partial^2z}{partial x^2}right|_y$. We can solve the original equation to obtain $x=x(z,y)$, and now we can also calculate the derivative $left.frac{partial^2x}{partial z^2}right|_y$.



I can directly calculate the relation between the two derivatives by hand. The result is
$$left.frac{partial^2z}{partial x^2}right|_y=-left(left.frac{partial x}{partial z}right|_yright)^{-3}cdotleft.frac{partial^2x}{partial z^2}right|_y.$$



What about higher-order derivatives? I think this is not a difficult job in MMA, but I cannot catch the point.










share|improve this question











$endgroup$

















    3












    $begingroup$


    My question is similar to How to get the partial derivative of the inverse functions?

    But they are different.



    If we have a function $z=z(x,y)$, we can calculate the partial derivative $left.frac{partial^2z}{partial x^2}right|_y$. We can solve the original equation to obtain $x=x(z,y)$, and now we can also calculate the derivative $left.frac{partial^2x}{partial z^2}right|_y$.



    I can directly calculate the relation between the two derivatives by hand. The result is
    $$left.frac{partial^2z}{partial x^2}right|_y=-left(left.frac{partial x}{partial z}right|_yright)^{-3}cdotleft.frac{partial^2x}{partial z^2}right|_y.$$



    What about higher-order derivatives? I think this is not a difficult job in MMA, but I cannot catch the point.










    share|improve this question











    $endgroup$















      3












      3








      3





      $begingroup$


      My question is similar to How to get the partial derivative of the inverse functions?

      But they are different.



      If we have a function $z=z(x,y)$, we can calculate the partial derivative $left.frac{partial^2z}{partial x^2}right|_y$. We can solve the original equation to obtain $x=x(z,y)$, and now we can also calculate the derivative $left.frac{partial^2x}{partial z^2}right|_y$.



      I can directly calculate the relation between the two derivatives by hand. The result is
      $$left.frac{partial^2z}{partial x^2}right|_y=-left(left.frac{partial x}{partial z}right|_yright)^{-3}cdotleft.frac{partial^2x}{partial z^2}right|_y.$$



      What about higher-order derivatives? I think this is not a difficult job in MMA, but I cannot catch the point.










      share|improve this question











      $endgroup$




      My question is similar to How to get the partial derivative of the inverse functions?

      But they are different.



      If we have a function $z=z(x,y)$, we can calculate the partial derivative $left.frac{partial^2z}{partial x^2}right|_y$. We can solve the original equation to obtain $x=x(z,y)$, and now we can also calculate the derivative $left.frac{partial^2x}{partial z^2}right|_y$.



      I can directly calculate the relation between the two derivatives by hand. The result is
      $$left.frac{partial^2z}{partial x^2}right|_y=-left(left.frac{partial x}{partial z}right|_yright)^{-3}cdotleft.frac{partial^2x}{partial z^2}right|_y.$$



      What about higher-order derivatives? I think this is not a difficult job in MMA, but I cannot catch the point.







      equation-solving calculus-and-analysis






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 at 17:01









      Carl Woll

      74.6k3100194




      74.6k3100194










      asked Apr 13 at 15:08









      Mark_PhysMark_Phys

      1357




      1357






















          2 Answers
          2






          active

          oldest

          votes


















          3












          $begingroup$

          Here's another approach where I give Derivative a definition so that rules are not needed (it happens automatically). I'll use Michael's starting point:



          eqn = x == f[z[x, y], y]



          x == f[z[x, y], y]




          and differentiate with respect to x:



          deqn = D[eqn, x];
          deqn //InputForm



          1 == Derivative[1, 0][f][z[x, y], y]*Derivative[1, 0][z][x, y]




          Solving for Derivative[1, 0][z][x, y] (which is $left. frac{partial z}{partial x} right|_y$ in your notation):



          Derivative[1, 0][z][x, y] == 1 / Derivative[1, 0][f][z[x, y], y]


          Let's turn this into a definition for Derivative:



          Derivative[1, 0][z][x_, y_] = 1 / Derivative[1, 0][f][z[x, y], y];
          Derivative[n_Integer?Positive, 0][z][x_, y_] := D[Derivative[1, 0][z][x, y], {x, n-1}]


          Your first result can be obtained with:



          Derivative[2, 0][z][x, y] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          or:



          D[z[x, y], {x, 2}] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          Here's a table showing agreement with Michael's results:



          Grid[
          Table[
          {Derivative[n, 0][Inactive@z][x, y], Derivative[n, 0][z][x, y]},
          {n, 4}
          ],
          Dividers -> All
          ] //TeXForm


          $begin{array}{|c|c|}
          hline
          z^{(1,0)}(x,y) & frac{1}{f^{(1,0)}(z(x,y),y)} \
          hline
          z^{(2,0)}(x,y) & -frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3} \
          hline
          z^{(3,0)}(x,y) & frac{3
          f^{(2,0)}(z(x,y),y)^2}{f^{(1,0)}(z(x,y),y)^5}-frac{f^{(3,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y
          )^4} \
          hline
          z^{(4,0)}(x,y) & -frac{15 f^{(2,0)}(z(x,y),y)^3}{f^{(1,0)}(z(x,y),y)^7}+frac{10
          f^{(3,0)}(z(x,y),y)
          f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^6}-frac{f^{(4,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^
          5} \
          hline
          end{array}$






          share|improve this answer











          $endgroup$













          • $begingroup$
            Thank you! your method is suitable for me.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:37



















          4












          $begingroup$

          This iterative method will give substitution rules up to the order equal to the maxorder. It's not a good idea to use x for both a variable and a function name, so I called it f. (For instance, if you want to replace the variable x by a number, Mathematica is also very likely to replace the x in the function x[z, y] by the number, which makes no sense. However the code below produces the right formula, if you use x[z[x, y], y] instead of f[z[x, y], y].)



          iter[{eq_, dz_, derivrules_}] := {#, #2, Join[derivrules, First@Solve[##]]} &[
          D[eq, x] /. derivrules, D[dz, x]];
          maxorder = 4;
          drules = Last@Nest[iter, {x == f[z[x, y], y], z[x, y], {}}, maxorder];

          Column[drules, Dividers -> All]


          Mathematica graphics



          D[z[x, y], {x, 3}] /. drules


          Mathematica graphics






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:35










          • $begingroup$
            @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
            $endgroup$
            – Michael E2
            Apr 14 at 14:09












          Your Answer








          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          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%2f195120%2frelations-between-two-reciprocal-partial-derivatives%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3












          $begingroup$

          Here's another approach where I give Derivative a definition so that rules are not needed (it happens automatically). I'll use Michael's starting point:



          eqn = x == f[z[x, y], y]



          x == f[z[x, y], y]




          and differentiate with respect to x:



          deqn = D[eqn, x];
          deqn //InputForm



          1 == Derivative[1, 0][f][z[x, y], y]*Derivative[1, 0][z][x, y]




          Solving for Derivative[1, 0][z][x, y] (which is $left. frac{partial z}{partial x} right|_y$ in your notation):



          Derivative[1, 0][z][x, y] == 1 / Derivative[1, 0][f][z[x, y], y]


          Let's turn this into a definition for Derivative:



          Derivative[1, 0][z][x_, y_] = 1 / Derivative[1, 0][f][z[x, y], y];
          Derivative[n_Integer?Positive, 0][z][x_, y_] := D[Derivative[1, 0][z][x, y], {x, n-1}]


          Your first result can be obtained with:



          Derivative[2, 0][z][x, y] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          or:



          D[z[x, y], {x, 2}] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          Here's a table showing agreement with Michael's results:



          Grid[
          Table[
          {Derivative[n, 0][Inactive@z][x, y], Derivative[n, 0][z][x, y]},
          {n, 4}
          ],
          Dividers -> All
          ] //TeXForm


          $begin{array}{|c|c|}
          hline
          z^{(1,0)}(x,y) & frac{1}{f^{(1,0)}(z(x,y),y)} \
          hline
          z^{(2,0)}(x,y) & -frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3} \
          hline
          z^{(3,0)}(x,y) & frac{3
          f^{(2,0)}(z(x,y),y)^2}{f^{(1,0)}(z(x,y),y)^5}-frac{f^{(3,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y
          )^4} \
          hline
          z^{(4,0)}(x,y) & -frac{15 f^{(2,0)}(z(x,y),y)^3}{f^{(1,0)}(z(x,y),y)^7}+frac{10
          f^{(3,0)}(z(x,y),y)
          f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^6}-frac{f^{(4,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^
          5} \
          hline
          end{array}$






          share|improve this answer











          $endgroup$













          • $begingroup$
            Thank you! your method is suitable for me.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:37
















          3












          $begingroup$

          Here's another approach where I give Derivative a definition so that rules are not needed (it happens automatically). I'll use Michael's starting point:



          eqn = x == f[z[x, y], y]



          x == f[z[x, y], y]




          and differentiate with respect to x:



          deqn = D[eqn, x];
          deqn //InputForm



          1 == Derivative[1, 0][f][z[x, y], y]*Derivative[1, 0][z][x, y]




          Solving for Derivative[1, 0][z][x, y] (which is $left. frac{partial z}{partial x} right|_y$ in your notation):



          Derivative[1, 0][z][x, y] == 1 / Derivative[1, 0][f][z[x, y], y]


          Let's turn this into a definition for Derivative:



          Derivative[1, 0][z][x_, y_] = 1 / Derivative[1, 0][f][z[x, y], y];
          Derivative[n_Integer?Positive, 0][z][x_, y_] := D[Derivative[1, 0][z][x, y], {x, n-1}]


          Your first result can be obtained with:



          Derivative[2, 0][z][x, y] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          or:



          D[z[x, y], {x, 2}] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          Here's a table showing agreement with Michael's results:



          Grid[
          Table[
          {Derivative[n, 0][Inactive@z][x, y], Derivative[n, 0][z][x, y]},
          {n, 4}
          ],
          Dividers -> All
          ] //TeXForm


          $begin{array}{|c|c|}
          hline
          z^{(1,0)}(x,y) & frac{1}{f^{(1,0)}(z(x,y),y)} \
          hline
          z^{(2,0)}(x,y) & -frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3} \
          hline
          z^{(3,0)}(x,y) & frac{3
          f^{(2,0)}(z(x,y),y)^2}{f^{(1,0)}(z(x,y),y)^5}-frac{f^{(3,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y
          )^4} \
          hline
          z^{(4,0)}(x,y) & -frac{15 f^{(2,0)}(z(x,y),y)^3}{f^{(1,0)}(z(x,y),y)^7}+frac{10
          f^{(3,0)}(z(x,y),y)
          f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^6}-frac{f^{(4,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^
          5} \
          hline
          end{array}$






          share|improve this answer











          $endgroup$













          • $begingroup$
            Thank you! your method is suitable for me.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:37














          3












          3








          3





          $begingroup$

          Here's another approach where I give Derivative a definition so that rules are not needed (it happens automatically). I'll use Michael's starting point:



          eqn = x == f[z[x, y], y]



          x == f[z[x, y], y]




          and differentiate with respect to x:



          deqn = D[eqn, x];
          deqn //InputForm



          1 == Derivative[1, 0][f][z[x, y], y]*Derivative[1, 0][z][x, y]




          Solving for Derivative[1, 0][z][x, y] (which is $left. frac{partial z}{partial x} right|_y$ in your notation):



          Derivative[1, 0][z][x, y] == 1 / Derivative[1, 0][f][z[x, y], y]


          Let's turn this into a definition for Derivative:



          Derivative[1, 0][z][x_, y_] = 1 / Derivative[1, 0][f][z[x, y], y];
          Derivative[n_Integer?Positive, 0][z][x_, y_] := D[Derivative[1, 0][z][x, y], {x, n-1}]


          Your first result can be obtained with:



          Derivative[2, 0][z][x, y] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          or:



          D[z[x, y], {x, 2}] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          Here's a table showing agreement with Michael's results:



          Grid[
          Table[
          {Derivative[n, 0][Inactive@z][x, y], Derivative[n, 0][z][x, y]},
          {n, 4}
          ],
          Dividers -> All
          ] //TeXForm


          $begin{array}{|c|c|}
          hline
          z^{(1,0)}(x,y) & frac{1}{f^{(1,0)}(z(x,y),y)} \
          hline
          z^{(2,0)}(x,y) & -frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3} \
          hline
          z^{(3,0)}(x,y) & frac{3
          f^{(2,0)}(z(x,y),y)^2}{f^{(1,0)}(z(x,y),y)^5}-frac{f^{(3,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y
          )^4} \
          hline
          z^{(4,0)}(x,y) & -frac{15 f^{(2,0)}(z(x,y),y)^3}{f^{(1,0)}(z(x,y),y)^7}+frac{10
          f^{(3,0)}(z(x,y),y)
          f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^6}-frac{f^{(4,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^
          5} \
          hline
          end{array}$






          share|improve this answer











          $endgroup$



          Here's another approach where I give Derivative a definition so that rules are not needed (it happens automatically). I'll use Michael's starting point:



          eqn = x == f[z[x, y], y]



          x == f[z[x, y], y]




          and differentiate with respect to x:



          deqn = D[eqn, x];
          deqn //InputForm



          1 == Derivative[1, 0][f][z[x, y], y]*Derivative[1, 0][z][x, y]




          Solving for Derivative[1, 0][z][x, y] (which is $left. frac{partial z}{partial x} right|_y$ in your notation):



          Derivative[1, 0][z][x, y] == 1 / Derivative[1, 0][f][z[x, y], y]


          Let's turn this into a definition for Derivative:



          Derivative[1, 0][z][x_, y_] = 1 / Derivative[1, 0][f][z[x, y], y];
          Derivative[n_Integer?Positive, 0][z][x_, y_] := D[Derivative[1, 0][z][x, y], {x, n-1}]


          Your first result can be obtained with:



          Derivative[2, 0][z][x, y] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          or:



          D[z[x, y], {x, 2}] //TeXForm


          $-frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3}$



          Here's a table showing agreement with Michael's results:



          Grid[
          Table[
          {Derivative[n, 0][Inactive@z][x, y], Derivative[n, 0][z][x, y]},
          {n, 4}
          ],
          Dividers -> All
          ] //TeXForm


          $begin{array}{|c|c|}
          hline
          z^{(1,0)}(x,y) & frac{1}{f^{(1,0)}(z(x,y),y)} \
          hline
          z^{(2,0)}(x,y) & -frac{f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^3} \
          hline
          z^{(3,0)}(x,y) & frac{3
          f^{(2,0)}(z(x,y),y)^2}{f^{(1,0)}(z(x,y),y)^5}-frac{f^{(3,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y
          )^4} \
          hline
          z^{(4,0)}(x,y) & -frac{15 f^{(2,0)}(z(x,y),y)^3}{f^{(1,0)}(z(x,y),y)^7}+frac{10
          f^{(3,0)}(z(x,y),y)
          f^{(2,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^6}-frac{f^{(4,0)}(z(x,y),y)}{f^{(1,0)}(z(x,y),y)^
          5} \
          hline
          end{array}$







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 at 17:04

























          answered Apr 13 at 16:41









          Carl WollCarl Woll

          74.6k3100194




          74.6k3100194












          • $begingroup$
            Thank you! your method is suitable for me.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:37


















          • $begingroup$
            Thank you! your method is suitable for me.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:37
















          $begingroup$
          Thank you! your method is suitable for me.
          $endgroup$
          – Mark_Phys
          Apr 14 at 12:37




          $begingroup$
          Thank you! your method is suitable for me.
          $endgroup$
          – Mark_Phys
          Apr 14 at 12:37











          4












          $begingroup$

          This iterative method will give substitution rules up to the order equal to the maxorder. It's not a good idea to use x for both a variable and a function name, so I called it f. (For instance, if you want to replace the variable x by a number, Mathematica is also very likely to replace the x in the function x[z, y] by the number, which makes no sense. However the code below produces the right formula, if you use x[z[x, y], y] instead of f[z[x, y], y].)



          iter[{eq_, dz_, derivrules_}] := {#, #2, Join[derivrules, First@Solve[##]]} &[
          D[eq, x] /. derivrules, D[dz, x]];
          maxorder = 4;
          drules = Last@Nest[iter, {x == f[z[x, y], y], z[x, y], {}}, maxorder];

          Column[drules, Dividers -> All]


          Mathematica graphics



          D[z[x, y], {x, 3}] /. drules


          Mathematica graphics






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:35










          • $begingroup$
            @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
            $endgroup$
            – Michael E2
            Apr 14 at 14:09
















          4












          $begingroup$

          This iterative method will give substitution rules up to the order equal to the maxorder. It's not a good idea to use x for both a variable and a function name, so I called it f. (For instance, if you want to replace the variable x by a number, Mathematica is also very likely to replace the x in the function x[z, y] by the number, which makes no sense. However the code below produces the right formula, if you use x[z[x, y], y] instead of f[z[x, y], y].)



          iter[{eq_, dz_, derivrules_}] := {#, #2, Join[derivrules, First@Solve[##]]} &[
          D[eq, x] /. derivrules, D[dz, x]];
          maxorder = 4;
          drules = Last@Nest[iter, {x == f[z[x, y], y], z[x, y], {}}, maxorder];

          Column[drules, Dividers -> All]


          Mathematica graphics



          D[z[x, y], {x, 3}] /. drules


          Mathematica graphics






          share|improve this answer









          $endgroup$













          • $begingroup$
            Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:35










          • $begingroup$
            @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
            $endgroup$
            – Michael E2
            Apr 14 at 14:09














          4












          4








          4





          $begingroup$

          This iterative method will give substitution rules up to the order equal to the maxorder. It's not a good idea to use x for both a variable and a function name, so I called it f. (For instance, if you want to replace the variable x by a number, Mathematica is also very likely to replace the x in the function x[z, y] by the number, which makes no sense. However the code below produces the right formula, if you use x[z[x, y], y] instead of f[z[x, y], y].)



          iter[{eq_, dz_, derivrules_}] := {#, #2, Join[derivrules, First@Solve[##]]} &[
          D[eq, x] /. derivrules, D[dz, x]];
          maxorder = 4;
          drules = Last@Nest[iter, {x == f[z[x, y], y], z[x, y], {}}, maxorder];

          Column[drules, Dividers -> All]


          Mathematica graphics



          D[z[x, y], {x, 3}] /. drules


          Mathematica graphics






          share|improve this answer









          $endgroup$



          This iterative method will give substitution rules up to the order equal to the maxorder. It's not a good idea to use x for both a variable and a function name, so I called it f. (For instance, if you want to replace the variable x by a number, Mathematica is also very likely to replace the x in the function x[z, y] by the number, which makes no sense. However the code below produces the right formula, if you use x[z[x, y], y] instead of f[z[x, y], y].)



          iter[{eq_, dz_, derivrules_}] := {#, #2, Join[derivrules, First@Solve[##]]} &[
          D[eq, x] /. derivrules, D[dz, x]];
          maxorder = 4;
          drules = Last@Nest[iter, {x == f[z[x, y], y], z[x, y], {}}, maxorder];

          Column[drules, Dividers -> All]


          Mathematica graphics



          D[z[x, y], {x, 3}] /. drules


          Mathematica graphics







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 13 at 15:42









          Michael E2Michael E2

          151k12203482




          151k12203482












          • $begingroup$
            Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:35










          • $begingroup$
            @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
            $endgroup$
            – Michael E2
            Apr 14 at 14:09


















          • $begingroup$
            Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
            $endgroup$
            – Mark_Phys
            Apr 14 at 12:35










          • $begingroup$
            @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
            $endgroup$
            – Michael E2
            Apr 14 at 14:09
















          $begingroup$
          Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
          $endgroup$
          – Mark_Phys
          Apr 14 at 12:35




          $begingroup$
          Thanks, @Michael E2! Your method works well. Because I am not an expert in MMA, I think Woll's method is more understandable. I will choose Woll's answer as the solution.
          $endgroup$
          – Mark_Phys
          Apr 14 at 12:35












          $begingroup$
          @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
          $endgroup$
          – Michael E2
          Apr 14 at 14:09




          $begingroup$
          @Mark_Phys You're welcome. Carl's method is more elegant (I think), especially since it automatically figures out the derivative whatever the order. I might not use it myself as it is, because it effectively hard codes the derivatives of z in terms of f for the kernel session. (On a given day, I might have several projects, something I'm developing, say, plus testing my code and other little things for courses I teach and so forth. The lurking definitions of Derivative might cause problems unexpectedly.) It can be fixed, but the simpler approach will probably work fine for you
          $endgroup$
          – Michael E2
          Apr 14 at 14:09


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195120%2frelations-between-two-reciprocal-partial-derivatives%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Plaza Victoria

          In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

          How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...