while defining some own functions in Xcas (Windows version) I've found a serious problem -
let me give 2 examples:
Code : Tout sélectionner
diftest(f,x):={
return(diff(f,x));
}
diftest(x^2,x) --> 2*x
diftest(a^2,a) --> 2*a
And now the same with 'integrate':
Code : Tout sélectionner
inttest(f,x):={
return(integrate(f,x));
}
inttest(x^2,x) --> x^3/3
but
inttest(a^2,a) --> a^2*x (???)
It seems that the function 'integrate' does not evaluate the integration variable (x)
when it is used within a function definition, but always uses its unevaluated name.
So it's in fact impossible to use the 'integrate' function in own programs or functions,
which should also work for other variables (given as argument to this program or function).
If this is not a bug but an intended behaviour (and I'm overlooking something),
then please let me know.
Regards,
Franz