Menu

expanddf

arpi
2020-05-11
2020-05-12
  • arpi

    arpi - 2020-05-11

    I am wondering about the properties of the expanddf switch. Why is it, that if i type

    depend {g1,g2}, x;
    on expanddf;
    df(f(g1,g2),x);
    

    I get the expexted result. I find the behaviour somewhat weird, that

    depend g,x;
    on expanddf;
    df(f(g,x),x);
    

    is not expanded (and this is clearly stated in the manual). Is there a simple way to expand such forms?
    Also, if I type

    on expanddf;
    df(f(g1(x),g2(x)),x);
    

    it is also not expanded. Is there a simple way to expand these? Also, things like

    df(f(g1(x),x),x);
    

    Thanks in advance.

     
  • Rainer Schöpf

    Rainer Schöpf - 2020-05-12

    In the second case,

    depend g,x;
    on expanddf;
    df(f(g,x),x);
    

    I suppose you want something like this?

    df(f(g,x),g)*df(g,x) 
      + <partial derivative of f(g,x) w.r.t. its second argument>
    

    And herein lies the crux of the problem: how would that second term be written?

    Have you looked at the dfpart package?

    Rainer

     
    • arpi

      arpi - 2020-05-12

      Thank You, Rainer,
      for your reply. I haven't looked at the DFPART package, but I should have, that's what I was looking for.
      I just found the notation of Reduce (X11 CSL version) a bit confusing, denoting the "total" derivative of f(x,g(x)) by a partial derivative sign.

      Thanks again.

       
      • Arthur Norman

        Arthur Norman - 2020-05-12

        On Tue, 12 May 2020, arpi wrote:

        I just found the notation of Reduce (X11 CSL version) a bit confusing,
        denoting the "total" derivative of f(x,g(x)) by a partial derivative sign.

        There are two levels where notation is set up there. The first is
        conversion from Reduce internal form to a TeX style notation - the code
        there is in packages/tmprint/tmprint.red.
        And I find the easiest way to see the TeX-like stuff is to start Reduce in
        a console not GUI mode eg by
        redcsl -w
        then go
        load_package tmprint; on fancy;
        and then input the form that you want to see the output from. Proposing or
        making adjustments to that conversion happens entirely within the
        Reduce-language source code and so is quite reasonably accessible.

        The interpretation of the TeX is done by CSL-specific C++ code which does
        not support the whole of TeX and which has a particular set of fonts that
        it uses. YOu will find in csl/fox/src/FXShowMath.cpp that the input
        \partial gets mapped onto character 0x40 in a Symbol font and basically
        the table you will find if you search for that near line 2800 shows you
        the current tokens that can be generated and illustrates how you could add
        extra keywords to access other symbols. The available fonts can be
        observed in csl/cslbase/fonts.

        As always, simple changes would be simple and users may often have clearer
        views on the notation that they expect than I for one have! But remember
        that any change motivated by one particular Reduce package ought not to be
        able to damage the experience of those using other packages! Simple
        submitted changes can be merged into the main sources quite rapidly!

        Arthur

         
        • arpi

          arpi - 2020-05-12

          Thank you for your reply, Arthur.

          I've been thinking about it, and i think the problem is more general, not just with reduce.
          For single variable functions, it is more or less clear, there I would definitely use "d" for the total derivative, and \partial for a partial one, i.e., e.g.
          d/dx f(g(x),x) = \partial f(g(x),x) / \partial g g'(x) + \partial f(g(x),x) / \partial x,
          but if x is a vector, it becomes messy (see the usual notation for Euler-Lagrange equations in field theory), there a clear mathematical notation would be way to Bourbakiesque, like
          D( f \circ (g, id)) = (D_1 f) \circ g \dot D(g) + (D_2 f) \circ (g, id)
          which is way too far from traditional notation, and that from reduce.

           

Log in to post a comment.