In Maple and in Mupad, one would use the subs command to substitue a variable by a value in an expression. But the order of the arguments differ between Maple and Mupad. Therefore, to achieve compatibility, Xcas subs command arguments order depends on the mode
subs returns the expression with the substitution done.
Note that subs does not quote it’s argument, hence
in a normal evaluation process, the substitution variable should
be purged otherwise it will be replaced by it’s assigned value
before substitution is done.
Input in Maple mode (if the variable a is purged else input purge(a)) :
Input in Maple mode (if the variables a and b are purged else input purge(a,b)):
Output (if the variable a is purged else input purge(a)) :
Output (if the variables a and b are purged else input purge(a,b)) :