Sponsored links: Algebra eBooks
 

Related

scanmap

Run Example
(%i1)load(functs);
(%o1)      /usr/share/maxima/5.21.1/share/simplification/functs.mac
(%i2) sqrtdispflag:false;
(%o2)                                false
(%i3) isolate_wrt_times:true;
(%o3)                                true
(%i4) expr:sqrt(a*x^2 + b*x + 3*x), expand;
                                 2             1/2
(%o4)                        (a x  + b x + 3 x)
(%i5) map(lambda([y], isolate(y, x)), expr);
                                 2             1/2
(%o5)                        (a x  + b x + 3 x)
(%i6) scanmap(lambda([y], isolate(y, x)), expr);
                                 2             1/2
(%o6)                        (a x  + b x + 3 x)
(%i7) 
Run Example
list_of_derivatives(x) := block([result : []], scanmap(lambda([x], if not atom(x) then result : endcons(x, result), x), x), result);
(%o1) list_of_derivatives(x) := block([result : []], 
scanmap(lambda([x], if not atom(x) then result : endcons(x, result), x), x), 
result)
(%i2) list_of_derivatives('diff(y,x,2)+y*'diff(y,z,3)+x^2*'diff(y,x,1,y,2));
           3     2         3          3           3      2      3    3
          d y   d y    2  d y     2  d y     2   d y    d y    d y  d y
(%o2)  [y --- + --- + x  ------, x  ------, x , ------, ---, y ---, ---]
            3     2           2          2           2    2      3    3
          dz    dx       dx dy      dx dy       dx dy   dx     dz   dz
(%i3) 
Run Example
display2d:false;

(%o1) false
(%i2) 
list_of_derivatives(x) := block([result : []], scanmap(lambda([x], if not atom(x) then print(op(x), is(op(x)=op('diff('f(x),x)))), if not atom(x) then result : endcons(x, result), x), x), result);

(%o2) list_of_derivatives(x):=block([result:[]],
                          scanmap(lambda([x],
                                         if not atom(x)
                                             then print(op(x),
                                                        is(
                                                         op(x)
                                                           = op(
                                                           'diff('f(x),x)))),
                                         if not atom(x)
                                             then result:endcons(x,result),x),
                                  x),result)
(%i3) 
list_of_derivatives('diff(y,x,2)+y*'diff(y,z,3)+x^2*'diff(y,x,1,y,2));

+ false 
* false 
^ false 
derivative true 
derivative true 
* false 
derivative true 
(%o3) [y*'diff(y,z,3)+'diff(y,x,2)+x^2*'diff(y,x,1,y,2),x^2*'diff(y,x,1,y,2),
       x^2,'diff(y,x,1,y,2),'diff(y,x,2),y*'diff(y,z,3),'diff(y,z,3)]
(%i4) 

Related Help

Help for Scanmap