Dear everyone,
Hello,
I have a question about how to get the power 'n' in an expression "(x+y)^n". For instance, I have a Maple code
******
eq1:=4*x^n*y^m+(x+y)^n+x^3;
f1:=map(t -> `if`(match(t = c*y^d, y, 's'), subs(s,d), NULL),
convert(eq1, list));
f2:=map(t -> `if`(match(t = c*x^d, x, 's'), subs(s,d), NULL),
convert(eq1, list));
f3:=map(t -> `if`(match(t = c*(x+y)^d, (x+y), 's'), subs(s,d), NULL),
convert(eq1, list));
************
the output is
*********
n m n 3
4 x y + (x + y) + x
[m, 0]
[n, 3]
Error, (in unknown) invalid input: match expects its 2nd argument, vv, to be of type {name, set(name)}, but received x+y
*********
what should I do to get the power of x+y?
Thank you very much in advance
with best regards