Try to obtain the exponent of a variable in Maple.

166 Views Asked by At

Are there some function $f$ in Maple such that $f(K[1,2]^{1/3}) = 1/3$? Any help will be greatly appreciated!

2

There are 2 best solutions below

1
On BEST ANSWER

You basically want

f := x -> op(2,x);

To be safer, you might want to use

f := proc(x::`^`) op(2,x) end;

=========

Edit: as pointed out, this doesn't work when the exponent is 1. Easy fix:

f := proc(x) `if`(x::`^` , op(2,x), 1) end;
1
On

Well..what about

f:=x -> logK[1,2];

                  f := x -> log[K[1, 2]](x)

f(K[1,2]^(1/3));

                             1/3

:)