In Maxima, is there any way to list autmatically the variables in an expression?

29 Views Asked by At

Say that you have an expression involving a lot of variables, like xpr: a*x^3 + b*y^2 + c*z - d*sin(t) + e*sqrt(u) + f*v^4 - g*w + h*log(x) + i*cos(y) + j*exp(z) + k*tan(u) - l*sec(v);. Is there any way to get a list [a, b, c, d, e, f, g, h, i, j, k, l, x, y, z, t, u, v, w] of all those variables automatically?

I have tried ratsubst(true, all, args(expr));, but it is not behaving as I would expect, since if there are variables in a multiplication, it returns them multiplied: [j*%e^z,c*z,i*cos(y),b*y^2,h*log(x),a*x^3,-(g*w),-(l*sec(v)),f*v^4,k*tan(u),e*sqrt(u),-(d*sin(t))].

0

There are 0 best solutions below