Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Scanmap Calculator

Scanmap

Function: scanmap (<f>, <expr>)

load(functs);
sqrtdispflag:false;
isolate_wrt_times:true;
expr:sqrt(a*x^2 + b*x + 3*x), expand;
map(lambda([y], isolate(y, x)), expr);
scanmap(lambda([y], isolate(y, x)), expr);

Function: scanmap (<f>, <expr>, bottomup) Recursively applies <f> to <expr>, in a top down manner. This is most useful when complete factorization is desired, for example:

          (%i1) exp:(a^2+2*a+1)*y + x^2$
          (%i2) scanmap(factor,exp);
                                              2      2
          (%o2)                         (a + 1)  y + x

Note the way in which scanmap applies the given function factor to the constituent subexpressions of <expr>; if another form of <expr> is presented to scanmap then the result may be different. Thus, %o2 is not recovered when scanmap is applied to the expanded form of exp:

          (%i3) scanmap(factor,expand(exp));
                                     2                  2
          (%o3)                      a  y + 2 a y + y + x

Here is another example of the way in which scanmap recursively applies a given function to all subexpressions, including exponents:

          (%i4) expr : u*v^(a*x+b) + c$
          (%i5) scanmap(f, expr);
                              f(f(f(a) f(x)) + f(b))
          (%o5) f(f(f(u) f(f(v)                      )) + f(c))

scanmap (<f>, <expr>, bottomup) applies <f> to <expr> in a bottom-up manner. E.g., for undefined f,

scanmap(f,a*x+b) -> f(a*x+b) -> f(f(a*x)+f(b)) -> f(f(f(a)*f(x))+f(b)) scanmap(f,a*x+b,bottomup) -> f(a)*f(x)+f(b) -> f(f(a)*f(x))+f(b) -> f(f(f(a)*f(x))+f(b))

In this case, you get the same answer both ways.

(%o1)                                true
(%i2) 

Scanmap Example

Related Examples