Question: incompatible $-char

I was trying to generate a derivative of randomized order in Maple T.A.
It seems impossible to me since the $ in the Maple syntax of
and the $ in the Maple T.A./brownstone syntax needed to denote a variable are incompatible.

Coding, for instance,
$n = range(2,5,1);
$function = maple("diff(x^5,x$($n))");
$n = range(2,5,1);
$function = maple("diff(x^5,x$$n)");
in the algorithm section makes Maple T.A. complain about a syntax error immediately

$n = range(2,5,1);
$function = maple("diff(x^5,x$n)");
leads to
jvm 1 | To Maple --> diff(x^5,x2)
being passed to Maple (taken from wrapper output).

diff(x^5,x2) evaluates to 0, of course.

I was also trying
$n = range(2,5,1);
$function = maple("m:=$n; diff(x^5,x$m)");

This results in
jvm 1 | To Maple --> m:=5;diff(x^5,xm)
being passed to Maple.
Obviously any $ passed to Maple will be stripped.
So it seems to me that it is IMPOSSIBLE to generate a derivative of random order. Can anybody convince me about the opposite?

Please Wait...