Shouldn't del be linear?



On 5/9/07, Nikos Apostolakis <nikos.ap at gmail.com> wrote:
>
> I think that the "differential" del should be a linear operator, so
> that for example del(3*x) should simplify to 3*del(x).


Where to start....

del(ex) is the noun-form corresponding to diff(ex): that is, del(ex) ==
'diff(ex).  Thus you can use forms like del(x*y) to mean "the total
differential of x*y" without having it expand to x*del(y)+y*del(x).  This is
intentional.

Noun forms like this can have simplifications.  Thus, for example,
'limit(3*x,x,inf) simplifies to 3*'limit(x,x,inf).  On the other hand, it
would defeat the purpose of noun forms to have them carry out more
complicated operations.  It would probably make sense to have del( const *
...) simplify to const * del (...).  Would it also make sense to have del(
xxx + yyy ) simplify to del(xxx) + del(yyy)? Probably.  How about del(x^y)
=> x^y*log(x)*del(y)+x^(y-1)*y*del(x) ?  Probably not, because in some
cases, it might be useful to manipulate the more compact form and only carry
through the explicit differentiation after any appropriate substitutions,
assumptions, integration by parts, etc.

There should probably be corresponding simplifications for two-argument diff
noun forms, e.g. 'diff(3*f(x),x) => 3*'diff(f(x),x).

More generally del(f(x)) should simplify to f'(x)*del(x). ...
>
diff(f);
> %, y = 3*x;
>   /*==> 27*x^4*del(3*x)+54*x^4*del(x) <==*/
>
> Am I missing something?  Is there a command that will simplify the
> above expression to 135*x^4*del(x)?


As with other noun forms, del can be expanded out explicitly using ev(
<expr>, del) or ev( <expr>, diff).  Or you can ask Maxima to expand all noun
forms in an expression with ev(<expr>, nouns).  In the above example,

      f : x^2 * y^3$
      df: diff(f)$                    => 3*x^2*y^2*del(y)+2*x*y^3*del(x)
      df3: subst(3*x,y,df)   =>  27*x^4*del(3*x)+54*x^4*del(x)
      ev(df3,del)                  =>  135*x^4*del(x)

Hope this helps,

           -s